Skip to content

Allow chat corrections to update notes#5780

Merged
ComputelessComputer merged 1 commit into
mainfrom
fix/chat-session-corrections
Jun 26, 2026
Merged

Allow chat corrections to update notes#5780
ComputelessComputer merged 1 commit into
mainfrom
fix/chat-session-corrections

Conversation

@ComputelessComputer

@ComputelessComputer ComputelessComputer commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Adds an exact correction chat tool that can update session summaries and transcripts, wires it into chat guidance, and covers replacement behavior with focused tests.


This is part 2 of 2 in a stack made with GitButler:


Note

Medium Risk
The tool writes directly to Tinybase enhanced_notes and transcripts without undo; incorrect oldText or model misuse could corrupt user note content, though matching is exact and guards limit partial transcript updates.

Overview
Adds a new apply_session_correction chat tool so the assistant can persist user corrections (e.g. “it’s not X but Y”) into local session data instead of only replying in chat.

The tool performs exact oldTextnewText replacements on enhanced note summaries (markdown round-tripped through the editor JSON) and/or transcripts (words token spans plus memo_md), scoped by session and optional enhancedNoteId, with default target summary_and_transcript. Transcript updates require words and memo to both match when both exist; blank replacements are rejected; invalid summary IDs error for summary-only targets but transcript edits can still apply on the default combined target.

It is registered in the chat tool registry with typed I/O, and FILE_CONTEXT_TOOL_GUIDANCE now instructs the model to call this tool (and read_current_note when needed) for correction phrasing. Behavior is covered by a new session-correction.test.ts suite.

Reviewed by Cursor Bugbot for commit 0cd678a. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/desktop/src/chat/tools/session-correction.ts
Comment thread apps/desktop/src/chat/tools/session-correction.ts Outdated
Comment thread apps/desktop/src/chat/tools/session-correction.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-search-unattached-notes branch from a37e581 to 59f4d7f Compare June 26, 2026 09:43
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-session-corrections branch from 84af0c0 to 3297e0c Compare June 26, 2026 09:48
@ComputelessComputer ComputelessComputer changed the base branch from fix/chat-search-unattached-notes to main June 26, 2026 10:06
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-session-corrections branch from 3297e0c to ce57004 Compare June 26, 2026 10:07
@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy Preview for old-char canceled.

Name Link
🔨 Latest commit 0cd678a
🔍 Latest deploy log https://app.netlify.com/projects/old-char/deploys/6a3e60e54a0a2c0008353a51

Comment thread apps/desktop/src/chat/tools/session-correction.ts
Comment thread apps/desktop/src/chat/tools/session-correction.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-session-corrections branch from ce57004 to c22d50b Compare June 26, 2026 10:32
Comment thread apps/desktop/src/chat/tools/session-correction.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-session-corrections branch from c22d50b to c7f5bef Compare June 26, 2026 10:54

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c7f5bef. Configure here.

Comment thread apps/desktop/src/chat/tools/session-correction.ts
Adds an exact correction chat tool that can update session summaries and transcripts, wires it into chat guidance, and covers replacement behavior with focused tests.
@ComputelessComputer ComputelessComputer force-pushed the fix/chat-session-corrections branch from c7f5bef to 0cd678a Compare June 26, 2026 11:22
@ComputelessComputer ComputelessComputer merged commit 01dfd25 into main Jun 26, 2026
14 checks passed
@ComputelessComputer ComputelessComputer deleted the fix/chat-session-corrections branch June 26, 2026 11:42
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.

1 participant