Skip to content

feat(workflows): hold Kiro Agent plan handoffs for a person on every channel - #25459

Open
kyleseaman wants to merge 1 commit into
feat/kas-wf-2c-dashboardfrom
feat/kas-wf-3-person-holds
Open

kyleseaman wants to merge 1 commit into
feat/kas-wf-2c-dashboardfrom
feat/kas-wf-3-person-holds

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Off by default behind agent.kas_workflows (Developer › Feature Previews); with it off, behaviour is main's. The holds act only on Kiro Agent plan handoffs, which exist only with workflows on.

Problem / Motivation

Goal: When Crew's agent backend is Kiro Agent (KAS), a developer can turn on Kiro Workflows and launch, watch, answer and control KAS workflow runs from the dashboard, with every question or approval a run raises held for a person.

Why it matters

Kiro Agent is the default harness and ships its own workflow engine (recipes, multi-step runs, steps that park for input), but Crew drops the whole _kiro/workflow/* surface: a KAS chat cannot start a workflow, nobody sees a run's steps, and a step that asks a question stalls with no sign anywhere. A run left to channel auto-answer paths could have a person's answer given on their behalf.

Not a goal

  • Turning Kiro Workflows on by default. It stays a developer opt-in (agent.kas_workflows); with it off, Crew behaves exactly as main.
  • Replacing Crew's own workflows (workflow_run, saved Crew workflows). They keep running.
  • Workflows on other harnesses. KAS is the only engine that has them.
  • The session-message cards: they are their own PR (A in the stack).

What changed (motivation → approach → change)

A Kiro Agent workflow plan handoff is the person's call in every approval mode. These paths used to auto-approve one (a chat model's own question is a _kiro/userInput request on main's elicitation path, not held here):

Path Where
Channel trust and YOLO on a messaging channel channel.py, messaging/driver.py
Slack turn approvals and permission ladder slack/gateway_runtime/turn_approvals.py, slack/handler_runtime/permission_ladder.py, slack/gateway.py, slack/handler.py
The tool-permission gate's own auto-approve tool_permission.py
Unattended runs with no approver llm_helpers_parts/tool_approval.py
An all-slots Trust or a YOLO grant made while a handoff waits on a background or channel card kas_workflows/person_hold.py, channel.py, dashboard/interaction_coordinator.py, dashboard/chat_api/slot_approval.py

An attended surface shows the card; an unattended one refuses with a reason. A gate deny still wins. Every other request is unchanged. A grant made while a handoff waits does not answer it either: the hold site marks the future (the channel card, and request_approval(person_only=True) from the Slack gateway's two background calls), and both bulk loops in api_chat_mode leave a marked one pending, so only the card's own buttons settle it.

Stack

Split out of #25395, which was over the 1 MB review cap. Merge bottom-up. Only a PR based on main gets CI (ci.yml and fast-gate.yml run on pull_request: branches: [main]), so each stacked PR is rebased onto main once the one below it merges. A and the B1a protocol PR do not depend on each other. C2's UI uses A's card, which is on main.

# PR Branch Base
1 #25470 (merged) feat/kas-wf-1-session-cards main
2 #25447 (merged) feat/kas-wf-2-backend main
3 #25449 feat/kas-wf-2b-engine main
4 #25450 feat/kas-wf-2c-dashboard feat/kas-wf-2b-engine
5 #25459 (this PR) feat/kas-wf-3-person-holds feat/kas-wf-2c-dashboard
6 #25466 feat/kas-wf-4-frontend feat/kas-wf-3-person-holds
7 #25471 feat/kas-wf-4b-frontend-ui feat/kas-wf-4-frontend

Backwards compatibility

Compatible: only KAS plan handoffs, which exist only with the switch on, change path.

Removes nothing: only additions.

Tests

  • test_kas_channel_person_hold.py, test_kas_unattended_person_hold.py, test_kas_bulk_grant_person_hold.py (an all-slots Trust and a YOLO grant leave a held background and a held channel handoff pending while settling an ordinary request beside each; red with either the marks or the sweep guards reverted), test_slack_gateway.py, test_slack_handler_more_coverage.py.
  • Local gates on this head as for every Python PR in the stack.

Proof: not provable -- other: feature PR, not a fix; each behaviour has its own test named above.

Manual verification

N/A — unit coverage per channel path; a live channel check needs the UI PRs.

Screenshots / video

N/A — this PR changes no website file, so it has no rendered surface.

Related Issues

N/A — no tracking issue, by the owner's choice.

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

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners October 28, 2026 22:07
@kyleseaman
kyleseaman requested review from mbriones98 and removed request for a team October 28, 2026 22:07
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision a94e62600e990fc95e75a1b5e22c8ca2792bf18c touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a94e62600e990fc95e75a1b5e22c8ca2792bf18c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: one predicate (needs_a_person) plus one weak-set mark covers each auto-approve rung and both bulk-grant sweeps, a hook deny still wins, and with the switch off the predicate never matches.

Notes

  • Nothing enforces that every approval ladder checks needs_a_person itself: the PR adds the same check by hand at nine sites. A new ladder or rung that misses it quietly auto-approves plan handoffs. A follow-up could add a structural pin, like a test that lists every ladder entry point, rather than relying on review to catch it.
  • person_only is now a parameter on the public request_approval/ApprovalCoordinator.request signature. Keep it the only way a caller marks a hold, so the _HELD set doesn't end up with a second writer.

[DESIGN-REVIEWED] a94e626

Description read

[DESCRIPTION-READ] 3fcb22a08f4ef64af49a41fdd69f8a684421ba029b48bd1b8bb2ca5b12f024a1

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 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of a94e62600e990fc95e75a1b5e22c8ca2792bf18c — 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 does not.

First-Principles-Verdict: PASS

Nothing blocks. Every rung this PR closes is one main already closes on the dashboard chat path, and the flag stays off by default. One re-export has no consumers.

Notes

  • Item 10 — zero consumers: from kiro_crew.kas_workflows.person_hold import held_for_person # noqa: F401 in dashboard/chat_handlers.py. I grepped held_for_person across src and test. The only users are slot_approval.py and the tests, and both import it from person_hold directly. Subtraction: delete the re-export line in chat_handlers.py.

What this change ships

Inventory (10 items) — 9 justified

Intent: when a developer turns on Kiro Workflows, a plan handoff from a KAS run waits for a person on every channel and is never answered automatically. This is an ADDITION.

  1. Channel trust and YOLO no longer auto-approve a plan handoff in dashboard channels. — justified
  2. The messaging driver (Slack/Telegram transport) skips every auto rung for a handoff, shows buttons in any mode, and refuses when there is no decider. — justified
  3. Slack gateway: per-source auto-approve, --approval yolo/reads, YOLO and slot trust skip a handoff. The no-UI fallback now refuses it instead of auto-approving. — justified
  4. The Slack heartbeat allowlist never auto-approves a handoff. — justified
  5. The Slack handler permission ladder (hook, spawn, auto, Trust, YOLO) skips a handoff. — justified
  6. tool_permission.settle offers no grant for a handoff. — justified
  7. Unattended runs with no approver (cron, heartbeat) refuse a handoff and give a reason. — justified
  8. An all-slots Trust or a YOLO grant leaves held background and channel handoffs pending. — justified
  9. New person_only parameter on request_approval, with 2 Slack gateway callers. — justified
  10. held_for_person re-exported from chat_handlers. — zero consumers

[FIRST-PRINCIPLES-REVIEWED] a94e626

Description read

[DESCRIPTION-READ] c739356c426df98819970d44449f7f8dca21c0062c0e1638341f60c107f7a160

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 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] a94e626

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable a94e62600e990fc95e75a1b5e22c8ca2792bf18c false-positive: <reason, 20 to 500 characters>

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

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging a94e62600e990fc95e75a1b5e22c8ca2792bf18c. Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/messaging/driver.py:1584 -- Auto-mode channels reject attended plan handoffs without asking

return bool(await self.decider(event)) if self.decider is not None else False
Trigger: An operator resumes a workflows-enabled dashboard session in Telegram with approval mode auto. _run_turn constructs no decider in that mode, then passes the resumed session’s KAS plan handoff to TurnDriver._approve(person_only=True).
Outcome: The plan is immediately rejected without displaying approval controls, although Telegram supports a person answering the request.
Anchor: defect
Fix: Retain deciders for authorized, attended turns regardless of approval mode; ordinary auto-approved requests can still bypass them, while plan handoffs await the person.
Sites: Prompt suppression at src/kiro_crew/messaging/driver.py:1305; mode-gated decider construction at src/kiro_crew/telegram/dispatch/turn_engine.py:129, src/kiro_crew/slack/transport_dispatch.py:671, src/kiro_crew/discord/transport_dispatch.py:801, src/kiro_crew/whatsapp/transport_dispatch.py:484, and src/kiro_crew/webex/transport_dispatch.py:524.

[BLOCK-MERGE] a94e626
[GPT-REVIEWED] a94e626

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — MEDIUM harm, upheld. Under auto approval, every plan handoff on these channels is refused and no person is asked. This PR exists to hold those handoffs for a person, so its goal fails on a whole approval mode. It fails closed and the agent sees the refusal, so it is recoverable.

  • Conditions confirmed: turn_engine.py:129 and slack/transport_dispatch.py:671 build the decider only in interactive mode. driver.py:1305 shows the prompt only when a decider exists. driver.py:1584 returns False when there is no decider.

  • Cost of the real fix: small. Build the decider at the five named sites whenever the turn is attended, not only in interactive mode. The driver's other checks already handle ordinary auto-approved requests, so no new mechanism is needed.

    [ADJUDICATION] a94e626 total=1 uphold=1 downgrade=0
    UPHOLD F1 src/kiro_crew/messaging/driver.py:1584 reason=harm-warrants-remedy
    [GPT-ADJUDICATED] a94e626

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a94e62600e990fc95e75a1b5e22c8ca2792bf18c false-positive: <reason, 20 to 500 characters>

@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 102dbec to 87d2e9d Compare November 2, 2026 16:29
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from af54535 to 9cb242b Compare November 2, 2026 16:32
@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 Nov 2, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 87d2e9d to 2e1f8d3 Compare November 2, 2026 17:57
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 9cb242b to 45001d6 Compare November 2, 2026 17:57
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 2e1f8d3 to 4c1d139 Compare November 2, 2026 18:19
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 45001d6 to ca829fd Compare November 2, 2026 18:19
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 2, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from a57464d to 0a2397e Compare November 6, 2026 16:40
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 9a3e58d to 45f6b67 Compare November 6, 2026 16:41
@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 Nov 6, 2026
@kyleseaman kyleseaman changed the title feat(workflows): hold Kiro Agent plans and questions for a person on every channel feat(workflows): hold Kiro Agent plan handoffs for a person on every channel Nov 6, 2026
@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 Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 0a2397e to 2f734ed Compare November 6, 2026 18:43
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 45f6b67 to a9dd6c0 Compare November 6, 2026 18:44
@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 Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 2f734ed to 781f017 Compare November 6, 2026 19:05
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from a9dd6c0 to 0ef14fe Compare November 6, 2026 19:07
@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 Nov 6, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 781f017 to 67be079 Compare November 12, 2026 06:37
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 0ef14fe to 9b882db Compare November 12, 2026 06:38
@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 Nov 12, 2026
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from 9b882db to a94e626 Compare November 12, 2026 07:43
@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 Nov 12, 2026
…channel

A Kiro Agent workflow plan handoff is the person's call in every
approval mode. Channel trust and YOLO on a messaging channel, Slack's
turn approvals and permission ladder, the messaging driver's
auto-approve gate, the tool-permission gate and the unattended
(no-approver) path never answer one on the person's behalf: an attended
surface shows the card, an unattended one refuses with a reason. A gate
deny still wins. Other requests are unchanged; a chat model's own
question is a _kiro/userInput request on the elicitation path.
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-2c-dashboard branch from 67be079 to 552b9b6 Compare November 12, 2026 08:06
@kyleseaman
kyleseaman force-pushed the feat/kas-wf-3-person-holds branch from a94e626 to 3abb813 Compare November 12, 2026 08:08
@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 Nov 12, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Stale-PR cleanup check: this is part of the stacked Kiro Workflows series (base feat/kas-wf-2c-dashboard, under open #25450). It can only move once the stack below lands, and its blocking AI reviews are fixed. @kyleseaman, is this stack still active?

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

readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants