Repository navigation
Description
Summary
When an [OPTIONS: …] marker has text after the closing ] on the same line, the marker is not rendered as buttons — the whole line shows as raw text and the turn loses its follow-up pills.
The screenshot above shows it: a steering turn, then the agent's reply glued directly onto the end of the options line, and the entire [OPTIONS: …]… line displayed as plain text instead of clickable choices.
See screenshot below.
What triggers it
The bytes are "prose after the marker on the same line," but the model rarely writes that in one go. The concrete trigger is a mid-turn steering message. From the transcript (dashboard, 2026-09-16):
- The turn emitted its
[OPTIONS: … now]block as the final line of its segment — correctly. (A sibling turn with the same block alone on its line rendered as buttons.) - A steering message arrived mid-turn ("ok good. And about polly, reply that …").
- The agent's reply to that steer ("Anytime. PR #XXXXX is in good shape…") was appended into the same assistant message, right after the
], with no separating newline — giving…fix now]Anytime. PR #XXXXX….
So the options line was last when emitted; the steer reply is what landed text after it. This is the dominant real-world path into the bug and a special case of the general shape "prose emitted after an [OPTIONS:] line."
Where the concatenation happens
_steer_segment_cut in src/kiro_crew/dashboard/chat_runner.py should finalize the pre-steer text as its own segment (assistant_text = "") before the steer user-message persists, so the post-steer reply becomes a separate message. When that cut does not fire (or the two segments are merged on persist), _flush_segment appends pre-steer + post-steer together and the marker is no longer line-final.
Why the render layer then drops it
OPTION_MARKER_RE (website/src/app-sdk/protocol/optionMarker.ts) and its backend twin OPTIONS_RE_LINE (src/kiro_crew/constants.py) anchor the closing bracket to the end of its line (…\][ \t]*$ / …\Z). Any character after the ] on that line breaks the anchor, so no marker matches: stripOptionMarkers / extract_options leave the line visible and never extract the choices.
This is the same class of anchor-breaking tic the grammar already absorbs for a stray ](OPTIONS) link close and for Markdown wrappers (#9110/#9174). "Trailing prose glued after a line-leading marker" is simply not handled yet.
Reproduction
Frontend:
import { parseOptions } from 'website/src/app-sdk/protocol/options'
parseOptions('[OPTIONS: A | B | C]trailing text').options // => [] (expected ['A','B','C'])
parseOptions('[OPTIONS: A | B | C]').options // => ['A','B','C'] (works)Backend:
from kiro_crew.slack.format import extract_options
extract_options('[OPTIONS: A | B | C]trailing text') # => (unchanged text, []) — leaks, no choicesConstraint any fix must respect
The grammar deliberately declines "marker closed, then prose on the same line" for mid-line markers, because that case is undecidable (Use [OPTIONS: A | B] then check arr[0] — did the marker end at ], or does arr[0]'s ] terminate it?). Its guiding rule is to fail toward a visible marker, never deleted prose (#9284/#9341). A fix must not reintroduce that deletion hazard.
The safe signal: the canonical marker is always line-leading (^[ \t]*\[OPTION(S)?:). Recovery restricted to a line-leading complete marker whose trailing remainder is plain prose (no |, no bracket, no further head) leaves every mid-line and unbalanced shape untouched.
Fix layering
- Source: stop a mid-turn steer reply from concatenating onto a segment whose tail is an
[OPTIONS:]line without a separating newline (harden_steer_segment_cut/ segment persistence). Higher blast radius on the steer lifecycle. - Render resilience (defense in depth, and the only thing that repairs already-stored transcripts): reflow a line-leading
[OPTIONS: …]followed by plain trailing prose onto its own line before parsing — never deleting text. PR incoming (frontend + backend, scoped to line-leading markers with a plain-prose remainder guard).
Affected surfaces
Dashboard transcript (observed), and every backend renderer routing through extract_options (Slack / Discord / Telegram / Teams / …), which would lose the pills the same way.
Environment
Dashboard chat surface, 2026-09-16. Kiro Crew macOS app version v0.7.0.3.
Activity
github-actions commentedon Sep 16, 2026
Automated triage summary — generated from the issue text alone, before any maintainer has read it. Treat every line as a starting point, not a verdict.
When a model emits an
[OPTIONS: …]marker at the start of a line but glues prose directly after the closing bracket, the marker is neither parsed nor stripped: the dashboard transcript shows the raw text and the turn's follow-up option pills never appear. The reporter says the same loss applies to channel renderers that extract options server-side.Possibly already reported
If one of these is the same problem, say so and we will close this as a duplicate.
Posted by
issue-summary.yml. The model had no access to the repository — it read only this issue and the titles of recent ones.amadsalmon commentedon Sep 16, 2026
Sharper root cause: mid-turn steer concatenation, not model authoring
Transcript evidence (dashboard session, 2026-09-16) shows the glue does not come from the model authoring
]prosein one emission. The sequence was:[OPTIONS: … now]block as the segment's final line (correct — a sibling turn with the same block, alone on its line, rendered as buttons fine).content, directly after the], with no newline — producing…fix now]Anytime. PR #11360….So the options line was last at emit time; the steer-reply concatenation put text after it.
Where the concatenation happens
_steer_segment_cutinsrc/kiro_crew/dashboard/chat_runner.pyis supposed to finalize the pre-steer text as its own segment (assistant_text = "") right before the steer user-message persists, so the post-steer reply becomes a separate message. When that cut does not fire for a given steer (or persistence merges the two),_flush_segmentappends pre-steer + post-steer text together, and the marker is no longer line-final.Fix layering
[OPTIONS:]line without a separating newline (harden the_steer_segment_cutseam / segment persistence). Higher blast radius on the steer lifecycle.[OPTIONS: …]followed by plain trailing prose as a glued marker and reflow it onto its own line before parsing — never deleting text, and staying out of the mid-line / unbalanced shapes the grammar deliberately declines.I have a render-resilience fix implemented and tested (frontend
optionMarker.ts+ backendconstants.py/slack.format), scoped to line-leading markers with a plain-prose remainder guard so it cannot misfire on the declined shapes. PR incoming.CrysisDeu commentedon Sep 16, 2026
🤖 Kiro Crew Auto-Pipeline [operator: CrysisDeu#0c98c3a2]: routing to needs-investigation.
Checked against current main (
1cd6811f). The steer cut the report names does exist and is wired:chat_runner._steer_segment_cut(~L6960) flushes the pre-steer text as its own segment (quiet_persist=True, interrupted=True) and resetsassistant_text, andchat_delivery.py(~L515) calls it right before persisting the steer user row. So on main the expected transcript order is[assistant(pre-steer), user(steer), assistant(post-steer)], and the]proseglue in the screenshot means one of these happened instead:slot._steer_segment_cutwasNonewhen the steer landed — the handle is bound only after the ACP client is attached (~L7974) and cleared at turn teardown (~L14012), so a steer accepted in the window before the binding, or via a route that does not pass through thechat_deliverytail, would skip the cut._collapse_wire_rowsrebuild afterchat_done.Root cause cannot be stated from code alone; it needs the session's
gateway.logaround the steer (steer_push,steer segment cut failed, and whether amessage/steered/ consumption echo was recorded) plus the persisted history rows for that turn to tell 1 from 2.Agree with the report's constraint: widening
OPTION_MARKER_RE/OPTIONS_RE_LINEto accept trailing prose after a line-leading marker would reopen the deleted-prose hazard (#9284/#9341); the fix belongs at the segment boundary, not in the grammar. For a human: reproduce with a steer sent while an[OPTIONS:]line is the last streamed text, then check which of the two mechanisms above produced the glued row.fix(protocol): recover [OPTIONS:] pills when prose is glued after the…
amadsalmon commentedon Sep 18, 2026
Fresh live recurrence (2026-09-18)
Observed again in a live dashboard session today, confirming the steer-glue path is still reachable in the current runtime (the fix in #11371 is not yet merged/deployed). The persisted line was:
Shape: line-leading complete marker, closer directly abutting plain prose from a mid-turn steer reply — the exact
…]<prose>casereflow_glued_option_markertargets. The trailing remainder is plain prose (no|, brackets, or wrapper glyphs), so it falls squarely inside the reflow's scope and would be recovered.Adds a second real-world occurrence alongside the customer transcript already cited in #11371, i.e. this is a recurring production shape, not a synthetic edge case.
CrysisDeu commentedon Nov 4, 2026
Reproduced again on
main@ 0a0f9aa (2026-11-03) during a bug bash, and re-verified on the same commit.an
[OPTIONS: …]marker with prose glued after it types out as raw text while the reply streamsSteps to reproduce
Pick one.\n\n[OPTIONS: Glue yes | Glue no]and this prose was glued after the bracket.in small chunks.Expected
No raw
[OPTIONS:text while streaming; at the end, choice chips plus the glued text on its own line.Actual
While streaming the bubble types out
[OPTIONS: Glu…character by character. The end state is right (chips "Glue yes" / "Glue no", the prose on its own labelled line). The other three marker shapes streamed the same way never showed raw text.Where in the code (at 0a0f9aa)
website/src/app-sdk/protocol/optionMarker.ts:379-403(stripPartialOptionMarkerreturns a closed marker followed by same-line text as prose); the backend repairs the same shape at persist (src/kiro_crew/constants.py:961reflow_and_label_glued_option_marker, called fromsrc/kiro_crew/dashboard/chat_turn/segment_flush.py:129,465), so frontend and backend disagree.Evidence
Re-verify verdict: CONFIRMED. Runs:
p1-03/20261104T122108Z-fake(repro yes, 3 of 3 glued streams),p1-03/20261104T122613Z-fake(repro yes, 3 of 3). The screenshots and logs are kept with the bug-bash run records (not attached); file names:p1-03/20261104T122613Z-fake/evidence/chat-121-glued-raw-while-streaming-2.png(bubble shows "Pick one." then "[OPTIONS: Glu" with the cursor),-1/-3likewise, finalchat-121-glued-done.png, counts inchat-121-raw-sightings.json({"glued": 3}).Version
main@ 0a0f9aa (2026-11-03). Linux test host, headless browser; real Kiro backend where the row needs it.Found in a bug bash and re-verified against the same commit. Bug-bash rows:
chat-121(p1-03). Suggested severity: P4.