Skip to content

fix(web): preserve thread context when copying or stashing prompts - #18843

Open
saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:t3code/sweep/composer-thread-context-copy
Open

saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:t3code/sweep/composer-thread-context-copy

Conversation

@saphid

@saphid saphid commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Problem

Attach a thread to a prompt with @, then copy that chip into another draft, or stash the prompt and restore it in another thread on the same environment. Both paths export terminal, review-comment and preview context records but not thread records. Only the t3-context link survives, so the destination cannot resolve the chip and sends it as unavailable context instead of the referenced thread. Stashing also leaves the thread records behind in the source draft after clearing its prompt.

Change

  • Copy includes the selected chips' thread records in the clipboard fragment.
  • Stash includes all attached thread records, and clears them from the source draft after a successful stash, like the other context kinds.

The importer already handled thread records; it just never received them.

Scope and approval

A small fix for an obvious bug (6 lines), so it uses the no-prior-issue exception.

Verification

  • Focused probes ran the composer's actual export, import and stash callbacks against the real clipboard schema, draft and stash stores. On main, 3 of 4 fail: clipboard preservation, stash preservation and source cleanup (log). With the fix all 4 pass (log): the thread ID survives a same-environment import alongside a terminal context, only selected records are copied, and a rejected stash write keeps the source records. The probes evaluate extracted component code, so they are not committed. Existing draft, stash and context-reference tests pass (214, log).
  • vp lint and apps/web typecheck: clean.
  • Independent review by Claude Opus 5.5 (high) through a T3 delegated task: no defects. Cross-environment thread references are dropped as before (out of scope, see fix(composer): don't send attached threads to a machine that can't read them #18310).
  • Not run in a browser.

Found by a GPT-6.1 Sol (high) audit and implemented by GPT-6.1 Sol (medium) in T3 Code. Reviewed by Claude Opus 5.5. Coordinated by Claude Opus 5.5 in Claude Code via T3 Code. Agent-authored, sponsored by Alex Southwell.

🤖 Generated with Claude Code

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d45b4c7d-56a6-4205-a6ee-2f2c22444758
📥 Commits

Reviewing files that changed from the base of the PR and between a3c4e9e and 958969e.

📒 Files selected for processing (1)
  • apps/web/src/components/chat/ChatComposer.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 12, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 958969e

Macroscope's review found this PR approvable — This is a small, self-contained web composer bug fix that preserves thread context records through copying and stashing, then clears them consistently from the draft. Its runtime impact is limited to those existing user actions, with no schema, deployment, security, billing, default, or lint-policy changes.

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

This branch has not been deployed

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant