Skip to content

fix(kiro): record Kiro Crew host notice steers as HOST_TURN - #3948

Open
beiryu wants to merge 1 commit into
awslabs:mainfrom
beiryu:fix-3934-bug-on-kiro-cli-a-host-notice-steered-in
Open

beiryu wants to merge 1 commit into
awslabs:mainfrom
beiryu:fix-3934-bug-on-kiro-cli-a-host-notice-steered-in

Conversation

@beiryu

@beiryu beiryu commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #3934

Summary

On Kiro CLI, a notice that Kiro Crew steers into a running turn (for a tool approval nobody answered) was recorded as the person's turn. This change records a steer made only of host notices as a host turn.

Changes

  • core/tools/aidlc-lib.ts: add a kiro crew host notice entry to KIRO_CLI_HOST_TEMPLATES. It matches text made only of whole <user_message> blocks that start with [Kiro Crew host notice].
  • harness/kiro/hooks/aidlc-kiro-adapter.ts: recordMessagesTypedWhileWorking now reads the steer's words with hostTemplateOrigin(steer.words, KIRO_CLI_HOST_TEMPLATES). It falls back to the person origin only when no template matches.
  • tests/unit/t-host-turns-not-the-persons.test.ts: add a regression test.

User experience

Before: an unanswered approval that Kiro Crew declined was recorded as HUMAN_TURN (Origin: person, Source: typed) with a message record holding the host's words. That turn could let a held system package install through and counted as the person's presence at the next gate.

After: a steer made only of host notices is recorded as HOST_TURN (Origin: host), with no message record. A steer the person typed is still their turn, including one that holds a host notice beside their own words.

Checklist

If an item does not apply, leave it unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • If this change adds an input to any fingerprint, epoch, or receipt identity, the description names the human-visible change it detects

Test plan

Added the test Kiro CLI: a Kiro Crew host notice steered into the turn records HOST_TURN; a person's words beside it stay theirs in tests/unit/t-host-turns-not-the-persons.test.ts.

  • Two host notices queued in one steer: one HOST_TURN row, no HUMAN_TURN, and no kept message words.
  • A steer with a host notice and the person's own words (Approve): recorded as one HUMAN_TURN.

The test suite could not be run end to end in the author's environment, because gate-start was refused there, on the baseline too. The new template regex was checked directly. Reviewers should run bash tests/run-tests.sh for the unit level, or the test file above.

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

A host notice was being counted as me typing. That could let a held system install run when nobody was at the keyboard, so I wanted to fix it.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@apackeer
apackeer requested a review from wowzoo November 18, 2026 02:26
@wowzoo

wowzoo commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Reviewing this now.

@wowzoo wowzoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for tracking this down and for the clear write-up. A host notice should never count as the person's turn.

I reviewed the current head 412011e against main. The change is correct for what it targets:

  • The new pattern matched all 36 real Kiro Crew host notices I extracted from Kiro CLI V2 chat records the same way the adapter does, including several notices queued in one steer. A person's own message, including Kiro Crew's o reply, stays the person's.
  • t-host-turns-not-the-persons passes, and the new test fails if either half of the fix is reverted.

What holds it back is where this code path runs today:

  • On the current Kiro Crew (0.12.2) with kiro-cli 3.x, choosing Kiro CLI starts kiro-cli acp --agent-engine v3, not the V2 engine this adapter serves (decision; a v2 opt-in, kirodotdev/KiroCrew#30001, was closed). Crew also does not load a project's hooks in dashboard chats (kirodotdev/KiroCrew#26568), so AI-DLC does not run there yet.
  • So I could not exercise this path on a current build. Which Kiro Crew and kiro-cli versions are you running it on?

Two small things if it goes ahead: the comment above recordMessagesTypedWhileWorking still says every steer is recorded as the person's, and the test could use a real multi-paragraph notice instead of the one-line one.

Fork CI has not run yet. I'm currently asking the Kiro Crew side to support AI-DLC (kirodotdev/KiroCrew#26568), so I think it is too early for AI-DLC to carry a Kiro Crew–specific pattern. I'm leaving this as a comment for now.

@beiryu

beiryu commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review. To be clear: I haven't run Kiro Crew myself. The fix is based on the notices quoted in #3934, not on notices I captured, so I can't confirm the path is reachable on a current build (0.12.2 with --agent-engine v3). I agree a Kiro Crew-specific pattern is premature while kirodotdev/KiroCrew#26568 is open. Happy to leave this on hold until Crew can run AI-DLC, or to close it if you prefer.

This branch has not been deployed

No deployments
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.

[Bug]: On Kiro CLI, a host notice steered into a running turn is recorded as the person's turn

3 participants