Skip to content

fix(web): do not persist terminal context chips - #8422

Open
Adolanium wants to merge 1 commit into
pingdotgg:mainfrom
Adolanium:fix/drop-persisted-terminal-context-chips
Open

fix(web): do not persist terminal context chips#8422
Adolanium wants to merge 1 commit into
pingdotgg:mainfrom
Adolanium:fix/drop-persisted-terminal-context-chips

Conversation

@Adolanium

@Adolanium Adolanium commented Aug 27, 2026

Copy link
Copy Markdown

What Changed

Composer drafts no longer save terminal context chips.

Those chips only stored metadata. The selected text was dropped. Reload filled empty text, so the chip still showed and send skipped the snippet.

Old saved chips are dropped on load. Leftover prompt markers for those chips are stripped. The live session is unchanged. Chips still work until you reload.

Why

The chip looked attached. The snippet was not. Easy to miss.

We are not saving the text, so we should not save the chip.

UI Changes

After a reload, expired terminal chips no longer stay in the composer. No other visual change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (N/A. chips gone after reload is the change)
  • I included a video for animation/interaction changes (N/A)

Note

Low Risk
Localized composer draft persistence behavior; in-session terminal chips are unchanged, with a one-time loss of misleading chips on reload for users with old storage.

Overview
Composer draft persistence no longer saves terminal context chips. Chips still work in an active session; only what gets written to and read from local storage changes.

On save, partialize strips inline terminal placeholder markers from the prompt and omits terminalContexts entirely (previously it stored metadata without the selected text). On load and migration, persisted terminal context entries are ignored, placeholders are stripped from the prompt, and hydrated drafts get an empty terminalContexts list. The dedicated normalizePersistedTerminalContextDraft path was removed.

Tests now assert chips are not round-tripped and that legacy stored chips disappear after reload while surrounding prompt text is kept.

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

Note

Stop persisting terminal context chips in composer draft store

  • Removes terminalContexts from persisted drafts and strips inline terminal context placeholders from the saved prompt in partializeComposerDraftStoreState and normalizePersistedDraftsByThreadId in composerDraftStore.ts
  • On hydrate, toHydratedThreadDraft now always sets terminalContexts to an empty array and strips placeholders from the persisted prompt
  • Deletes the now-unused normalizePersistedTerminalContextDraft helper
  • Behavioral Change: existing persisted drafts with terminalContexts will have them dropped on next hydrate; drafts containing only terminal context placeholders are omitted from persistence entirely

Macroscope summarized 0bfec13.

Drafts saved chip metadata and dropped the selected text. Reload filled
empty text, so the chip still showed and send skipped the snippet.

Do not write those chips. Drop old ones on load and strip the leftover
prompt markers.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a0947dd-57eb-47fa-9538-ccc06db948f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 27, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0bfec13

Macroscope's review found this PR approvable — This is a focused composer persistence fix: terminal context chips are removed from saved drafts and legacy chips are discarded on reload, while active-session behavior and surrounding prompt text remain unchanged. The behavior is localized and covered by targeted round-trip tests.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant