Skip to content

feat(chat): nothing_to_do directive ends a quiet turn without recovery - #16429

Merged
CrysisDeu merged 2 commits into
mainfrom
feat/nothing-to-do-directive
Oct 8, 2026
Merged

CrysisDeu merged 2 commits into
mainfrom
feat/nothing-to-do-directive

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a crewmate (or any agent) turn that ran its checks and found nothing the user needs to read can end quietly — no bubble, no recovery card — by calling nothing_to_do.

Today a tool-only turn that stops with no text has no sanctioned ending. The product rule for the crewmate DM thread is "surface only what needs a human", so a closing "nothing new" bubble is noise; but stopping bare after a tool reads to the dashboard runner as a failed generation: it posts an ℹ️ The turn ended without a closing reply — continuing once… card, injects a synthetic continuation, and on the second empty turn posts a give-up card. In the reproduction on #16392 the turn did not even reach that ladder — the chat sat on the thinking indicator until the user typed. The only silent exit was a shown ask_question card, and the runner detected it by matching the applier's outcome prose (QUESTION_CARD_SHOWN_PREFIX), which #9324 asked to replace with a structured signal.

Why it matters

Every quiet patrol cycle, cron wake and "checked, nothing changed" turn today either spams the thread with a status bubble the product forbids, or costs a recovery turn plus two notice cards that read as a crash. Members whose whole job is to patrol quietly cannot do it without one or the other.

Not a goal

What changed (motivation → approach → change)

Decision recorded on #16392 (Zezhen, 2026-10-03), the turn-end contract: after its tool calls, a turn ends in exactly one of two ways — a closing text, or a nothing_to_do call — never by stopping bare after an ordinary tool. The contract makes the existing ladder the enforcement and the new tool the only sanctioned silent exit.

Approach: build nothing_to_do as a session directive like ask_question (stateless tool → marker → consumer applies to its own session), and make the "this directive ended the turn" fact structured instead of a prose match, so both terminal directives ride one signal.

  • session_directive.DIRECTIVE_TOOLS gains nothing_to_do; validation.NOTHING_TO_DO_SCHEMA (one optional note, clamped like autonudge_stop.reason so a long note never costs the quiet end); mcp_tools/control.py descriptor + handler; title End turn quietly in data/mcp_tool_titles.json.
  • dashboard/session_directive_apply.py: new DirectiveOutcome(text, ends_turn) and apply_session_directive_outcome(...); TERMINAL_DIRECTIVES = {ask_question, nothing_to_do}. ends_turn is set only where the effect landed — a card a client renders, a quiet end recorded — and _outcome() forces it False on any Error: text. apply_session_directive stays as the text-only entry. _nothing_to_do has ONE gate — who opened the turn: a monitor wake (producer_is_self_wake) or a headless producer (cron, crew, app, task runner) may end quietly; a turn a person opened (user-facing dashboard turn, or any channel turn, since the channel driver cannot yet tell a human's message from a loop's wake) is REFUSED (QUIET_END_REFUSED_USER_TURN, ends_turn False), so the ladder, Resume and the channel notice run as before and a model that dodged a question fails visibly. No slot or surface gate otherwise (it mutates nothing a wrong identity could misdirect); sub-agent isolation is the structural isolation every directive has.
  • dashboard/chat_runner.py: _terminal_question_posted + prefix match → _terminal_directive_applied, set from DirectiveOutcome.ends_turn; the empty-response branch is skipped for such a turn (no notice, no continuation, no budget spent). Text or a tool call after the terminal directive is counted and reported once as a privacy-safe WARNING (Turn-end contract violation, counts + directive kind only); it never re-arms recovery, because that would turn the quiet end the model asked for into a notice card. The transcript's record is the tool card's applied outcome (Nothing new to report. <note>; declared pill title Nothing to report — no "turn", a word the UX review's blind reader could not place); no assistant bubble.
  • messaging/driver.py + messaging/dispatch.py: DirectiveConsumer may answer True (the consumer returns outcome.ends_turn); TurnDriver.terminal_directive_applied then makes a CLEAN terminal owe no empty_turn_notice. A refusal or error:-family terminal after the directive keeps its notice (_is_fault_terminal) — that fault is still the user's to hear — and an exhausted stream still gets the unclosed notice, since that fault is the transport's.
  • chat_turn/directives.py: not-applied outcome line for the new kind.
  • chat_runner.py keeps QUESTION_CARD_SHOWN_PREFIX and apply_session_directive bound (the runner's base-names ratchet in test_chat_runner_composition_contract.py may only tighten), even though the turn loop itself consumes the structured outcome.
  • agent.py: _CONDUCTOR_CORE_GRANTS and _PIPELINE_CONDUCTOR_CORE_GRANTS gain @kirocrew-core/nothing_to_do, so a quiet patrol cycle never trades a noise bubble for an approval prompt; agent_materialization/conductor_agents._HISTORY_CORE_VERBS lists it too (main's new shipped-grant history: every grant an installer writes must be named there); the byte-pinned spec goldens (test_agent_refactor_spec_bytes.py, test_agent_refactor_contracts.py) move with them.
  • dashboard/state.py + website/src/store/chat/selectors.ts: an APPLIED quiet end is a FINISHED turn for the interrupted-turn scan. The runner stamps meta.ends_turn = True on the applied directive's tool row (persisted, and patched live over chat_message_update) — scoped like the mcp-app flag beside it: only a row THIS turn wrote (_rows_before_turn) and only when the id names one call (_tcid_identifies), so a transcript-preserving reset that reuses an earlier turn's tool_call_id cannot rewrite that older refused row into an applied one; the scan requires that flag plus the trusted identity, and only when the row is the turn's LAST tool row (a later tool row means the model kept working past it, and a gateway that died there must not hide behind it). A refused call carries the identity and no flag. Its tail ([user|nudge, tool…]) is shape-identical to a gateway that died mid-turn, so without this every quiet patrol cycle offered Resume and flagged the session as interrupted in the sidebar. is_quiet_end_row / isQuietEndRow match the applied directive's tool row on its persisted TRUSTED identity (meta.tool_name + meta.mcp_server, the backend's _meta.kiro fields), never on its title, so a shell command printing the name cannot close a turn. (Found while taking the screenshots below — the "before" frame still offers Resume.)
  • chat_utils.EMPTY_TURN_NOTICE_KIND + components/chat/crewmateBubbles.ts: the ladder's own cards (continue, give-up, post-compaction resume) now carry meta.kind = "empty_turn", and the Crewmate chat drops a notice row by that tag — never by its words. A person reading a crewmate has nothing to do with the runner's recovery; an untagged notice (an automation arm refusal) still draws because it may need them. The Sessions page keeps drawing the cards. This closes the "before" crewmate frame below for good: even a turn that violates the contract no longer puts those two cards into the crewmate's chat.
  • config/prompt.md: the tool bullet next to ask_question, and the turn-end contract under Rules (all surfaces).
  • Specs updated in the same commit: docs/architecture/mcp.md (directive list, terminal-signal paragraph), docs/system-specs/modules/session.md (ladder: terminal directive is not an empty turn), docs/system-specs/modules/messaging.md (verdict table row, consumer contract).

No RFC exists for this product-shape change; the decision and its triage live on #16392. If the First Principles lane blocks on that, it needs the maintainer override.

Backwards compatibility

Compatible: apply_session_directive keeps its str return; DirectiveConsumer's awaited type widens from None to Any and an older consumer returning None is judged exactly as before (pinned by test_an_older_consumer_returning_none_keeps_the_verdict); QUESTION_CARD_SHOWN_PREFIX is still exported and still the card's wording — only the runner no longer branches on it.

Removes nothing: no key, path, record or public function is removed or renamed; nothing_to_do is additive and every existing directive applies as before.

Tests

  • test/test_nothing_to_do_directive.py (new, 22 tests):
    • tool: directive registered on the core server, marker decodes with/without note, oversized note clamped not refused, TERMINAL_DIRECTIVES ⊆ DIRECTIVE_TOOLS, every directive has a not-applied line.
    • applier: nothing_to_do → ends_turn=True with slot, slot-less (channel) and headless producer; ask_question shown → True, dropped (0 clients) → False, refused → False; Error: text never ends a turn; string entry returns text only; unknown kind is a structured error.
    • channel driver: consumer True + clean close → no empty-turn notice; refusal / error:* after the directive → notice kept; None → verdict unchanged; forged marker under a shell tool sets nothing; flag resets per run().
    • dashboard runner, driving the real _run_chat with the real applier: a shell tool + nothing_to_do + end_turn queues no recovery, spends no budget, renders no notice and no assistant bubble, and the tool card carries the quiet line with the note (marker stripped); the same turn without the directive is recovered (counterfactual); text after the directive logs the WARNING with no model text in it and still re-arms nothing.
  • test_nothing_to_do_directive.py: a person's turn + nothing_to_do → refused, recovery re-armed, no ends_turn flag, is_turn_interrupted True (the blocking review item); wake / headless / self-wake-on-user-slot → applied; channel → refused; the applied row carries ends_turn and a live patch; QUIET_END_TOOL/QUIET_END_SERVER pinned against selectors.ts; an older refused row sharing the new call's id is not stamped (fails without the guard).
  • crewmateBubbles.test.ts: a tagged recovery card is dropped from the crewmate chat; the same words untagged, and a differently tagged notice, still draw. test_nothing_to_do_directive.py asserts every card the ladder writes carries the tag.
  • test_to_dict_board_fields.py + website/src/test/chatSlice.continuable.test.ts: a quiet-end tail is not interrupted; a shell row whose title names the tool, and the right name on a foreign server, still are.
  • Updated: test_session_directive.py (case table), test_directive_refusal_not_lost_marker_8635.py (hostile-call row), and the spies in test_acp_tool_identity.py, test_session_directive_input_digest.py, test_discord_resumed_busy.py, test_driver_session_directives.py now patch apply_session_directive_outcome and return a DirectiveOutcome.

Run locally once (files touched only): the new module plus the nine directive/runner/driver/MCP test files above, all green; black/isort/flake8 on the touched files, mypy --platform linux src/kiro_crew, scripts/docs-lint.sh clean. Full suites are CI's.

Manual verification

Screenshots below come from the REAL built SPA (website/dist) with every /api/** call answered from fixtures (website/scripts/capture-nothing-to-do.mjs, same shape as the other transcript harnesses) — no gateway, no agent. The fixture rows are exactly what the backend persists for such a turn (a shell tool row, then the @kirocrew-core/nothing_to_do tool row whose meta.output is the applier's quiet line), and the "before" rows are the two notice cards main writes for the same turn with no directive. The harness also asserts the page text: after = quiet line present, no notice, no Resume; before = notice present, Resume offered. A live-gateway run is still owed (the Dev Fleet pod for this worktree answered repo_unavailable from this session); the real-runner tests above drive _run_chat with the event stream a live call produces.

Screenshots / video

Sessions page — the same patrol turn. After: the directive's tool row expanded to its quiet line; no bubble, no card, the composer offers Send. Before (main): two ℹ️ recovery cards and a Resume button.

Sessions page, after: the nothing_to_do tool row expanded to "Turn ended quietly — nothing to report", no assistant bubble, no notice card, Send offered

Two more Sessions frames the UX review asked for: the quiet-end row as it ships when the model gives the call no purpose line (the pill falls back to the declared title Nothing to report), and the REFUSED case — a person opened the turn, the model still called nothing_to_do, the applier refused, the ladder ran its two cards, and the composer offers Resume.

Sessions page, declared title: the quiet-end pill reads "Nothing to report" with no purpose line, expanded to its applied output

Sessions page, refused: a person's question answered with nothing_to_do — the row shows "Error: nothing_to_do was not applied — a person opened this turn…", followed by the two ℹ️ recovery cards and a Resume button

Sessions page, before: the same turn without the directive — two ℹ️ "ended without a closing reply" notice cards and a Resume button

Crewmate page — the crewmate's earlier reply, then a monitor wake that found nothing. After: the chat is unchanged (tool rows are machinery there). Before (main): the two notice cards are drawn into the crewmate's chat — main's untagged rows; with this PR the runner tags them and the crewmate chat drops them.

Crewmate page, after: only the earlier exchange is drawn; the quiet patrol cycle leaves the chat untouched

Crewmate page, before: the two ℹ️ recovery cards appear in the crewmate's chat after a quiet patrol cycle

Related Issues

Fixes #16392. Implements the structured terminal-turn signal from #9324 for the two terminal directives (the rest of that inventory stays open there). Hang observation recorded on #14238. Related: #11237.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@CrysisDeu
CrysisDeu requested a review from a team as a code owner October 3, 2026 08:13
@CrysisDeu
CrysisDeu requested a review from dodgeblaster October 3, 2026 08:13
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 01cab5cf51e03b2380e0707a8de81ad2fbd360e3 — 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 channel driver's new "skip the notice after a quiet end" branch can never fire: every channel call to nothing_to_do and ask_question is refused.

Not justified as shipped

  • Item 4 — zero consumers: build_directive_consumer hard-codes producer_is_channel=True and never self-wake. _nothing_to_do refuses that case ("A channel turn is refused too"), and ask_question is in _DASHBOARD_ONLY_DIRECTIVES, which is refused when slot is None. Across the 10 directive_consumer=build_directive_consumer sites, outcome.ends_turn is never True.
    Subtraction: delete TurnDriver.terminal_directive_applied, _is_fault_terminal, the applied is True branch, and the bool return and Awaitable[Any] widening in dispatch._consume / DirectiveConsumer.
    Clears when: the branch is deleted, or a channel caller that can return ends_turn=True is shown.
  • Item 6 — oversized: isEmptyTurnNotice hides the continue and give-up cards in the Crewmate chat for every turn, including bare-stop failures. ## Not a goal excludes "Changing the empty-response ladder for turns that genuinely produced nothing". The quiet end already removes the cards for turns that call nothing_to_do.
    Subtraction: delete isEmptyTurnNotice and the meta={"kind": EMPTY_TURN_NOTICE_KIND} stamps.
    Clears when: the mechanism is removed, or a human amends the Goal.
  • Item 10 — zero consumers: grepping TERMINAL_DIRECTIVES finds only comments ("Membership here is documentation and a test pin"). apply_session_directive( now has 0 production callers; only tests call it.
    Subtraction: delete TERMINAL_DIRECTIVES.
    Clears when: the constant is deleted or gains a runtime reader.

What this change ships

Inventory (10 items) — 7 justified

Intent: let a patrol, cron or wake turn that found nothing end with no message bubble and no recovery cards. This is an ADDITION.

  1. An agent can end a wake or headless dashboard turn quietly with nothing_to_do — justified
  2. A turn a person opened, and every channel turn, refuses the quiet end — justified
  3. An ask_question card is now detected by a structured flag instead of matching its text — justified
  4. Channel threads skip the empty-turn notice after a terminal directive — zero consumers
  5. A turn that ended quietly no longer offers Resume or shows as interrupted — justified
  6. The Crewmate chat hides the runner's continue and give-up cards on every turn — oversized
  7. Conductors auto-approve nothing_to_do — justified
  8. The system prompt now states the turn-end contract on all surfaces — justified
  9. A warning is logged when the model keeps working after a terminal directive — justified
  10. A TERMINAL_DIRECTIVES constant and the text-only applier wrapper are kept — zero consumers

[FIRST-PRINCIPLES-REVIEWED] 01cab5c

Description read

[DESCRIPTION-READ] 7707a009f543cb5f0ac3f6fd47fc2238051e81602873695d9925ed12e91ade28

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

Design-level review of 01cab5cf51e03b2380e0707a8de81ad2fbd360e3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The rule that a turn a person opened can't end quietly relies on _directive_user_origin, which only stands in for that. It is False for app-originated human sends, so those turns can end with no reply.

Watch

  • The person-opened gate depends on a flag that means something else. _nothing_to_do refuses only when producer_is_user_facing or producer_is_channel. The runner fills producer_is_user_facing from _directive_user_origin. That flag decides which surface may run user-surface directives; it does not record who wrote the message. chat_handlers.py:1242/4102/4652 sets it to directive_user_origin=not bool(request_app), and spec_builder/backend/runtime.py:426/463 passes a variable origin. So when a person's message arrives through an app-hosted chat, the turn counts as "headless". nothing_to_do is then applied with ends_turn=True, and is_turn_interrupted treats the turn as finished. The result is no bubble, no recovery ladder and no Resume on a turn whose question was never answered. The description's promise that "a model that dodged a question fails visibly" does not hold on that path.
    Clears when: the gate reads a real "a human authored this turn" fact (e.g. _turn_actor, or the request's human-sender provenance) instead of _directive_user_origin, or a test shows that an app-forwarded human message is refused.

Suggestions

  • On channels, ends_turn can never be True. nothing_to_do is refused whenever producer_is_channel is set, and ask_question is in _DASHBOARD_ONLY_DIRECTIVES with slot=None. So the changes to DirectiveConsumer's return value, TurnDriver.terminal_directive_applied and _is_fault_terminal are plumbing nothing reaches yet. Either drop them until the channel driver carries wake provenance, or add a test that shows a path where they fire.

[DESIGN-REVIEWED] 01cab5c

Description read

[DESCRIPTION-READ] 9af6416cef6ee655db91474d61a9ddb2411043f169b8d1f936f070b287070ec6

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@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 Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 01cab5cf51e03b2380e0707a8de81ad2fbd360e3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 01cab5c

Verdict parsed from the review's SHA-scoped output markers for commit 01cab5cf51e03b2380e0707a8de81ad2fbd360e3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 01cab5cf51e03b2380e0707a8de81ad2fbd360e3: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 01cab5cf51e03b2380e0707a8de81ad2fbd360e3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 01cab5c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 01cab5cf51e03b2380e0707a8de81ad2fbd360e3: <one-sentence reason>

@CrysisDeu
CrysisDeu requested a review from a team October 3, 2026 09:03
@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 Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of 01cab5cf51e03b2380e0707a8de81ad2fbd360e3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

When the quiet end is refused, the card still says "Nothing to report" with a green check, while its output says "Error". A first-time reader can't tell whether the step worked.

Watch

  • The refused quiet end reads as a success. When a person asks a question and the model calls nothing_to_do anyway, the call is refused with QUIET_END_REFUSED_USER_TURN. The row keeps the title "nothing_to_do": "Nothing to report" and a green completed check, and its output box shows Error: nothing_to_do was not applied — a person opened this turn, so it owes them a reply. Answer in text…. That message is written to the model, not to the user. The blind reader said of shot-03: "the step is green, but the box says Error… I can't tell whether that step succeeded or failed", and called it "a scolding message, apparently aimed at the assistant rather than at me". The title also asserts "Nothing to report" on the very turn where a person is waiting for an answer.
    • Severity: low frequency, since it only happens when the model misbehaves, but it confuses the user every time it does, on exactly the turn where they wanted an answer.
    • Fix: show the refused call as failed (not a green check), or give it a title that doesn't claim success.

Suggestions

  • In shot-01 the output starts with "Turn ended quietly — nothing to report", but the diff ships QUIET_END_OUTCOME_PREFIX = "Nothing new to report.". Shot-01 shows wording the code no longer produces, so drop it or re-capture it to match shot-02. The blind reader couldn't tell shots 1 and 2 apart because of this.

[UX-REVIEWED] 01cab5c

Description read

[DESCRIPTION-READ] a264f5058528bc54a25662098c87508dabb7d5a7f2bf9d8641d9b6fb6c01ab12

That sha256 names everything this verdict read: the PR description, plus the 9 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@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 Oct 3, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/nothing-to-do-directive branch from de8ed82 to 27781a2 Compare October 3, 2026 09:43
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 27781a2: Maintainer decision, recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written for it; the issue thread and the session/mcp specs updated in this PR are the record.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 27781a2e8753a9cda0368c1ea7c5b2d6176c3a17.

Maintainer decision, recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written for it; the issue thread and the session/mcp specs updated in this PR are the record.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 3, 2026
@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 Oct 3, 2026
@CrysisDeu CrysisDeu added the enhancement New feature or request label Oct 3, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/nothing-to-do-directive branch from 27781a2 to 69f8874 Compare October 3, 2026 23:15
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 69f8874: Maintainer decision recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written; the issue thread and the session/mcp specs updated in this PR are the record. Same override as on the pre-rebase head 27781a2.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 69f8874497bfbf3f84c3c8927349a188ccdbc616.

Maintainer decision recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written; the issue thread and the session/mcp specs updated in this PR are the record. Same override as on the pre-rebase head 27781a2.

This decision applies only to this commit. A new push requires a new judgment.

@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 Oct 8, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/nothing-to-do-directive branch from 65aa5a0 to c23822c Compare October 8, 2026 03:38
@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 Oct 8, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles c23822c: Maintainer decision recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written; the issue thread and the session/mcp specs updated in this PR are the record. Same override as on 65aa5a0.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@CrysisDeu marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for c23822c79e3e83615f5170428f38ec8909c6389b.

Maintainer decision recorded on issue #16392 (2026-10-03): the turn-end contract (closing text or nothing_to_do, never a bare tool stop) is the product shape for every agent, so quiet patrol cycles stop producing recovery cards and noise bubbles. No RFC will be written; the issue thread and the session/mcp specs updated in this PR are the record. Same override as on 65aa5a0.

This decision applies only to this commit. A new push requires a new judgment.

@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 Oct 8, 2026
@CrysisDeu
CrysisDeu force-pushed the feat/nothing-to-do-directive branch from c23822c to b40964d Compare October 8, 2026 04:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 8, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

This adds a new nothing_to_do directive so a quiet tool-only turn can end with no bubble and no recovery card. It also replaces the prose match on QUESTION_CARD_SHOWN_PREFIX with a structured signal. HOLD for three reasons. The PR is CONFLICTING with main (mergeable=dirty, "merge conflict" label). It is a large new feature and agent-contract change (+1706/-116 across 33 files, including chat_runner.py, session_directive_apply.py, the messaging driver and prompt.md). And its UX lane is still at CONCERNS: a refused quiet end shows a green check and "Nothing to report" while the step output says Error. I did not do a line-level review because the head cannot merge as it stands. Please rebase onto main, resolve the conflicts, answer the UX concern on the new head, and get a maintainer to accept the new directive. — crew-pr-reviewer

A crewmate patrol turn that ran its checks and found nothing to report
had no sanctioned way to end: a closing text is a noise bubble the
product rule forbids, and stopping bare after a tool reads to the runner
as a failed generation (continue nudge, then a give-up card). The only
silent exit was a shown ask_question card, detected by matching the
applier's outcome prose.

Turn-end contract (issue #16392): after its tool calls a turn ends with a
closing text or with `nothing_to_do`, never by stopping bare. The new
kirocrew-core directive takes an optional one-line `note`, needs no
surface, slot or provenance gate (a cron wake or patrol cycle with
nothing to report is its designed caller; it mutates nothing), and its
applied outcome on the tool card is the inspectable record that the turn
ended on purpose. No assistant bubble, no notice card, no continuation.

The terminal-turn signal is now structured, as #9324 asked:
`apply_session_directive_outcome` returns `DirectiveOutcome(text,
ends_turn)`, set only where the effect landed (a card a client renders; a
quiet end recorded) and never derived from the outcome text. The
dashboard runner reads it to skip the empty-response ladder, and
`ask_question` is moved onto the same signal; the channel driver reads
the consumer's `True` and owes the thread no empty-turn notice. A bare
tool stop keeps today's recovery, which is what makes `nothing_to_do` the
only silent exit. Activity after the directive is counted and reported
once as a privacy-safe WARNING, never re-arming recovery.

The base prompt states the contract and describes the tool. Specs:
docs/architecture/mcp.md, docs/system-specs/modules/session.md,
docs/system-specs/modules/messaging.md.
A `nothing_to_do` turn ends on its tool row, so its transcript tail
(`[user|nudge, tool…]`) is shape-identical to a gateway that died
mid-turn: the composer offered Resume and the sidebar flagged the session
as interrupted on every quiet patrol cycle. `is_turn_interrupted` and its
frontend mirror `selectTurnInterrupted` now treat the applied directive's
tool row as a terminator like the Stop card, matched on the row's
persisted trusted identity (`meta.tool_name` + `meta.mcp_server`), never
on its title, so a shell command printing the name cannot close a turn.

The runner's own recovery cards (continue, give-up, post-compaction
resume) now carry `meta.kind = "empty_turn"`, and the Crewmate chat drops
a notice row by that tag, never by its words: a person reading a crewmate
has nothing to do with the runner's recovery, while an untagged notice
(an automation arm refusal) still draws. The Sessions page is unchanged.

Review round (bolichen97): the applier's ONE gate is who opened the
turn. A monitor wake or a headless producer may end quietly; a turn a
person opened (a user-facing dashboard turn, or any channel turn, since
the channel driver cannot yet tell a human from a loop's wake) is
REFUSED, so a model that dodged a question fails visibly through the
ladder, Resume and the channel notice. The runner stamps
`meta.ends_turn` on the applied directive's row (persisted and patched
live), and the interrupted-turn scan on both ends requires that flag plus
the trusted identity, and only when the row is the turn's last tool row.
The two conductor grant tuples gain `@kirocrew-core/nothing_to_do` (and
the byte-pinned spec goldens move with them); a parity test pins the
frontend mirror's constants to the backend's.

On a channel turn the quiet end silences only a CLEAN close: a refusal
or an `error:` terminal after the directive keeps its empty-turn notice,
since that fault is still the user's to hear.

Also: the two runner imports that lost their last caller are removed
(and dropped from the composition baseline), the test module no longer
narrates issue numbers, and `website/scripts/capture-nothing-to-do.mjs`
is the fixture-driven harness behind the PR's screenshots.
@buluoray

buluoray commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

This merged while I was finishing a review. The directive itself checks out (provenance gate, ends_turn stamp, last-tool-row rule and fault terminals are all mutation-pinned). One remaining issue is still true on main: the Crewmate chat now hides every empty_turn notice, including the give-up rung on a person's failed turn. Tracked with acceptance criteria in #18232.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(chat): a nothing_to_do directive so a quiet crewmate turn can end silently

4 participants