Skip to content

fix(kiro): steered replies no longer lose or move a trailing "[" - #32759

Closed
only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/kiro-steered-reply-bracket
Closed

only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/kiro-steered-reply-bracket

Conversation

@only21mil

@only21mil only21mil commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After a steer, Kiro's model ends its reply with a [STEERING steer-…] note meant for Kiro's own UI, and the Kiro adapter strips it from the streamed text. Kiro splits that note right after a lone [. So when a chunk ends in something that could start the note ([, [S, … [STEERING steer), the filter holds that text back until the next chunk shows whether it is the note.

Nothing released the held text when no next chunk came:

  • End of turn: steering_cleared dropped the filter's state together with the held text. A steered reply ending in x = [ showed x = .
  • Tool call next: the tool call passed through, and the held text was put in front of the next text chunk, which starts a new assistant message. Checking the list [, then a tool call, then All good. showed Checking the list and [All good..

This only happens in a Kiro turn that received a steer, when a message ends on a prefix of the note. It is rare, but the text is lost or moved silently.

Change

  • makeKiroSteeringNoteFilter (packages/provider-kiro) now releases held text as its own text chunk just before the next non-text update, such as tool_call, or the steer's steering_cleared or steering_injected. Other session_info_update kinds (context_usage, turn_end, …) never release it, because they do not end the message in the shared adapter. In the Kiro recordings, the only other updates sent during a reply are tool calls, which end the message anyway, so a note that is still streaming is not leaked. Text inside a note is still dropped as before.
  • One notification cannot carry both the released text and the tool call. So the shared ACP flavor hook normalizeSessionUpdate (packages/provider-acp) now returns a list, and the adapter handles each item in order. The two other users of the hook (Devin and Copilot in provider-acp-registry) are wrapped where they are configured. Their functions and behavior are unchanged.

Scope and approval

This is a small, focused fix for an obvious bug in the steering-note filter added with Kiro support in #14693. The hook change is the smallest way to emit the extra chunk, and only Kiro returns more than one item. No client, contract or settings change.

Left out on purpose:

  • The \n\n that can remain before a removed note.
  • What happens if a stopped turn never sends steering_cleared. No recording shows Kiro doing that.

Verification

Kiro is not set up on my test machine, so there is no live Kiro run. The proof is the replay harness KiroAdapterV2.test.ts already uses. The new test's frames have the same shape as the live Kiro 2.33.1 recording in testkit/fixtures/kiro_message_steering, with fake text. Replay transcript (frames in → assistant messages out):

steering_injected · "Fill in the blank: x = [" · turn_end · steering_cleared · end_turn
  before: ["Fill in the blank: x = "]          after: ["Fill in the blank: x = ["]

steering_injected · "Checking the list [" · tool_call · tool_call_update · "All good." · turn_end · steering_cleared · end_turn
  before: ["Checking the list ", "[All good."]   after: ["Checking the list [", "All good."]

vp test run src/orchestration-v2/Adapters/KiroAdapterV2.test.ts -t "steering note" --reporter=verbose from apps/server, with the new test on main's source (a9e709f): Tests 2 failed | 21 skipped (23), for the reasons above.

Before: both new steering note cases fail on main

The same command on this branch: Tests 2 passed | 21 skipped (23).

After: both new steering note cases pass

Also on this branch:

  • KiroAdapterV2.test.ts: 23/23 passed.
  • AcpAdapterV2.test.ts: 100/100 passed.
  • KiroReplayFixtures.integration.test.ts: 17/17 passed. It includes the recorded kiro_message_steering turn, whose note is still removed.
  • AcpRegistryReplayFixtures.integration.test.ts: 16/16 passed (Devin and Copilot).
  • vp run check:changed passed: format, lint, knip, typecheck and tests.

Not checked: a live Kiro turn, and a client UI pass. The change is server-only, and every client shows the same projected text.

Prior PRs

Generated with Claude Opus 5.5 in T3 Code Nightly

After a steer, the Kiro adapter holds back a chunk end that could start
Kiro's "[STEERING steer-…]" note. Nothing released it: a reply ending in
"[" lost the bracket at turn end, and a "[" before a tool call moved to
the start of the next message.

The steering filter now releases held text as its own chunk when a
non-text update (such as a tool call) or the steer's start or end
arrives. The shared ACP normalizeSessionUpdate hook returns a list so a
flavor can emit that extra chunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 8, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at dc52fc4

Macroscope's review found this PR approvable — Preserves buffered trailing text in Kiro steered replies before tool updates or steering boundaries. Other ACP providers retain their existing notification behavior, keeping the change narrowly scoped.

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

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The ACP adapter now accepts normalizers that return multiple session notifications and processes each result. Devin and Copilot normalizers are adapted to the array contract. Kiro’s steering-note filter releases buffered assistant text around steering and non-text updates, with replay tests for replies ending in [.

Changes: Session update normalization and Kiro replay

Layer / File(s) Summary
Array-based session update normalization
packages/provider-acp/src/server/adapter.ts, packages/provider-acp-registry/src/server/adapter.ts, apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
The ACP adapter processes every notification returned by a normalizer. Devin and Copilot normalizers wrap each result in an array, and the corresponding tests use the array-based contract.
Kiro steering-note buffering and replay
packages/provider-kiro/src/server/adapter.ts, apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts
The filter releases buffered text before steering lifecycle and non-text updates. Replay tests check assistant text that ends with [ at turn end or spans a read-file tool call.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, shivamhwp

Merge Risk: Minimal · up to dc52f

The reviewed change preserves trailing text in the covered Kiro reply cases. No actionable merge-blocking risk is established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(kiro): steered replies no longer lose or move a trailing "["" is a conventional commit title that names the main change. The changeset fixes the Kiro steering-note filter so that held t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and it includes the required agent/model attribution line. Problem gives the failure …
Full details: Title check

Explanation

The title "fix(kiro): steered replies no longer lose or move a trailing "["" is a conventional commit title that names the main change. The changeset fixes the Kiro steering-note filter so that held text is released instead of being dropped or moved when a steered reply ends with a possible prefix of the note. The title is specific and matches the primary behavior change, so it is related to the main change.

Full details: Description check

Explanation

The description follows the repository template closely. It has Problem, Change, Scope, and Verification sections, and it includes the required agent/model attribution line. Problem gives the failure mode, the two concrete cases, and the reproduction conditions. Change names the affected functions and packages, and it explains why the hook return type changed. Scope links the prior PR #14693, explains why this is a bug fix and not a feature, and lists exclusions. Verification gives the exact command, before/after test counts, related suites, and the checks that were not run, which goes beyond a bare 'tests pass'. The description has no explicit issue link for the bug, but it explains that the fix is for an obvious bug in a recently added filter and cites the originating PR. This is a minor gap and does not block the check. The before/after images are hosted externally and are not committed to the repo, which fits the template rule for PR-only assets.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0450f85 and dc52fc4.

Files selected for processing: 5

  • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts
  • packages/provider-acp-registry/src/server/adapter.ts
  • packages/provider-acp/src/server/adapter.ts
  • packages/provider-kiro/src/server/adapter.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

brandonvincitore pushed a commit to brandonvincitore/t3code that referenced this pull request Nov 9, 2026
Source: pingdotgg#32759 at dc52fc4. Run compaction receipt invalidation on every normalized update.
@only21mil

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

Closing this: I could not run it with a real Kiro sign-in, which I do not have, so the steered-reply fix is shown only by a replay harness and tests. The branch stays on my fork if it is useful.

@only21mil only21mil closed this Nov 12, 2026
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 Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant