Skip to content

fix: detect kiro status from live controls and osc signals - #4372

Merged
JJLiebig merged 4 commits into
herdrdev:masterfrom
vinayshah1998:feat/kiro-detection-manifest
Sep 20, 2026
Merged

JJLiebig merged 4 commits into
herdrdev:masterfrom
vinayshah1998:feat/kiro-detection-manifest

Conversation

@vinayshah1998

@vinayshah1998 vinayshah1998 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Kiro panes should show working while a turn runs, blocked while an answer or approval is needed, and idle at the prompt. This PR updates the detection rules so old transcript text does not override those current controls.

Approval menus match their selected options and current footer instead of a heading that long tool details can push out of view. The rules cover clipped footers, trust menus, and request editing. Long feedback uses a complete editor-frame match anchored at the end of the detection buffer, so a closed editor cannot leave the pane blocked.

The bundled manifest and catalog copy are identical, at version 2026.09.19.1 with minimum engine version 2. No Rust, protocol, permission-policy, hook-installation, or session-restore changes.

Before and after

Before the approval fix, a real V3 multiline approval could read idle. The same pending approval reads blocked with the current rules. In this comparison, "before" is the previous PR rule, not the stock released manifest.

Multiline V3 approval before and after the fix

Long feedback also stays blocked. This editor's detection-buffer text was unchanged across the manifest hot reload.

Long V3 request-editor feedback before and after the fix

Current qualification matrix

Tests used Herdr 0.9.0 on Linux aarch64 and Kiro CLI 2.22.2-nightly.4 with an OSC-capable TUI build. The final manifest was checked against captured inputs and through live hot reload. V3 is the primary target.

Live means a real Kiro backend and UI. Controlled means mocked ACP events in the real TUI, or explicit VT input through Herdr's parser. Those checks do not claim a live backend failure.

State or condition Result Evidence
V3 multiline approval, including 80×24 Pass: blocked Before/after above; narrow menus below
V3 highlighted trust option and scope picker Pass: blocked; no trust granted Live menu captures
V3 request editing with empty, short, or long feedback Pass: blocked Live captures and focused replay checks
V3 question and crew approval Pass: blocked; dismissal returns idle Live captures at 125×40 and 80×24
V3 working, completion, and Ctrl+C Pass: working, then idle Live turn and cancellation captures
Historical approval text or a closed editor Pass: no stale blocker Live idle check and negative replay cases; stock before, corrected idle
Unicode/ASCII title-only fallback Pass: working Live V3 agent-monitor captures; isolated ASCII-frame checks
Progress-only OSC and stale working signals Pass: working signal recognized; current controls take priority Controlled VT checks below
Full-context warning and session error Pass: no stale working state; idle Controlled V3 TUI captures. There is no separate error-state rule
Graceful exit and SIGKILL Pass: agent removed; shell remains Real exit and controlled kill-while-working checks
V2 TUI approval Pass: blocked Live Yes / Trust / No menu
Legacy V1 approval Pre-existing miss in both stock and PR rules Same compatibility capture; outside this V3 repair
Native macOS and Windows runtime Not run Requires native test-host access

Validation

  • 38 focused detector cases passed, including incomplete menus, clipped/wrapped footers, approval subviews, long feedback, and stale-panel negatives.
  • 12 controlled VT assertions passed on the final manifest, including isolated signals, all four ASCII spinner frames, priority, and abrupt-exit cleanup.
  • just ci 'test(detect::)' passed: formatting, all-target Clippy/compilation, 96 detection tests, maintenance, architecture, and integration-asset checks.
  • Independent final review found no blocking issue.

Full local just ci stopped on the unchanged Linux ACL fixture for UID 65534, which this sandbox does not map. It reported 2,537 passes before that failure and fail-fast cancellation. The full local gate is not claimed green; no test or CI policy was weakened.

Supporting screenshots

These are captured terminal frames rendered to PNG, not desktop photographs. Captions and recorded-API annotations sit outside the terminal content. Local metadata is redacted. The test sessions used isolated config/state and were removed afterward.

Narrow V3 approval and trust menus

Default approval, highlighted trust option, and scope picker at 80×24

V3 question, crew, and historical-text checks

Question and crew panels remain blocked; historical approval text stays idle

V3 working and cancellation

Working turn and cancellation return the expected states

Controlled signal and priority checks

Isolated progress works; question and crew controls outrank stale working OSC

refs #4203

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8248c624-446b-440a-aa14-a8745e58544d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 378cfed9-2f5e-40a4-a729-f9b43db8c3d9

📥 Commits

Reviewing files that changed from the base of the PR and between 6c7cc36 and b1365ed.

📒 Files selected for processing (2)
  • distribution/agent-detection/kiro.toml
  • src/detect/manifests/kiro.toml

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Kiro detection metadata now targets engine version 2 and release 2026.09.16.1. Detection rules were replaced with region-specific patterns for idle prompts, approvals, question panels, working footers, OSC titles, and OSC progress. Prior broad recent-output, subagent approval, clipboard exclusion, and spinner-based rules were removed.

Suggested reviewers: ogulcancelik

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b1365

No concrete merge-blocking behavior issue remains in the Kiro detection manifest update.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: Kiro status detection now uses live controls and OSC signals.
Description check ✅ Passed The description directly explains the detection-rule changes, validation results, manifest updates, and known test limitations.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

@kangal-bot: I will review the changes in #4372.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Sep 19, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable regression or outstanding blocking issue was identified.

Summary

Updates Kiro pane-state detection to prioritize live controls and use OSC title and progress signals as working cues.

  • Detects current prompts as idle and approval or question controls as blocked.
  • Recognizes both current and legacy tool-approval option vocabularies.
  • Restricts screen matching to bounded live regions to avoid historical-buffer false positives.
  • Keeps the bundled and distributed manifests aligned.

Reviews (2) · Last reviewed commit: "fix: detect kiro status from live contro..."

@vinayshah1998
vinayshah1998 force-pushed the feat/kiro-detection-manifest branch from 6c7cc36 to b1365ed Compare September 19, 2026 00:25
@vinayshah1998

vinayshah1998 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

@vinayshah1998: I will review the changes in #4372.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@JJLiebig

Copy link
Copy Markdown
Collaborator

@vinayshah1998 Thank you for the contribution!

Could you add a few things such as

  • before/after screenshots
  • a matrix of which kiro agent states are validated and qualified by you here based on our PR head and what expected states are missing still or unqualified?

Thanks!

@vinayshah1998

Copy link
Copy Markdown
Contributor Author

@vinayshah1998 Thank you for the contribution!

Could you add a few things such as

  • before/after screenshots
  • a matrix of which kiro agent states are validated and qualified by you here based on our PR head and what expected states are missing still or unqualified?

Thanks!

Hey @JJLiebig thanks for giving this a look! Just added some more details for you, and some screenshots. Let me know if you'd like any more information

@JJLiebig
JJLiebig self-requested a review September 20, 2026 11:51

@JJLiebig JJLiebig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The Kiro detection update is accurate and well-scoped. It replaces broad whole_recent matching with bounded live regions, keys idle off the current prompt line, and requires the real approval option rows plus the live footer, so stale transcript text no longer overrides active controls. OSC title and progress give working detection a fallback when the footer/controls scroll away. Bundled and published manifests are byte-identical at 2026.09.19.1, min_engine_version = 2 is right for OSC, and all CI checks pass. The qualification matrix and before/after captures are thorough, and the remaining gaps (legacy V1 approval, native macOS/Windows) are disclosed. Approving.

@JJLiebig

Copy link
Copy Markdown
Collaborator

Merging this now, @ogulcancelik when you rebase #3964, carry the new kiro detection content into vendor/agent-registry/agents/kiro/detection.toml + refresh lock.json, don't resolve by reverting it.

Should be no issue for clankers but just making the note anyway.

@JJLiebig
JJLiebig merged commit a3a1c94 into herdrdev:master Sep 20, 2026
7 checks passed
kaushikgopal added a commit to kaushikgopal/herdr that referenced this pull request Sep 21, 2026
Merged upstream/master b88e811..2836010. Zero conflicts: all six
overlapping files split into disjoint regions (mouse.rs navigator
scrollbar/row-click work, state.rs navigator fields and close-tab
confirmation, config/model.rs clear_pane keybinding, config-reference.json
keys.clear_pane, AGENTS.md detection policy, tests/mod.rs mod close_tab).
No src/protocol/wire.rs change, so no protocol conflict.

Notable upstream fixes absorbed:
- distinguish agent completion from startup and session changes (herdrdev#4457)
- honor droid scrollback clear requests in panes (herdrdev#4432)
- refresh forwarded ssh agents after reconnect (herdrdev#4443)
- index navigator tabs and panes per endpoint (herdrdev#4426)
- preserve session layouts across shutdown and restore failures (herdrdev#4400)
- confirm closing the last tab in the tui (herdrdev#4409)
- reject terminal-less attach before starting a session (herdrdev#4395)
- drain event subscriptions and report history loss (herdrdev#4225)
- preserve explicit worktree workspace membership (herdrdev#4301)
- keep workspace navigation visible in terminal theme (herdrdev#4408)
- preserve delayed mouse reports with confirmed keyboard input (herdrdev#4247)
- detect codex status with custom interrupt keys (herdrdev#4196)
- detect kiro status from live controls and osc signals (herdrdev#4372)
- recover the cursor during animated redraws (herdrdev#4404)
- stabilize windows cursor redraws and settle deadlines (herdrdev#4389)
- show every agent and terminal in the go to picker (herdrdev#4384)
- add configurable pane screen and scrollback clearing (herdrdev#4383)
- reveal selected agent when cycling the sidebar (herdrdev#4355)
- preserve request ids in socket error responses (herdrdev#4353)
- enable ssh compression for remote connections (herdrdev#4340)
- correct grok activity detection with custom or disabled osc signals (herdrdev#4337)
- preserve windows mouse capture during refresh (herdrdev#4319)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants