Skip to content

fix(chat): carry dropped session references into a mid-turn steer - #24503

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/steer-carries-session-refs-24471
Oct 27, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/steer-carries-session-refs-24471

Conversation

@JLargent42

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Steering a message into a running chat delivers the sessions dragged into the composer, the same way a normal send does.

Drag another chat session into the composer of a session whose turn is running, type a message, and steer it. Only the typed text reaches the agent. The attached session is silently dropped, and its chip is left behind in the otherwise-cleared composer.

Why it matters

The receiving agent acts on an incomplete instruction, with no error or warning that the attachment was not delivered. The leftover chip is the only cue, and it is easy to miss. Steer is the default action while a turn runs, so this hits the most common path for adding context mid-turn.

Not a goal

  • Steering a composer that holds ONLY session chips and no text. The busy send button is not offered for that state today (busySend.tsx), so such a chip still waits for the turn to end and rides the idle send.
  • Inlining the referenced transcript. A steer carries the same link a send carries, never the transcript.
  • Other steer surfaces. Session chips can only be dropped on the main chat composer.

What changed (motivation → approach → change)

Symptom → cause. A normal send appends each staged session as its link (buildOutgoingTurn, 'send' mode). The steer path built its text in 'steer' mode, which dropped session references on purpose, and steer() in busyTurnControls.ts neither passed them nor cleared them. The reason given was that a failed steer only hands back text, so a cleared chip could be lost.

Why that reason no longer holds. A session reference is just a link in the message text. A refused or unconfirmed steer hands its whole text back to the composer, links included, so nothing is lost. A retry sends each link exactly once.

Change.

Where Before After
outgoingTurn.ts, 'steer' mode session links never appended links appended to the one text, same format as a send
busyTurnControls.ts, steer() refs not passed, chip and its draft left staged refs passed in; chip and its per-slot draft cleared with the text

Backwards compatibility

Compatible: a steer with no staged session is byte-identical to before; a steer with one now also carries its link.

Removes nothing: no key, field, row or capability is taken away; the steer just stops leaving the chip behind.

Tests

  • website/src/test/busyTurnControls.steerSessionRefs.test.ts (new): steering typed text with a dropped session sends text + link and clears the chip and its draft; with no typed text it sends nothing and leaves the chip staged.
  • website/src/chat-core/composer/outgoingTurn.test.ts: the 'steer' row now expects the session link on the one text.

Proof: not provable -- frontend test (prove.py runs Python only). By hand: with busyTurnControls.ts and outgoingTurn.ts reverted to origin/main, appends the session link to the steered text and clears the chip with the text fails; with the fix it passes.

Determinism: both files pass 3 shuffled runs (--sequence.shuffle). The 26 test files that touch session refs or steering pass (763 tests). tsc -p tsconfig.app.json and eslint are clean.

Manual verification

N/A — unit coverage sufficient: the change is which text the existing steer POST carries and which staged state it clears, both asserted directly at steer().

Screenshots / video

Why no screenshot: no component, layout or string changes; the only visible effect is that the existing session chip is cleared on steer, the way it already is on send.

Related Issues

Closes #24471

Sibling sweep

Swept: git grep -nE "buildOutgoingTurn(.*'steer'" -- website/src/
Sibling: website/src/components/useChatPaneSend.ts -- not affected -- the pane composer has no session-chip staging
Sibling: website/src/pages/chat/page/busyTurnControls.ts -- changed here

Pattern harvest

Not generalizable: a single deliberate exclusion in one steer path, now removed; every composer payload already goes through buildOutgoingTurn.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ba192d6074ce21d6936cbeb8d68d5ef397d2620a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the old pin's stated reason, that only text survives a failed steer, is answered directly, because the reference now travels inside that text.

Notes

  • When a steer fails, the session comes back as a plain link inside the restored text, not as a chip. Nothing is lost, but the restored composer looks different from what the user dropped.

[DESIGN-REVIEWED] ba192d6

Description read

[DESCRIPTION-READ] 80c2295a05113170ba95ed1f3722a3c9f8a3decb0a652afeb024ff360982e165

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of ba192d6074ce21d6936cbeb8d68d5ef397d2620a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks: the PR adds no control or string. A steer now carries the session link and clears the chip the same way a send already does.

Notes

  • When a steer is refused or fails, steerMutation puts the message text back in the composer, and that text now includes the link. The user gets a raw link in the input instead of the chip they dropped. Restoring the SessionRef chip on hand-back would keep the composer looking the way the user left it.

[UX-REVIEWED] ba192d6

Description read

[DESCRIPTION-READ] 1119d07d230d6931d5970c354d3a025c3606a9242ed1a1358820f2927b68f9eb

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ba192d6074ce21d6936cbeb8d68d5ef397d2620a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

This fix reuses the send path's existing link appender and the existing chip-clear calls. The PR description quotes the old pin it reverses and answers it: the restore path now carries the links in the text.

What this change ships

Inventory (3 items) — 3 justified

Intent: when a user steers a message into a running chat, the sessions they dragged into the composer reach the agent, the same as on a normal send. This is a FIX (#24471).

  1. A steered message now carries a link to each dropped session after the typed text. — justified
  2. After a steer, the session chip and its saved per-slot draft are cleared along with the text. — justified
  3. A composer holding only session chips still cannot be steered; the chip waits for the idle send. — justified

[FIRST-PRINCIPLES-REVIEWED] ba192d6

Description read

[DESCRIPTION-READ] 6ba3880694133bbcf04fe37918c5fc1de48970909f20221b15a00133d49bda61

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed ba192d6074ce21d6936cbeb8d68d5ef397d2620a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] ba192d6

Verdict parsed from the review's SHA-scoped output markers for commit ba192d6074ce21d6936cbeb8d68d5ef397d2620a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ba192d6074ce21d6936cbeb8d68d5ef397d2620a false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ba192d6074ce21d6936cbeb8d68d5ef397d2620a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ba192d6

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ba192d6074ce21d6936cbeb8d68d5ef397d2620a false-positive: <reason, 20 to 500 characters>

@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note on head 0363783: the two red Windows shards are inherited from main, not from this diff, which only touches website/src/.

A re-run reuses the frozen merge ref, so it cannot clear either one. Holding the head (MERGEABLE, no conflict) until #24531 merges and a rebase is authorized.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 26, 2026
@JLargent42
JLargent42 force-pushed the fix/steer-carries-session-refs-24471 branch from 0363783 to f372ca3 Compare October 26, 2026 23:02
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main (operator-approved) to pick up #24485 and #24531, which fix the inherited Windows (2)/(4) reds. Scope unchanged; new head f372ca3.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 26, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for head f372ca3: Opus 5.5 Review and Screenshot Evidence failed at 23:05Z on GitHub API rate limit exceeded for installation (Opus: permission check before validation; Screenshot Evidence: could not read the PR description after 3 attempts). Neither is a finding about this diff. Re-ran each failed job once. Windows (6) is main-side #24612 (fix #24613).

@JLargent42
JLargent42 force-pushed the fix/steer-carries-session-refs-24471 branch from f372ca3 to ba192d6 Compare October 27, 2026 16:15
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main (operator-approved) for the Windows (6) fix #24609; scope unchanged.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 27, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 27, 2026 21:06

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: a mid-turn steer now carries staged session references as links, as a send does, with tests for both the link and the cleared chip.

@KiroCrewCaptain
KiroCrewCaptain merged commit 9590afd into main Oct 27, 2026
105 of 107 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/steer-carries-session-refs-24471 branch October 27, 2026 21:07
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 27, 2026
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.

Composer: attached session content dropped when steering prompt into running chat

2 participants