Skip to content

feat(chat): render the (recommended) option marker as a badge - #7157

Closed
rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:feat/recommended-option-badge
Closed

rnoack1 wants to merge 1 commit into
kirodotdev:mainfrom
rnoack1:feat/recommended-option-badge

Conversation

@rnoack1

@rnoack1 rnoack1 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

This PR introduces a convention and the rendering it needs: an agent marks its
recommended choice by writing (recommended) at the START of an option label. Nothing in
the base repo asked for that marker, so the producer rule below is part of this change
rather than behaviour already in the field — see "Backend" under What changed.

Once the marker exists, two things are wrong with leaving it in the label.

The first is dispatch: the label doubles as the user's next message. Clicking
(recommended) Merge it now sends exactly that, so the user appears to be recommending
something to the assistant. Worse, stripping it naively is its own hazard — a cleaned
label can open with /, @ or [, or BE a plan action or a stop word, and then a click
dispatches something the agent authored rather than words the user chose. That is the
harm the guards below exist for, and it is the one the feature is bought for.

When the guard declines, the chip shows the raw (recommended) … text and a click puts
that string in the composer as the user's own message. The marker carries NO typographic
signal of its own: mono already means "recommended" elsewhere in the product
(SpecStatePanel), so a second meaning here would collide rather than teach. One note under
the bar explains it instead, and a declined chip is exempt from instant send so the click
always leaves a chance to edit the prefix out. There is no per-chip screen-reader note, and
it would be redundant: the prefix is real label text, so it is already read out.

The second is presentation: the marker is plain label text, styled identically to the
instruction and competing with it for a single clamped line's width budget. A badge is
one word, outside the truncating span, and visually distinct — so the recommendation is
legible at a glance instead of being read out of a sentence.

The plan-action, stop-word and injected-prefix literals are HOISTED into constants.py by
this change, and that hoist is declared scope rather than incidental: it exists so one
definition feeds both the strip guard and the parity suites instead of each carrying a copy.
It is mechanism for the guard, not for the badge, and it is listed here so a reviewer is not
left inferring why a feature PR moves constants.

The Slack interpret_commands=False half is SETTLED scope, not an open question: it closes
the !-family hole the sigil guard cannot see and aligns Slack with the four transports that
already carry the flag.

Scope note, stated plainly because an earlier revision of this description claimed more:
the marker is only admitted at the START of a label, and a leading marker is never what
an ellipsis reaches. So this change does not rescue a marker from being clipped away;
that only happened for a trailing marker, a shape nothing emits and which this PR
deliberately does not recognise. ChipBody also already puts the full option on the
bar note, so the text was never unreachable.

Why it matters

A recommendation nobody can read is worse than no recommendation, because the
turn was written on the assumption it would be visible — the prose above defers
to "the recommended option" that the buttons never name. The failure is also
silent from the authoring side: the marker IS in the response text, so any check
that greps the text passes while the rendered menu shows nothing.

Shortening labels does not fix it. Truncation depends on rendered width, font and
the chip's own box, so any character budget leaves a band of labels visibly cut —
the same reasoning already recorded above chipTooltip for why a 60-char
threshold was the wrong proxy.

What changed

(recommended) is now treated as protocol rather than label text.

  • New protocol/recommendation.ts — splitRecommendation(option) returns the
    label with the marker removed plus a boolean saying whether it carried one. The grammar is
    deliberately narrow (recommended and nothing else — the recommended first /
    recommended then ordering variants are NOT admitted, since nothing in the repo emits them): admitting a marker
    paints a badge, so an open-ended parenthetical rule would let (destructive) or
    (see below) style themselves as a recommendation. A label that is only the
    marker is left alone — a badge names no action, and stripping it would send an
    empty message. A label that IS or WOULD BECOME a dispatched command is also left
    alone: the label is dispatched verbatim, and the dashboard treats three leading
    characters as more than plain text — a leading-slash first word is forwarded to the
    harness, a leading @ is resolved by _expand_prompt_mention to a stored
    prompt whose CONTENT replaces the message, and a leading [ opens a reserved
    provenance prefix the backend byte-matches. Stripping a front marker would
    promote inert text into something that runs — (recommended) /clear would
    leave as /clear and erase the transcript, and (recommended) @deploy would
    leave as @deploy and execute that prompt. For such a label the splitter is a
    no-op returning the original text and no marker, so it behaves exactly as if
    the feature were absent and introduces no dispatch path that did not already
    exist. The test is prefix-only; either character inside a label is ordinary prose.
  • parseOptions applies the split, so options are clean at the protocol
    boundary and the four TypeScript hosts send the instruction alone. The messaging
    channels are NOT covered, deliberately: split_options_trailer
    (src/kiro_crew/messaging/renderer.py), which 6 renderer modules import, leaves a
    drifted marker in the choice, so on those channels it is displayed AND dispatched
    verbatim as ordinary label text. strip_recommended_marker has exactly one
    production consumer, the Slack path (src/kiro_crew/slack/format.py), reached through
    extract_options_with_recommendation. That strip carries the same dispatch guard as
    the frontend for the forms it can promote — the / and @ sigils, the action::
    dispatch protocol, the reserved and injected provenance openers and the plan
    actions — because the label is sent as the user's message and an unguarded strip
    would turn (recommended) /clear into /clear. The frontend carries ONE arm the backend does not,
    deliberately: a leading orchestration stop word (stop/cancel/abort), matched on
    the FIRST word rather than the whole label because the dashboard chat endpoint reads
    it that way, so (recommended) stop after this stage would otherwise strip and
    dispatch as a cancellation of a live run. That consumer is reachable only from the
    dashboard, so mirroring the arm onto the channel guard would reserve a word no
    channel dispatches. A channel has no badge to render and is not
    asked for the marker at all, so the strip there is purely defensive, keeping the
    marker carried instead of dropping it. parseOptions also returns
    recommended: the one marked label, or null. A single label rather than a set
    because the only sanctioned producer marks at most one option, and rather than a
    widened options element type because options must stay a string[] — it is
    the canonical string a click dispatches and every picked set is keyed on, so a
    label that differed between display and dispatch would break selection tracking.
  • FollowUpBar renders the marker as a badge in a new ChipBody, as a
    shrink-0 sibling of the clamped span rather than inside it. Position is the
    entire fix. It stays on the same line, so chips remain the same height — the
    constraint ChipLabel's own comment exists to protect.
  • followUpRecommended threaded through the four hosts that render the bar
    (ChatPage, ChatPane, ChatEmbed, SideChat) plus ChatInput. All four,
    not a subset: the marker is stripped for everyone, so a surface left unwired
    would lose the recommendation entirely rather than merely render it plainly.
  • The badge word is held in ChipBadge rather than threaded through the protocol:
    the grammar admits one spelling, so there is no second word to carry. It renders
    through i18nT('components.followUpBar.recommended'), and that key is added to
    all 13 locale catalogs because the badge is UI copy the user reads and the repo's
    catalog-parity gate requires every key in every catalog. The (recommended)
    marker itself is NOT translated — it is protocol vocabulary, matched
    case-insensitively against the literal English word, so translating it would stop
    the parser recognising what an agent wrote.
  • Backend, and this is the producer half of the feature: src/kiro_crew/context.py
    gains _OPTIONS_RECOMMENDED_RULE, which instructs the agent to mark one option.

    Before this PR nothing in the repo asked an agent to emit (recommended), so this
    rule — not pre-existing behaviour — is what makes the marker systematic. It changes
    the critical-rules block of every dashboard session. It is added to the DASHBOARD
    variant only: _CRITICAL_RULES_TAIL is shared by both surfaces, so appending there
    would ask channel agents for a marker no channel can render as a badge — the strip
    above removes it, so the instruction would buy nothing while adding a way to get it
    wrong. Splitting the [END CRITICAL RULES] terminator into
    _CRITICAL_RULES_END is what makes a surface-specific slot possible, mirroring the
    existing _DIFF_RULE_DASHBOARD / _DIFF_RULE_CHANNEL pair.
  • A retraction ships on the channel RESUME path, and only there.
    _critical_rules_for picks the block per turn from the LIVE runtime source, not once at
    session start, so an ORDINARY channel turn never receives the marker instruction and has
    nothing to retract — TestNoOrdinaryChannelTurnCarriesTheRetraction pins that absence on
    slack, telegram, discord and cron turns. A channel RESUME of a dashboard-origin session is
    the exception the selector cannot cover: the restored transcript still carries the
    instruction, so that path appends a retraction, gated on the resume variant and worded
    without spelling the marker (the channel rule block must never contain the literal).
    test_channel_resume_retracts_marker.py pins the retraction and its gating;
    test_channel_resume_retraction_not_gated.py pins that it survives the crew-context
    opt-out, which previously suppressed it while the restored history still carried the rule.
  • The public SDK surface gains exactly one field, ParsedOptions.recommended.
    splitRecommendation is deliberately
    NOT exported from protocol/index.ts, app-sdk/index.ts or
    public/vendor/kirocrew-app-sdk.mjs: every consumer imports
    ./recommendation directly, so a barrel export would be a zero-consumer
    one-way-door addition riding along in a fix. Apps already get the behaviour
    through the exported parseOptions, whose recommended field subsumes it.
    docs/app-kit/api-reference.md documents that FIELD for out-of-tree apps
    and explicitly withholds the marker's wire spelling and placement from the
    published contract, so apps bind to recommended rather than to the grammar.

A SECOND, INDEPENDENT change ships in the same commit: Slack option clicks stop being
command-interpreted.
This is not part of the marker feature above and is not scoped to
marked labels — it changes behaviour for EVERY Slack option click, including options that
carry no (recommended) marker at all. It is declared separately here because the repo
allows at most two commits per PR, one logical change each, so it CAN be landed as its own commit ordered first
this PR — a scope call left open below.

  • Slack option clicks no longer interpret a leading command token.
    handle_message (src/kiro_crew/slack/handler.py) takes a new
    interpret_commands keyword, True by default so a human-typed message is
    unaffected, and the three Slack option-dispatch sites
    (src/kiro_crew/slack/interactions.py) pass False. It resolves to one
    interpret_as_command decision every command branch reads, so a new branch
    cannot forget it. This applies to every Slack option click, not only the
    ones carrying a marker, because an option label is model-authored either way.
    The harm it closes is separate from the marker work and predates it: a label
    whose first word is one of the nine bangs at handler.py:155-166 was executed
    on click rather than sent as turn content, so an agent-authored !yolo on
    became /kirocrew yolo on and changed the approval mode. The marker-strip
    guard cannot cover this — ! is not one of the reserved dispatch sigils
    (/ and @), so the guard has nothing to match and would strip such a label
    happily. Stated here as its own change rather than folded into the badge work,
    since reverting the badge would reopen it.

  • The two promotion fences can no longer drift apart. The fence is implemented
    twice by construction — strip_recommended_marker (Python, channel dispatch) and
    splitRecommendation (TypeScript, dashboard dispatch) — because each runtime
    dispatches a clicked label itself. The shared vector fixture pinned the forms that
    exist today, which says nothing about the next one: a slash command added to one
    grammar and forgotten in the other would let a marker strip promote a
    model-authored label into a real command on the surface that was missed, with every
    existing test still green. test/test_promotion_fence_drift.py asserts the
    invariant instead, in both directions. Every reserved list must be either PAIRED
    with its frontend symbol and match it, or declared single-surface with a written
    reason; a list or symbol that is neither fails the completeness test, so a seventh
    one cannot skip the pairing. Verified by mutation in four shapes — a Python entry
    the TS array lacks, an alternation branch it lacks, a brand-new backend list, and a
    brand-new frontend symbol — each of which the gate catches.

  • The marker is instructed on the dashboard ONLY. The dashboard is the surface that paints the badge. No channel producer rule asks for the marker, so a channel label carrying one is model drift rather than protocol, and strip_recommended_marker keeps it out of the dispatched string as a defensive measure rather than as half of a paired feature. An earlier revision added a channel-side producer rule and a Recommended: <label> restatement; both are withdrawn, which also removes the hardcoded English prefix that restatement shipped to every locale.

Three riders declared, because none of them is the badge

A Slack click routed to a linked dashboard slot now delivers its turn rows AND carries its
action context.
Two failures were traded against each other before this settled. Refusing to
route kept the payload but left the linked slot with neither turn row while its session
advanced. Composing the payload into the dispatched text restored the rows and opened a worse
hole: the dashboard runner expands $skill over user text, so model-authored payload text
joined to it would load local skill bodies. What ships carries the payload OUT OF BAND instead —
on the queue item's meta, read back on the drain and handed to the context builder as
action_context, whose reader already exists in the base tree. The rows land, the payload
reaches the turn, and nothing expands, because the payload never enters the dispatched text.
Provenance is what closes the expansions: a clicked label is flagged model-authored, which
blanks the leading command word before any slash, @prompt or $skill arm reads it.

A merged drain keeps EVERY clicked payload — a separate defect, declared here rather than
left to its tests.
A busy slot's queue drains into ONE turn, so a batch can carry several
clicks, and taking only the first payload silently dropped every later one. pair_action_contexts
pairs each payload with the label it arrived with, which matters because the labels are
concatenated and a payload alone cannot say which one it belongs to; a lone click still passes
through unwrapped so the ordinary turn is byte-identical. This is not part of the badge and
would be worth fixing without it.

The label width floor applies only to a BADGED chip. The badge is shrink-0 and cannot
give width back, so beside it an unfloored label absorbed the whole squeeze — a 24-character
en-XA badge left about one word of its neighbour readable. The floor is 12ch and it is
passed only where the badge renders; an unbadged chip keeps min-w-0, so this does not
change any chip that has nothing competing with it.

Tests

  • src/test/recommendation.test.ts (new, 33): the split at the leading and
    trailing edge; that both ordering variants are REJECTED; case-insensitivity; a negative
    control
    that (destructive), (see below) and (recommended by nobody at all) are not recommendations; the marker-only label; a no-regex-state guard;
    and the three regressions this turns on — an EDGE marker never survives into a
    dispatchable label, an INTERIOR one is never removed from it, and stripping
    never promotes a label into a dispatched command, by slash or by @ mention. Plan chips
    (Go, Go All, Cancel) are asserted byte-identical, since
    usePlanActionMutation dispatches on exact label equality.
  • src/test/FollowUpBar.test.tsx: its form is pinned against the existing
    spec-decision badge — a trailing uppercase micro-label rather than a leading pill, matching
    apps/spec-builder/components/SpecStatePanel.tsx so the same word does not render in
    two shapes. Colour is the one deliberate difference: that sibling tints itself with the
    accent, which on a chip is the SELECTION signal, so this badge keeps a neutral text
    colour and the test pins zero accent tokens on an unpicked recommended chip. The badge
    is also asserted to be a
    sibling of the clamped .truncate span and never a descendant, with that span
    carrying only the label. An assertion on the rendered text alone would pass
    either way and prove nothing.
  • test/test_messaging_recommended_marker.py (new): the channel half, pinning the
    no-strip decision. Its opening line is "A channel does not strip a (recommended)
    marker; it renders it as label text", and TestTheChannelLeavesTheMarkerAlone
    asserts a leading marker survives into the choice unchanged. Its companion
    test/test_channel_recommendation_not_restated.py pins that nothing is restated in
    its place.
  • test/test_slack_option_click_not_a_command.py (new): every top-level command branch
    in the Slack handler tests the flag, and both option-click dispatches pass it as
    False. Mutation-verified: ungating the ! family fails 4, dropping the flag from one
    dispatch fails 1, and removing all of it fails 7.
  • test/test_slack_linked_option_routing.py (new): a command-shaped label clicked as an
    option lands in the linked slot's queue rather than falling through, and a user-typed
    bang still falls through to the command handler. Mutation-verified: ungating the
    fallthrough fails 5.
  • test/test_dispatch_sigil_parity.py (new): fails if the /, @, [ deny list
    diverges between the backend tuple and the frontend list, so a fourth dispatch
    prefix cannot be added to one surface alone. The same suite pins the action:: dispatch protocol, which the single-character sigil tuple cannot express, against the action router's own spelling, and asserts the frontend guard actually consults the mirrored list rather than merely declaring it. It also asserts the extraction found a
    non-empty list, since an unreadable list would make the comparison vacuous.
  • test/test_context_critical_rules_assembly.py (new): pins the backend producer
    half — that the dashboard block instructs the marker and the channel block does
    not, that the LIVE surface rather than the session's origin decides which block a
    turn receives, that no ORDINARY channel turn retracts the instruction (the resume
    path is the deliberate exception, pinned separately), and that every reserved
    dispatch prefix the backend byte-matches opens with [, which is the property the
    frontend guard relies on. Each arm is mutation-verified: re-adding a retraction
    paragraph to an ordinary channel turn fails the absence test, and unbracketing one
    backend prefix fails the prefix test. A positive control asserts the scan reaches a
    real channel turn, and a
    guard asserts the channel's own diff rule was not removed alongside the retraction.
  • capture/followup-recommended-badge.{html,tsx} +
    scripts/capture-followup-recommended-badge.mjs (new): real-layout
    measurement, because the DOM contract above is necessary and not sufficient — a
    badge outside the span but pushed past the chip's edge satisfies every class
    assertion and is still invisible. __measure() takes a Range over the marker's
    own characters and compares its rect against the chip's painted box. fix=off
    renders upstream's shape verbatim, so the before arm is asserted to reproduce
    rather than assumed. 12 of 12 assertions pass across both themes.
  • Full suite 1683/1683 files, 26613 tests. tsc -b clean. eslint on the
    changed files: 0 errors, and the 22 pre-existing hook warnings in
    ChatPage/SideChat are unchanged from main (measured both ways).
  • Rebased onto main; git patch-id --stable identical before and after.

The harness earned its place on its first run: it failed, because the initial
measurement tested horizontal overflow. line-clamp-1 is
display:-webkit-box + -webkit-box-orient:vertical, so an over-long label
wraps and later lines are clipped — the marker disappears downward, and a
horizontal test reports it visible. The paint test now checks both axes, so it is
correct under either clipping mechanism.

It caught a second thing later, which is why the framing above is what it is. When the
fixture was moved to the sanctioned leading marker, the old fix=off assertion — "marker
NOT painted" — went red: markerVisible=true, because a leading marker is never clipped.
The measured defect is therefore not invisibility, and the arm now asserts what is
actually true pre-fix: markerInLabel is true, i.e. the marker is part of the label a
click dispatches. The fix=on arm asserts the converse plus the badge.

Note on overlap

#7125 is open on the same
ChipLabel line, swapping line-clamp-1 break-words for block truncate. The
two are complementary and this PR does not depend on which lands first: that one
changes how the label is trimmed, this one moves the marker out of the trimmed
element. If it merges first, the badge is unaffected and only this PR's test
selector for the clamped span needs updating — happy to rebase onto it.

Security-relevant behaviour change on Slack, stated explicitly

The channel-side marker strip alone does not cover !-commands, and this is the
part of the diff a reviewer would otherwise have to find for themselves.

Stripping (recommended) cleans the label, but it says nothing about what the cleaned
label is. (recommended) !yolo on strips to !yolo on, and Slack read a clicked
option through the same path as a typed message — so the click ran the command, turning
on process-wide auto-approval. The frontend sigil guard cannot close this: it can only
enumerate prefixes (/, @, [) and ! commands are a separate family reached by a
different branch.

interpret_commands is new on slack/handler.py::handle_message and passed as False by
both option-click callbacks. It fixes a PRE-EXISTING privilege escalation and does not
depend on this feature
: before any marker existed, a model-authored label spelled
!yolo on was already click-executable, because an OPTIONS label is turn content whatever
it looks like. So this half stands on its own, and reverting the badge would reopen the hole
rather than restore a safe state. With the flag off, !yolo, !agent, !compact,
status, sessions and the !temporary / !incognito privacy modifiers are no longer
reachable by clicking a chip. A user who TYPES any of them is unaffected —
the flag defaults to True. This mirrors the Telegram and Discord dispatchers, which
already pass the same flag on their callback paths.

maybe_route_linked_thread takes the flag too. It deliberately lets a bang command fall
through to normal handling so one can still be run inside a linked thread; for a
model-authored label that fallthrough would persist the turn under the dashboard key
while the linked slot's transcript never saw it, so a command-shaped click would resolve
to a different slot than an ordinary message from the same thread. With the flag off the
fallthrough is suppressed and both resolve identically.

Channels leave a drifted marker as label text and restate nothing

Six renderers parse the trailer through messaging.renderer.split_options_trailer, which
leaves the marker in the choice — so on those channels it is displayed and dispatched
verbatim as inert label text — and appends nothing in its place. That is a decision, not a gap, and two facts drive it. No channel producer rule
asks for the marker — only the dashboard is instructed to emit one, and
_OPTIONS_RECOMMENDED_RULE is wired into the dashboard block alone — so a marker arriving
at this seam is model drift, and restating drift would give it protocol standing. And the
two-value wrapper has no recommendation identity to restate WITH: it drops that identity by
contract, which test/test_recommendation_seam_parity.py polices, so the choice a line
would name is not knowable there. test/test_channel_recommendation_not_restated.py pins
both halves — the marker leaves the dispatched value, and the body gains no line.

Slack is the one surface that CAN name the choice, because it does not use this parse at
all: slack.format.extract_options_with_recommendation carries the identity explicitly and
renders its own *Recommended:* context block, cut at the same checkbox cap the option
itself is cut at.

Cost of moving the marker out of the label

Recorded as a cost statement, not a proposal: the marker's placement is an open design
question and this section only measures what the alternative would remove.

The marker sits inside the label a click dispatches, so the strip needs a guard for every
value that must not be promoted. Moving it to an out-of-band control tag removes the need
for that guard entirely. Measured by AST at this head:

reserved list literals fate if the marker moves out-of-band
dispatch sigils 2 deleted
dispatch protocols (action::) 1 deleted
provenance openers 19 deleted
injected-origin openers 9 deleted
plan actions 3 deleted
total 34 all deleted
parity suite lines fate
test/test_dispatch_sigil_parity.py 133 deleted
test/test_injected_provenance_parity.py 53 deleted
test/test_reserved_plan_actions_parity.py 92 deleted
test/test_reserved_provenance_parity.py 75 deleted
test/test_dispatch_prefix_declared.py 69 kept — added by this change; guards the dashboard's own dispatch prefixes, which outlive the marker grammar

So 3 of 4 suites and 353 lines go, along with the frontend mirrors of all four lists. The
badge itself survives the move: keepVisibleMarker.ts is the in-repo precedent for a
control tag that renders as nothing, and strip_control_comments already removes such tags
from every plain-text projection. The remaining cost is that label-to-tag correspondence becomes a validation concern
rather than a structural one. The grammar is NO LONGER published SDK surface: this PR
documents only the recommended field and states that the marker's spelling and
placement are not part of the published contract, so moving out-of-band later needs no
app-author migration and is no longer a one-way door.

Why the Slack interpretation flag stays in this change

It lands inside this commit, and the consequence is stated rather than implied. An
earlier revision of this description claimed the repo enforces one commit per PR. That was
wrong: AGENTS.md allows "one logical change per commit, and at most two commits per PR",
so a security commit ordered ahead of the badge IS available here and the split is the
right shape. It has not been made yet. The ordering dependency it used to carry is now
GONE: ! is a reserved dispatch sigil as of this revision, mirrored in constants.py and
recommendation.ts and pinned by a shared-fixture vector, so the strip declines
(recommended) !yolo on and leaves it whole. The badge no longer depends on the flag.
The cost a reviewer should see plainly: reverting this commit reverts the flag with it, so
a revert of the badge is also a revert of the privilege-escalation fix. If that coupling is
unacceptable, the flag needs its own PR ordered first, and that decision is a maintainer's.

Why the channel seam restates nothing, given two lanes asked for opposite things

Worth stating plainly, because the two remedies for the doc/code mismatch pull apart. One
asks for the append to be implemented; the other asks for the channel strip to be deleted
entirely and a drifted marker left as inert label text. Both would cure the mismatch. The
shipped shape is the middle one, and it is chosen from what the tree already asserts rather
than from taste: the strip stays, because a marker must not reach a dispatched value, and
nothing is appended, because the seam that would append has no recommendation identity —
test_recommendation_seam_parity.py states that the two-value wrapper drops it by contract,
so an append there could only name a choice it cannot know is the right one. Implementing it
would mean either widening that seam's signature or guessing, and it would restate a steer
no channel producer rule ever asked for.

The narrower reading also matters: with the channel rule instructing no marker, the code
path exists only to contain drift, so documenting it as containment is the honest
description. This is the reasoning, not a rebuttal — the mismatch is fixed in the tree, in
docs/system-specs/modules/messaging.md, in this section, and in a test that fails if a
restatement is ever appended.

The two-value extract_options is deleted

A review asked whether slack/format.py::extract_options was dead. An earlier revision of
this description argued it was live and should be kept; that was wrong about the outcome, and
this diff DELETES it. Its one real consumer discards the choices it returns, so that call site
now uses the three-value extract_options_with_recommendation directly
(subagent.py:101 imports it, subagent_manager/run.py:1634 calls it). Only one spelling
survives, and two ratchets pin that: test_recommendation_seam_parity.py:80 asserts no
def extract_options( exists in the module, and test_slack_mirror_recommendation.py:186
asserts the attribute is absent, so a re-add fails the suite rather than passing silently.

Why the dashboard chip dispatch does not carry interpret_commands=False

The review asks which dashboard entry points would take the flag that Slack now uses, and
why it was not taken there. Naming them: a chip click reaches
src/kiro_crew/dashboard/handlers/messaging.py::api_send_message, and the interpretation
that matters for a marked label is the first-word stop match in
src/kiro_crew/dashboard/chat_handlers.py (message.strip().lower().split()[0] in _RESERVED_STOP_WORDS).

The flag was not extended there because the two surfaces differ in what the dispatcher can
see. On Slack the option click arrives at a dispatcher that ALREADY takes
interpret_commands (slack/handler.py), carried by four transports, so Slack was a
parameter already on the seam. The dashboard chip click arrives on the same endpoint as
text the user typed, with nothing on the request distinguishing the two, so the flag has no
argument to read: giving it one means adding a provenance field to the send contract and
teaching every consumer of that endpoint to honour it. That is a larger, separable change
than this PR, and until it lands the guard lists are what stand between a model-authored
label and a dispatch — which is why they are here rather than replaced.

This is an ACKNOWLEDGED cost, not a claim that the fence is the better shape. The
dashboard counterpart of the hole Slack just closed is still open: a bare /clear,
@deploy or Go All label an agent authors still executes on click, and only Slack got
the flag in this PR.

Screenshots

Not committed: .gitignore reserves temp-screenshots/ for local capture output and states that
review evidence is uploaded as a GitHub attachment, never tracked. Twelve frames were briefly
committed here and have been removed from the tree for that reason.

Every frame is reproducible from a clean checkout, deterministically and without a running app:

cd website
node node_modules/vite/bin/vite.js --host 127.0.0.1 --port 6813 --strictPort   # in another shell
node scripts/capture-followup-recommended-badge.mjs http://127.0.0.1:6813 ../temp-screenshots/followup-recommended-badge

website/scripts/capture-followup-recommended-badge.mjs writes twelve frames across six states
and two themes, and asserts 44 measurements against the real rendered box before it writes any of
them -- including that the BEFORE arm still reproduces the defect, so an after-frame cannot pass by
the label having simply got shorter. The states are:

frame state asserted
marker-inline-unbadged-* before arm: marker inside the label, label clipped, no badge
badge-beside-label-* badge painted inside the chip, label still clipped, marker gone from the label
badge-on-picked-chip-* same, on a picked chip
marker-kept-on-guarded-label-* guard declines the strip: marker stays in the dispatched label, no badge, visible note
bare-command-chip-* bare command-shaped chip: dashed edge, no send segment, its own note
mixed-hold-note-* both kinds in one row: exactly ONE combined note

The assertions are the machine-checkable half of that table and they run in the capture, so a
frame that disagreed with its row could not be written.

@rnoack1
rnoack1 requested review from a team and krishdhasmana August 31, 2026 00:58
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed e941d562f6cc97f64d8203d2c1534008c1e1974a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e941d56

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of e941d562f6cc97f64d8203d2c1534008c1e1974a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

No screenshots and no recordings were supplied (all three evidence files are empty; the PR removed the twelve committed frames). I've reconciled the user-visible changes against that.

User-visible elements this PR adds/changes, none shown in any artifact:

  • RECOMMENDED badge — uppercase 11px pill beside a chip label (ChipBadge).
  • · separator between label and badge.
  • Dashed-border chip — the sole at-rest signal that a "declined"/command-shaped chip fills the composer instead of sending (border-dashed).
  • Accent ring flash — ring-2 ring-accent for 1400ms when a refused chip is clicked (ackHeld).
  • Bar note, three variants (recommended_marker_kept, command_shaped_kept, both_kinds_kept) — 11px prose above the composer.
  • Changed tooltip copy for declined chips.

No blind read runs in this lane, so comprehension of the badge, the dashed edge, and the notes is UNKNOWN, not inferable from the labels. No lens-13 hard swap (the recommended/declined state is fixed per option at render, not a user-driven transform of an already-identified element), and the notes assert what happened and offer an action, so no BLOCK exit fires cleanly.

UX-Verdict: CONCERNS

Every control this PR adds — the RECOMMENDED badge, the dashed "won't-send" chip, the ring flash, the three notes — ships with zero screenshots or recordings, so nothing has been seen.

Watch

  • Row-level note vs. specific chip (split attention, lens 10): command_shaped_kept — "Some options could run something rather than say it, so they go to the composer instead of being sent" — names no chip; the only per-chip tie is the border-dashed edge, which touch/keyboard users must map to "some options" themselves. Frequent × friction × every-occurrence. Fix: make the note reference the dashed marking, or mark the affected chip more explicitly than a dashed border.
  • Two sentences of 11px prose above the composer (both_kinds_kept, density/legibility, lens 2/10). The author collapsed to one note to avoid "four sentences," but the combined note is still a small-type paragraph in a dense daily surface. Persistent whenever a mixed row appears. Fix: tighten to one sentence or layer the second clause behind the chip's tooltip.
  • Accent ring for refusal feedback (lens 5/7): ackHeld ? ' ring-2 ring-accent' reuses accent, which the code's own comment calls the selection signal — a 1400ms accent ring on a refused click can momentarily read as "selected." Fix: use a neutral/muted ring for the hold acknowledgment.

Evidence gaps

  • RECOMMENDED badge (ChipBadge) — appears in no screenshot; needs the badge-beside-label / badge-on-picked-chip frames attached to the PR.
  • Dashed-edge declined chip (border-dashed) — no screenshot; needs bare-command-chip and marker-kept-on-guarded-label frames.
  • The three bar notes and the mixed-row single-note behavior — no screenshot; needs mixed-hold-note frame.
  • Accent ring hold-acknowledgment (ackHeld) is a state transition with no recording; needs a short capture of a refused-chip click.
  • No blind read ran (fork lane), so comprehension of the badge and notes is unverified.

[UX-REVIEWED] e941d56

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed e941d562f6cc97f64d8203d2c1534008c1e1974a via the fork AI-review pipeline; updated in place on each push.

Review details

I've independently verified the core logic: the _model_authored gating is fail-closed (neutralizes first_word, gates both @-prompt and $skill expansion, preserves provenance across recovery requeue); strip_recommended_marker and its TS twin applyMarkerGuards decline every dispatch-promoting spelling (sigils, embedded $skill, action::, reserved/injected provenance, plan actions); the Python/TS asymmetry (stop-word arm, BOM handling) is intentional and safe given Slack has no orchestrator stop dispatch; action_context is in scope in handle_message; all Slack command branches are gated behind interpret_as_command; and recommended/overflow/choices comparisons in build_options_blocks are consistently un-redacted. No candidate survived and Step 2 surfaced nothing at the bar.

No findings.

[OPUS-REVIEWED] e941d56

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of e941d562f6cc97f64d8203d2c1534008c1e1974a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The design is coherent and the code matches the description's claims. The core feature solves a real problem (a recommendation the rendered menu never shows), and the Slack interpret_commands=False change closes a genuine pre-existing privilege escalation. The main design-level item is the bundling.

Design-Verdict: CONCERNS

A real fix, soundly shaped — but an independent privilege-escalation fix is bundled into the feature commit, so reverting the badge also reverts the security fix.

Watch

Scope bundling / revert coupling. The Slack interpret_commands=False change closes a pre-existing click-to-!yolo on escalation and is explicitly "not part of the marker feature… changes behaviour for EVERY Slack option click"; it currently ships in the same single commit as the badge. AGENTS.md allows "at most two commits per PR, one logical change each," yet the security fix "has not been made [its own commit] yet." Consequence: a later revert of the feature silently reopens the privilege escalation, and the author flags this coupling as "a maintainer's" call.
Fix: land the security fix as its own commit ordered first (or its own PR), so the badge revert cannot drag it out.
Clears when: the Slack interpret_commands change is a separate first commit (or separate PR), decoupled from the badge revert.

Suggestions

The in-label marker keeps a dual-runtime guard fence (34 literals, 4 parity suites) that the author's own cost table shows an out-of-band control tag would delete; since the grammar is deliberately withheld from the published SDK contract, that move stays reversible — worth a tracked follow-up, not a change here.

[DESIGN-REVIEWED] e941d56

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of e941d562f6cc97f64d8203d2c1534008c1e1974a via the fork AI-review pipeline — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The "recommendation nobody can read" defect is self-created: this PR invents the (recommended) marker convention, then ships a badge + cross-language promotion fence + SDK field to fix a hazard nothing in base has.

Not justified as shipped

  • Item 2 — the marker convention (_OPTIONS_RECOMMENDED_RULE) — inherited premise. The defect ("a recommendation nobody can read") has no provenance: no issue, no base-failing test, and every added test exercises the new grammar. On base an agent already recommends in prose (visible in the body) and by best-first ordering — which this PR itself specifies as the fallback wherever the badge is absent (_CRITICAL_RULES_CHANNEL carries no marker rule; the resume note says "Put the recommendation in your prose and order the options best-first"). The harm is created by the producer rule in the same diff.
  • Item 1 — the badge — duplicate of that prose+ordering recommendation; a second spelling that will diverge (dashboard badge, Slack *Recommended:* line, channels raw text, prose).
  • Item 9 — recommended/followUpRecommended SDK field — one-way door. api-reference.md publishes it as SDK surface app authors must bind to, so withdrawal is a breaking change; it exists only for item 1.
  • Item 7 — batch action-context pairing (pair_action_contexts, batch_is_model_authored) — undeclared rider; a separate drained-batch fix bundled into a badge PR.

What this change ships

Inventory (10 items) — 2 justified

Intent: let an agent visibly flag its recommended chip option without that flag becoming the user's dispatched message. ADDITION.

  1. Dashboard renders a (recommended) marker as a badge — duplicate of prose+best-first recommendation
  2. Agents instructed to emit the marker (new dashboard convention) — inherited/self-created premise
  3. Marker stripped pre-dispatch behind a Py+TS promotion fence — rides along (mechanism for refactor: rename project KiroClaw to KiroCrew #2)
  4. Slack *Recommended:* context line above checkboxes — second spelling of test: validate CI workflows on KiroCrew #1
  5. Declined-marker Slack note + FollowUpBar notes — rides along
  6. Option clicks gate Slack command keywords via interpret_commands=False — justified
  7. Batch drain pairs every clicked action_context with its label — undeclared rider (separate fix)
  8. Provenance/plan/stop literals hoisted to constants.py — justified
  9. recommended/followUpRecommended published as SDK surface — one consumer class, one-way door
  10. Resume injects a note retracting the marker on non-dashboard surfaces — rides along

Watch

  • The whole apparatus rests on a defect asserted only by the description, backwards from the wanted solution; the same readability already ships via prose + ordering (used as the PR's own fallback). Note the dispatchIsCommandShaped guard on quickSend.ts for BARE command labels is a genuine independent fix and should survive any rollback.
    Clears when: a linked issue or a base-failing test shows an agent's recommendation is actually unreadable without the marker.
  • Item 9 publishes recommended as SDK surface (api-reference.md: "before this field is published SDK surface"); once app authors bind to it, removal is breaking.
    Clears when: the field is held internal until the convention proves demanded.

Subtractions

  • Drop the (recommended) convention (_OPTIONS_RECOMMENDED_RULE) and its badge; rely on prose + best-first ordering, which the PR already mandates on every non-dashboard surface. With it go recommendation.ts, strip_recommended_marker, the mirrored provenance/plan/stop fence, the parity/drift suites, the recommended/followUpRecommended SDK field, and the Slack *Recommended:* block.
  • Split pair_action_contexts/batch_is_model_authored (chat_runner.py) into their own PR — an unrelated drained-batch fix riding a badge change.

[FIRST-PRINCIPLES-REVIEWED] e941d56

@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 Aug 31, 2026
@rnoack1
rnoack1 force-pushed the feat/recommended-option-badge branch from e4fcbc6 to a440191 Compare August 31, 2026 02:31
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the feat/recommended-option-badge branch from a440191 to a1c3b2d Compare August 31, 2026 02:43
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the feat/recommended-option-badge branch from a1c3b2d to 9b0718c Compare August 31, 2026 03:10
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Aug 31, 2026
@rnoack1
rnoack1 force-pushed the feat/recommended-option-badge branch from 9b0718c to e29337c Compare August 31, 2026 04:34
@rnoack1

rnoack1 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

The chips are capped at min(100%, clamp(18rem, calc(50% - 0.1875rem), 26rem)), i.e. 288–416px, and in the default single-line layout each chip is shrink-0, so the badge changes neither the chip width nor how many options are visible — it only shortens the marked chip's own label. Measured on the committed before/after pair at the same width, the cost is about 14 characters ("in board order" is what gets clipped): 16px of fixed chrome plus the word itself, against a label budget of chip-width minus 26px.

On reordering: worth noting the two are not exclusive — ordering communicates rank, the marker communicates which single option the agent actually recommends, and the agent emits that marker as text today with no way to signal position. Happy to defer to designers on which carries it. One caveat if you compare the screenshots: they were generated before the ordering-variant forms were dropped, so they show a second recommended then badge the current parser no longer produces. I will regenerate them.

@rnoack1

rnoack1 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing out the screenshot caveat from my previous comment: the regenerated pair is already on the branch, so the stale second badge is gone — my "I will regenerate them" was a beat behind the branch.

Verified at head 453b6bb4206f4637abe7cc640e2a3f167ca8c365:

  • website/capture/followup-recommended-badge.tsx:43-47 — the fixture's option list is three labels with exactly one marker, on line 44. The only other (recommended) in the file is line 2, in its own doc comment.
  • website/scripts/capture-followup-recommended-badge.mjs:60,63 — the harness asserts badgeCount === 0 for the before-state and badgeCount === 1 for the after-state. All 12 assertions pass.
  • The four committed PNGs are byte-identical across the last two rebases, so the images in the diff are what the current parser produces.

The design question you raised is untouched by any of this — badge versus reordering is still yours and the other designers' call, and I have not moved it.

@rnoack1

rnoack1 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

One change since you looked, on the "does not help much" point specifically — at head 970b9b82b0a27afd852f4a08388309260970cccb:

The badge previously shared the picked chip's own fill, so once an option was selected the tag melted into it and stopped being readable at exactly the moment it mattered. It now uses a distinct fill: website/src/components/FollowUpBar.tsx:223 renders border border-accent/40 text-accent bg-bg-elevated, against the picked chip body's border-accent/50 text-accent bg-accent-subtle at :158. The four committed capture frames were regenerated from that state.

Nothing else about the badge changed, and I have not touched the ordering question — badge versus reordering is still yours and the other designers' call, and I have deliberately left it open rather than implementing either side.

@rnoack1

rnoack1 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for looking. Measurements at the current head 9c555e8b1 so the design question has the same numbers in front of it — I have not changed the design you are questioning, and I am not trying to talk you out of it.

Your premise is right, and this branch does not touch it. website/src/index.css:2144 caps the chip: .followup-chip{max-width:min(100%,clamp(18rem,calc(50% - 0.1875rem),26rem))}. This branch changes 0 lines of that stylesheet — 23 other files under website/src are in the diff, so that is the cap being left alone rather than me failing to find it.

Where the badge sits relative to the label. website/src/components/FollowUpBar.tsx:234 renders the badge and label as a flex row: the badge at :221 is shrink-0, the label at :195 is block truncate min-w-0, so the label absorbs the truncation and the chip does not grow past that cap. :237 returns the label alone when a chip is not the recommended one, so unmarked chips render exactly as they do today. The badge's width is spent on one chip per list, not on all of them.

On reordering "as always" — there is no ordering behaviour in place to build on yet. website/src/app-sdk/protocol/options.ts:63 is split(sep).map(o => o.trim()).filter(Boolean).map(...), and neither that file nor FollowUpBar.tsx contains any .sort( or .reverse( (210 files under website/src do contain .sort(, so the search does find them when they exist). The agent-facing options rule does not mention order either. So today the chip order is whatever the producer emitted.

That last measurement is the useful part of your suggestion: because nothing sorts, "most reasonable first" would be a change to the producer guidance rather than to this component — which is cheap, and not mutually exclusive with a badge. Ordering could carry the ranking while the badge names the pick explicitly for a screen reader or a user who does not read position as ranking.

Which of the two we want, or both, is your and the other designers' call — I have not implemented the reordering, and I will follow whichever way you land.

@bolichen97

Copy link
Copy Markdown
Contributor

@rnoack1 the 2026-09-08 open-PR relationship audit found two newer open PRs writing into the same lines as this one. The audit read this PR at 45a69ce; the head has moved since, but every file below is still in the current diff.

#8613 (session_escalate, @CrysisDeu) shares website/src/app-sdk/protocol/options.ts. The goals are unrelated, the collision is mechanical: #8613 adds a new early return in deriveFollowUpOptions for m.role === 'escalation', while this PR makes followUpRecommended a required field of FollowUpDerivation and widens all eight return literals. Once this PR lands, #8613's new literal is missing a required field and fails tsc. This PR owns the interface change, so land it first and ask @CrysisDeu for the one-line addition on rebase.

#8003 (subagent credit usage, @welikoiwanenko) shares src/kiro_crew/subagent.py and src/kiro_crew/subagent_manager/run.py, with no shared behaviour. #8003 inserts format_subagent_usage into _COMPONENT_GLOBAL_BINDINGS two entries below the extract_options line this PR renames, and inserts usage.settle() calls directly above the cleaned, _ = extract_options(result_text) statement this PR rewrites into a three-value form. Both edits sit inside the same hunk window, so whichever lands second re-applies those few lines. No split or scope change is needed on either side.

Neither PR duplicates this one. A note on each about landing order is enough, and @CrysisDeu / @welikoiwanenko may want to watch this PR for the merge order.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

On the reordering half of this, verified at adb9d9c6abde19d5d610aab1fdd7af9315cafa68: the options are already meant to arrive best-first, and that is the producer's job rather than the client's, so the two mechanisms compose instead of competing.

  • The dashboard rule instructs it directly: "Order the options most-reasonable-first so the recommended one ..." (src/kiro_crew/context.py:1392).
  • Nothing reorders client-side: no .sort(, .reverse(, toSorted or localeCompare in website/src/components/FollowUpBar.tsx or website/src/app-sdk/protocol/options.ts. (The same search does find sorts under website/src/app-sdk/, e.g. useComposerDraft.ts, so it is reaching.)
  • The badge selects by label string, not position: recommended === o at website/src/components/FollowUpBar.tsx:593 and :625, where the index term only disambiguates duplicate labels.

So position still carries the ranking you want, and adding a client-side reorder on top would override deliberate producer order — a trailing "Nothing more (recommended)", or a (recommended first) / (recommended then) sequence, both of which are in use.

One mechanical detail on "with limited chips, adding tags does not help much", offered as information rather than as a counter-argument: a marker written inside the label competes for the clamped label width and disappears into the ellipsis, whereas the badge is drawn outside the truncating span, so it survives the clip. That clip is the specific problem it addresses.

Whether that is worth a badge at all is the design call, and I am leaving it with you and the other designers as you asked.

@rnoack1

rnoack1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at 2cb5701d0f8289636da326659f1edc12e688c3d7, since the coordinates in my earlier note have shifted and the badge's own treatment has changed since you looked.

Ordering, unchanged in substance: still no client-side reorder — no .sort(, .reverse(, toSorted or localeCompare in website/src/components/FollowUpBar.tsx or website/src/app-sdk/protocol/options.ts — and the producer rule still asks for best-first at src/kiro_crew/context.py:1392. The badge still selects by label string rather than position; those two lines are now website/src/components/FollowUpBar.tsx:581 and :613 (was :593/:625).

What has changed, because it bears on "adding tags does not help much": the badge no longer borrows a monospace-italic voice. It is now an uppercase, letterspaced micro-label matching the product's existing micro-label style, and monospace is reserved for the one case where the marker is NOT stripped and really is sent as typed. So the two states no longer differ only by slant.

The design call is still yours and the other designers', exactly as you left it — this is only to keep the evidence current.

@rnoack1

rnoack1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at b7805a9634feb2111806c5477b5ae0d0d2b7a3c5, and one thing has materially changed since my last note, so it is worth stating rather than leaving in the diff.

Ordering, unchanged: still no client-side reorder — no .sort(, .reverse(, toSorted or localeCompare in website/src/components/FollowUpBar.tsx or website/src/app-sdk/protocol/options.ts, while the same search does find sorts under website/src/app-sdk/ (useComposerDraft.ts), so it reaches. The producer rule still asks for best-first at src/kiro_crew/context.py:1392, and the badge still selects by label string rather than position (website/src/components/FollowUpBar.tsx:574 and :606).

What changed, and it speaks to "with limited chips, adding tags does not help much": the readability cost you were pointing at is now bounded rather than argued. The badge cannot shrink, so previously it could squeeze its own chip's instruction down to about six characters at narrow widths — worst on the one option being steered toward. The label now carries a 12-character floor, and only on a chip that actually has a badge competing with it (website/src/components/FollowUpBar.tsx:202); an unbadged chip is unchanged. A guard-declined chip also no longer fires on a single click, so the literal (recommended) prefix always reaches the composer where it can be edited out rather than being sent as typed.

The marker also carries no special typeface any more: monospace already means "recommended" elsewhere in the product, so a second meaning there collided instead of teaching.

Whether the badge is the right idea at all is still yours and the other designers' call — this is only to keep the evidence current.

@rnoack1

rnoack1 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

At 9fe65ae8e10f05175a2c486e6bc829b021b9c42c, one of the two things here is now settled in code, so recording that rather than leaving it silent. The design question is not settled and I am not treating it as mine.

Ordering-first is already mandated, independently of the badge. The producer rule now carries it, in src/kiro_crew/constants.py's options rule as assembled in src/kiro_crew/context.py (lines 1392-1395 at this sha):

Mark at most one option, and omit the marker when no option is a clear recommendation. Order the options most-reasonable-first so the recommended one leads: a channel that renders no buttons still shows the marker as plain label text rather than a badge, and a chip clamps a long label, so position is the only ranking that survives both.

Two details worth having:

  • It is new in this branch, not pre-existing. That sentence appears 0 times in the base tree this branch is rebased on and once at this head, so the concrete ask lands with this change rather than alongside it.
  • Its stated reason is the same premise you raised: a chip clamps a long label and some channels render no buttons at all, so position is the only ranking that survives. The badge is layered on top of that, not instead of it.

The rule ships in the always-on dashboard rules block, so it applies to every dashboard session rather than being opt-in.

What your objection leaves open is the badge itself, and that part is a product call, not something I should decide by verification. You deferred it explicitly, so it is with the maintainers; nothing here is meant to argue it either way.

@rnoack1

rnoack1 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at 469f5543921e6885e2fb4690fdd974c08ae97e1e after a rebase onto current main, because two specifics I gave you earlier have moved and I would rather correct them than let them go stale.

Your ordering ask is still mandated, and still in the producer rule rather than the client. The line moved with the rebase — it is now src/kiro_crew/context.py:1921-1924:

Order the options most-reasonable-first so the recommended one leads: a channel that renders no buttons still shows the marker as plain label text rather than a badge, and a chip clamps a long label, so position is the only ranking that survives both.

One correction to something I told you. I previously reported a flat 12-character floor on a badged chip's label. That was accurate then and is not now: a fixed 12ch plus a long-locale badge (uppercased ru is 13 characters, the pseudo-locale 24) overflowed the chip box on a ~320px screen. The floor is now 12ch from the sm breakpoint up and 7ch below it, so the instruction keeps a readable stem on a phone instead of either overflowing or collapsing to a sliver.

Also worth stating plainly, since it is the shape of your objection. In between, I did try enforcing the ordering in the renderer by hoisting the marked chip to first position. I took it back out: overriding producer order breaks a deliberately ordered list, and a review lane objected to repairing a producer nobody has observed misbehaving. So ordering is an instruction to the producer, not a guarantee in the client. If you want the hard client-side guarantee instead, that is a call for you and the other designers — the two are mutually exclusive and I am not going to pick for you.

The badge-versus-tags question I have left alone, since you deferred it.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified at 9579ef9e3ccdcd90bf45b8b49acbaf020769e537. Your ordering ask is mandated, and one premise behind the second half of your objection does not hold at this head — recording both rather than leaving them implicit.

Ordering-first is mandated in the producer rule, independently of the badge. src/kiro_crew/context.py:1922:

Order the options most-reasonable-first so the recommended one leads: a channel that renders no buttons still shows the marker as plain label text rather than a badge, and a chip clamps a long label, so position is the only ranking that survives both.

It is producer-side rather than client-side deliberately, so it also applies on the surfaces that render no buttons at all — a client-side sort could not reach those.

On "with limited chips, adding tags does not help much": the badge does not spend label width. src/components/FollowUpBar.tsx:207 renders the label as its own block truncate span, and the badge is a separate shrink-0 sibling outside it, so the tag is not competing with the instruction text for the chip's clamp budget. src/test/FollowUpBar.test.tsx:885 pins that the badge is sized to its content so no locale can clip it. There is one real cost and it is narrower than a general width tax: beside a badge that cannot give width back, the label gets a floor (12ch from the sm breakpoint up, 7ch below it) so a long-locale badge cannot squeeze its neighbour to a sliver.

I am not treating the design question as settled by either point — you asked for reordering instead of tagging, and the ordering mandate above is the part of that which is now in code. Whether the badge should exist alongside it is still open, and you deferred it to other designers.

@rnoack1

rnoack1 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Correcting something I overstated in my previous comment, now that the frames are actually viewable at 3e9da74d982cc7d2be3645944cb0085622bb2701.

I said the badge "does not spend label width" and that it "is not competing with the instruction text for the chip's clamp budget". The first half is right in the sense that matters — the badge sits outside the truncating span, so it is never itself clipped and a long locale cannot ellipsis it away. The second half is wrong. The badge and the label share one width-capped chip, so the badge does take room from the label. The two frames show it directly: unbadged, the label clips at Rebase onto the latest main and re-r…; badged, the same label clips one character earlier at Rebase onto the latest main and re-….

So the honest version of the tradeoff is: the tag costs about a character of the label at this width, not zero — and what the floor buys is a guaranteed readable stem (12ch from the sm breakpoint up, 7ch below it) rather than no cost at all.

That is a smaller cost than a tag inside the label, which spends its own full length and is then the first thing clipped — the case your objection is about. But it is not free, and I should not have said it was.

@iamwhatever

Copy link
Copy Markdown
Contributor

Not approving for now: an outstanding CHANGES_REQUESTED review is still open, and the body itself leaves a scope call unresolved by bundling a second, independent change (Slack option clicks no longer being command-interpreted, affecting every option click) into the marker-badge work. Please split that out or get an explicit maintainer ruling first.

The marker sat inside the chip's single truncated line and the ellipsis reached
it first, so the recommendation was readable only by clicking every chip.
@bolichen97

Copy link
Copy Markdown
Contributor

Rebased onto main cff7de5416 by a maintainer to resolve merge conflicts. Old head e941d562f6, new head 2fd3b10e67.

Conflicts resolved (only these files were hand-merged):

  • src/kiro_crew/constants.py — retained main’s glued-footer repair and the PR’s guarded recommended-marker parser.
  • src/kiro_crew/dashboard/chat_runner.py — retained main’s Stop/actor/retry metadata and combined the PR’s model-authored provenance and action contexts.
  • src/kiro_crew/slack/format.py — retained wait-tool identity handling and text after option markers while using the PR’s three-value recommendation parser.
  • src/kiro_crew/slack/handler.py — retained main’s sessions-keyword predicate and refactored delivery/accounting flow; applied the PR’s command-provenance guards and recommendation parsing at the moved extraction site.
  • src/kiro_crew/slack/renderer.py — retained main’s wait identity, truncation import, and control-comment stripping alongside recommendation extraction.
  • test/test_conn_recovery.py — retained main’s structural recovery kwargs and added the PR’s provenance/action-context expectations.
  • test/test_options_buttons.py — retained main’s suffix-preservation and CPU-scaling tests, adapting them to the PR’s three-value parser.
  • website/src/components/FollowUpBar.tsx — retained main’s instant tooltip and arrow hint alongside the PR’s badge, held-click feedback, and refused-send behavior.

Same single commit, same author, same message. The changed-file set remains exactly 102 files, with no added or absorbed paths. Outside the hand-merged conflict areas, changes come from Git’s automatic rebase onto main; no unrelated edits were made.

Validation: 35 targeted tests passed; all 62 changed Python files compiled and all 14 changed JSON files parsed. No conflict markers remain. The existing blank-line-at-EOF warning in website/src/app-sdk/protocol/recommendation.ts is identical on the old and new heads and was left untouched. Frontend typecheck could not run because this isolated worktree has no installed TypeScript dependency (tsc: command not found); no full test suite was run.

Prior approvals need to be re-given after CI re-runs. This is a conflict-only rebase, not an approval or merge.

Copy link
Copy Markdown
Contributor

Rebase needed again: at head 2fd3b10e67 (merge base cff7de5416, now 2284 commits behind origin/main af1eb612da), a trial git merge-tree against main conflicts in 20 files, including a modify/delete on src/kiro_crew/dashboard/chat_orchestrator.py (removed on main) and content conflicts in slack/handler.py (recomposed from handler_runtime owners in #16908), slack/format.py, slack/renderer.py, dashboard/chat_runner.py, context.py, FollowUpBar.tsx and protocol/options.ts.

Triage result (read-only, from the full diff): no duplicate PR, and main has none of this (splitRecommendation, strip_recommended_marker and followUpRecommended don't exist on main; Slack option clicks on main still dispatch without interpret_commands=False). It still overlaps with open #6823 on FollowUpBar.tsx, as the earlier audit note said. Two blockers already raised stay open: the CHANGES_REQUESTED design review, and the ask to split out the Slack interpret_commands=False behaviour change, which affects every Slack option click.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you @rnoack1 for the very thorough work and the careful follow-ups. We're closing this one: the design call went the other way, and we'd rather keep ordering the most reasonable option first than add a badge to a small set of chips. Main also doesn't use a (recommended) marker today, and the branch now conflicts in 20 files (including chat_orchestrator.py, which was removed). If you still want Slack option clicks to skip command interpretation, a small standalone PR for that piece would be welcome.

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

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants