Skip to content

perf: use incremental chat message fingerprinting#40

Merged
charlesrhoward merged 2 commits intomainfrom
codex/feat-28-incremental-chat-fingerprint
Feb 21, 2026
Merged

perf: use incremental chat message fingerprinting#40
charlesrhoward merged 2 commits intomainfrom
codex/feat-28-incremental-chat-fingerprint

Conversation

@charlesrhoward
Copy link
Contributor

@charlesrhoward charlesrhoward commented Feb 21, 2026

Summary

  • replace full-history JSON fingerprinting with lightweight incremental metadata fingerprinting
  • fingerprint now keys off message count and latest message metadata/part profile

Validation

  • pnpm build

Closes #28


Note

Low Risk
Localized performance change in sync change-detection; main risk is missing updates when older messages change or metadata is absent, potentially delaying a save.

Overview
Replaces the chat history change-detection fingerprint from a full JSON.stringify of all messages to a lightweight string based on message count plus the latest message’s id/role/timestamp and a summary of its parts (text length, file/reasoning counts).

This reduces repeated serialization cost during local/cloud persistence and invalidation logic, while keeping behavior centered on detecting changes to the most recent message state.

Written by Cursor Bugbot for commit f72af4c. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawit Ready Ready Preview, Comment Feb 21, 2026 9:55pm

Request Review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4bd258c76

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +459 to +463
if (part.type === "text") {
textPartLength += part.text.length
} else if (part.type === "file") {
filePartCount += 1
} else if (part.type === "reasoning") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include tool invocation state in message fingerprint

This fingerprint only tracks message count plus coarse metadata from the last message (text length and part counts), so updates to tool-invocation parts are not detected when their count stays the same. In this component, addToolResult(...) mutates existing tool-call parts in place; if the tool state/output changes but lengths/counts do not, usePersistMessagesOnChange treats the chat as unchanged and skips cloud/local persistence, which can leave restored sessions with stale or incomplete tool-call state.

Useful? React with 👍 / 👎.

@cursor

This comment has been minimized.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issues.

@cursor
Copy link

cursor bot commented Feb 21, 2026

Bugbot Autofix prepared fixes for 2 of the 2 bugs found in the latest run.

  • ✅ Fixed: Fingerprint ignores all messages except the last one
    • The fingerprint now includes a joined list of all message IDs so earlier-message changes alter the persistence key.
  • ✅ Fixed: Reasoning streaming progress invisible to fingerprint
    • The fingerprint now accumulates reasoning text length, so reasoning-delta growth triggers save detection during streaming.

@charlesrhoward charlesrhoward force-pushed the codex/feat-28-incremental-chat-fingerprint branch from 647c478 to f72af4c Compare February 21, 2026 21:55
@charlesrhoward charlesrhoward merged commit a6847a6 into main Feb 21, 2026
4 checks passed
@charlesrhoward charlesrhoward deleted the codex/feat-28-incremental-chat-fingerprint branch February 21, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: Replace full chat fingerprint stringify with incremental change detection

1 participant