Repository navigation
feat(channels): strip the option-action control tag off non-dashboard surfaces - #30166
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The diff adds no control and changes no visible state. It only removes a control tag that nothing emits yet from text shown in channels, so the missing blind read leaves no evidence gap. Notes
[UX-REVIEWED] 113b90f Description read[DESCRIPTION-READ] 7a869923e027967b7c0ac795f836913d34d59f6d088a5dc0ad4b4095171d1a3c That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change fixes the stated leak at the shared strip seam every channel already calls. The cost is maintenance, and it can be undone. Notes
[DESIGN-REVIEWED] 113b90f Description read[DESCRIPTION-READ] e4f0e9b53dcc02f1f983d691a887221a6816547daef696f85a283f18d83d2310 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ human override accepted@rnoack1 overrode this lane for |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
627fcd8 to
f7d351a
Compare
|
self-added: yes
|
iamwhatever
left a comment
There was a problem hiding this comment.
Request changes: one follow-up needs a tracking issue. Reviewed head f7d351a.
The strip itself looks sound. It runs first inside each shared [OPTIONS:] strip, and the [OPTIONS:] patterns are rebuilt from the same fragments as main (constants.py L678-L688). The fence, widget, balance and sibling-chain refusals match the table in the description (option_action_marker.py), and the Slack live-stream hold now releases a [ as soon as it cannot become a marker head (stream.py L85-L160). CI is green.
Blocker (deferred follow-up without an issue): the Design Review notes that the action grammar now lives in two places, here and in the web grammar from #6823, and nothing checks that they agree the way test_marker_probe_agreement does for [OPTIONS:]. If they drift, raw [OPTION-ACTIONS:] text leaks onto Slack and the other channels. The test cannot be written until #6823 lands, which is fine, but nothing tracks it: #6823's description treats the Python twin as separate work and does not mention an agreement test. Please open one issue for a Python/web agreement test of the [OPTION-ACTIONS:] grammar and link it in this PR's description.
AI findings judged non-blocking
- First Principles note, wait for #6823: landing the strip first is the order #30063 and #6823 describe, and with no producer on main nothing visible changes.
- First Principles note, a fifth
<mcwidget>span regex: duplication only. It has the same shape as preview_text.py L42 and behaves the same.
— crew-pr-reviewer (r146)
|
@iamwhatever The follow-up is now tracked in #30626: a Python/web agreement test for the |
f7d351a to
c706833
Compare
|
self-added: yes
|
c706833 to
93f8fbc
Compare
83ffce1 to
253c583
Compare
|
self-added: yes
|
|
@iamwhatever your blocker on f7d351a asked for one tracked issue for a Python/web agreement test. It is #30626, now rewritten for the current spelling: the marker became the control tag #30626 makes the web chip test read the option-action rows in |
253c583 to
0121a68
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Request changes at 0121a68 for one point.
The goal is right. An <!-- option-action:close=... --> line should not reach WhatsApp, Slack or the other channels as raw text. The WhatsApp live frame now holds a half-arrived tag the way Discord does. User text is kept: only a complete tail-anchored tag line, outside a fence, is removed.
Please don't widen the regex to do it. This repo does not add or extend regex in product code. The PR extends two existing patterns with a new family:
constants.py:_CONTROL_TAG_BODYgainsoption-actionin its(?:deliver|plan_task_id|option-action)alternation, and the partial-tail pattern gains a third_prefix_closure("option-action:", ...)branch.keepVisibleMarker.ts:KEEP_VISIBLE_MARKER_REgains the same alternative.
A structured check covers the new family without touching those patterns:
- Walk the text's trailing lines from the end, outside a fence. Each line's stripped form must start with
<!--and end with-->. - Take the inner body, strip it, split it once on
:, and compare the head to a fixed set of family names. Bound the body at 256 characters and refuse>or a newline in it, as now. - For the live hold, the unfinished last line counts as a prefix when its stripped form is a prefix of
<!-- option-action:, compared as plain strings.
The same small function on the TS side, fed by the shared control_tag_corpus.json, keeps the parity the corpus already pins. The existing families and their regexes are out of scope here. Only the new family should not grow them.
All 97 checks are green.
|
@bolichen97 Fixed at 86a788f. No regex in product code is added or widened.
Tests: 1387 backend tests across the 17 control-tag test files pass, and 38 frontend tests pass. With the family set emptied on both sides, 10 backend and 2 frontend cases fail. |
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The PR adds the option-action control-tag family through string checks at the shared strip seam (strip_control_comments, is_control_tag_tail), which every channel, egress, preview and TTS path already calls. On replies without option-action lines the loop behaves exactly as on main: the same single regex cut, the same fence guard. The hide_partial string check only runs when the regex partial doesn't match, and it is fence-guarded. The is_control_tag_tail fallback returns true only when the strip leaves an empty string, and Slack's 1024-byte hold cap bounds it. WhatsApp live frames now hold half-written tags. The visible text stays a prefix of the full text, so sealing stays monotonic, the same pattern Discord uses. The TS peel fires only when the regex fails, and corpus rows read by both sides cover it. The First Principles BLOCK, which asked for the tag to go into the existing regexes instead, was released by a repo admin because a maintainer review explicitly asked for this string-check approach. Linux backend and frontend tests passed. The Windows backend jobs were still running at decision time, and Analyze (python) had failed on an API rate limit with a re-run pending. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
/ai-review override first-principles 86a788f evidence-supplied: A repo admin asked for the opposite of this BLOCK. bolichen97's review at #30166 (review) forbids widening |
Human judgment recorded@rnoack1 recorded a evidence-supplied release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
/ai-review override first-principles 1784c22 evidence-supplied: A repo admin asked for the opposite of this BLOCK. bolichen97's review at #30166 (review) forbids widening |
Human judgment recorded@rnoack1 recorded a evidence-supplied release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
/ai-review override first-principles 113b90f evidence-supplied: A repo admin asked for the opposite of this BLOCK. bolichen97's review at #30166 (review) forbids widening |
Human judgment recorded@rnoack1 recorded a evidence-supplied release (class
This decision applies only to this commit. A new push requires a new judgment. |
|
Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: First Principles Review. Re-run the lane's latest workflow run for |
bolichen97
left a comment
There was a problem hiding this comment.
Approve at 113b90f. My regex point from 0121a68 was fixed at 86a788f: the option-action family is matched by string checks (_is_string_tag_line, isStringTagLine), and _CONTROL_TAG_BODY, the partial-tail pattern and KEEP_VISIBLE_MARKER_RE are unchanged from main.
The GPT lane's blocker at 86a788f was a keep-visible block whose option-action line sat between sibling tags. That is fixed here. The TS fallback peel now accepts PEEL_FAMILIES (option-action plus the regex's own deliver and plan_task_id), so a mixed tail peels as one block and the exemption still fires. The backend's strip_control_comments already alternates the regex strip and the string strip. Three new shared-corpus cases pin both sides: keep-visible, option-action, then deliver; the same with plan_task_id; and the mixed block inside an unterminated fence, which stays visible.
No regex is added, and all 97 checks are green, the GPT lane included. Approving without auto because auto-merge is already held by someone else.
Problem / Motivation
Goal: Non-dashboard channels never show the dashboard-only
<!-- option-action:close=<label> -->control tag: the backend strips it wherever it already strips control tags.#6823 adds a dashboard chip that closes the session. It is driven by a marker the agent writes as the last line of its reply. That marker is now the control tag
<!-- option-action:close=<label> -->, one more family beside the existing control tags (keep-visible,deliver:,plan_task_id:). If the backend did not know the family, Slack, Teams, Discord, Telegram, WhatsApp, WeCom, Webex and the rest would show it as raw text.Why it matters
#6823 cannot merge until every non-dashboard channel hides its marker. This PR is that backend half.
Not a goal
[OPTIONS:]parses.What changed (motivation → approach → change)
Every non-dashboard channel now hides the close-session tag, because it is one more control tag.
src/kiro_crew/constants.pystrip_control_commentsandis_control_tag_tailalso peeloption-action:tag lines, found by plain string checks; the existing regexes are unchangedkeepVisibleMarker.tsoption-action:lines anywhere in the trailing tag blockwhatsapp/turn_renderer.pycontrol_tag_corpus.jsonstrip_control_commentsalready runs on every channel, the unattended egress leg, previews and spoken replies. So the tag is removed there with no new strip call. On live frames, a half-written<!-- option-actline is held the same way as the other families. WhatsApp's live path did not apply that hold to any control tag, and it now does, so a chunk is never sealed with half a tag in it.The string check follows the existing rules: it is case-insensitive, the tag must end the reply, a tag inside a code fence stays as written, and a label with
>, a newline, or more than 256 characters after the colon is not a tag.Why no screenshot: the only frontend change is a string check for a tag the dashboard already renders as nothing.
Backwards compatibility
Compatible: the only text newly removed is a control tag no producer emits yet. Every other family and every
[OPTIONS:]pattern is unchanged.Removes nothing: no key, function, path or record goes away.
Tests
test/fixtures/control_tag_corpus.json: new cases for the family, including the 256 bound on both sides, the tag stacked before the marker, and adeliver:orplan_task_id:line after it, read by bothtest/test_display_safe_control_tags.pyandwebsite/src/test/keepVisibleMarker.test.ts.test/test_channel_control_tag_strip.py: a reply ending in[OPTIONS: Yes | No]and then the tag keeps its choices and drops the tag on Discord, Telegram, Slack and Webex, in the length split and in Slack's live hold; a half-written tag is held only on a live frame; four maximal tags, one per family, still fit Slack's hold.test/test_whatsapp_turn_renderer.py: the buffered reply drops the tag, and a streaming tag never reaches the live bubble.test/test_preview_text.py,test/test_voice_reply.py: previews and spoken replies drop the tag.On main, 13 of the new and changed cases fail; the rest pass on main because they pin behaviour that already holds. With the family list emptied on both sides, 10 backend and 2 frontend cases fail.
The existing control-tag and
[OPTIONS:]suites pass unchanged: 1437 backend tests across the files that touch control tags, and 41 frontend.Manual verification
N/A — unit coverage sufficient: every change is a pure text transform, tested at each shared function the channels call.
Related Issues
Closes #30063
Part of the #6823 feature.
Follow-up: #30626 makes the web chip's test read this PR's option-action corpus rows, so the backend and web sides cannot drift. It needs this PR and #6823 on main first.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)