Repository navigation
fix(dashboard): gate /todos on live and allocated capabilities - #17971
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The description says the Watch
[DESIGN-REVIEWED] 351966f Description read[DESCRIPTION-READ] 3e10de38b95accb8264d4dd51dfd00531640e025bbf1344d5c8b3d2a4b09aaac 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) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The post-acquisition Not justified as shipped
What this change shipsInventory (7 items) — 4 justifiedIntent: let
[FIRST-PRINCIPLES-REVIEWED] 351966f Description read[DESCRIPTION-READ] a8dc83be2f82a26d5239a9096c7cbb0cec69e32b5c08c57c97cdfba552faf9ee That sha256 names the PR description this verdict read. Recompute it with |
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 Review detailsLive Slack OPTIONS controls can be expired on a FINDING — src/kiro_crew/dashboard/chat_runner.py:19155 — [OPUS-REVIEWED] 351966f Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
cf6861e to
9d63f82
Compare
Replace the static per-harness /todos block with a capability gate on the live, allocated session. A positively-alive provider answers from SessionCapabilities.supports_native_todos; otherwise the member-aware select_provider_backend picks the backend the factory would build. The acquired provider is the final authority and refuses after the claim when it lacks the capability, dispatching no prompt and preserving the first-claim bookkeeping (fresh claims re-arm the replay lease; resumed claims keep their native transcript and re-arm only member re-injection, honoring the #17689 replay invariant) and any live Slack OPTIONS. The sibling /compact gate is moved onto the same get_provider/is_provider_alive + member-aware selection, so a dead registry row can no longer answer for its get_or_create successor. ACP_BACKENDS_NATIVE_TODOS = {claude} is the H6 opt-in; unknown and newly registered backends stay refused until their adapter joins the table. Fixes #17970 Refs #8939 Replaces #13876 by @leonlaiyc Co-authored-by: Leon <276034861+leonlaiyc@users.noreply.github.com>
9d63f82 to
351966f
Compare
Problem / Motivation
Goal: Let
/todosreach the dashboard harness that actually serves the session, and only that one.The dashboard blocks
/todoswith a static per-harness set(
_KIRO_ONLY_BLOCKED_SLASH_COMMANDS = {"/todos"}inchat_utils.py, added by#13805). That set keys on a hard-coded harness identity, not on what the session
that would run the command can do: a harness that implements native
/todos(claude-agent-acp) still has it blocked, and a dead/evicted registry row, a
member-DM backend override, or a provider replaced between the pre-turn probe
and the claim can all make the pre-turn answer diverge from the harness that
actually serves the turn.
Why it matters
A user on a Claude harness cannot use the native
/todoscommand the harnesssupports, and the opposite error (forwarding
/todosto a harness that cannotserve it) sends prompt text to a backend that interprets it as an ordinary
request. The gate must track the live, allocated session, not a static identity.
Not a goal
/todoscommand and itsautocomplete suggestion.
that; this is only the command-dispatch gate.
learn-cron-dashboard.mddoc churn the original fork PR carriedis deliberately not included.
What changed (motivation → approach → change)
The
/todosgate moved fromchat_runner.pytochat_utils.pyon main (#13805)and
SessionCapabilitiesgrew several fields since the original fork PR, so thisre-authors the fork's live-capability gate onto main's current layout rather than
rebasing it.
SessionCapabilities.supports_native_todos, backed byACP_BACKENDS_NATIVE_TODOS = {claude}and read fail-closed viacapabilities_for/capabilities_of(unknown and newly registered backendsstay refused). Classified in
backend_cards.pyOFF_CARD_SETS(it selects acommand-dispatch path, not a task capability a reader loses).
_run_chat/todosgate: commands impossible on every harness stay a truepre-dispatch refusal;
/todosis answered before acquisition by apositively-alive provider or the member-aware
select_provider_backend(...);the acquired provider is the final authority and refuses after the claim when
it lacks the capability, dispatching no prompt and preserving first-claim
bookkeeping (a fresh claim re-arms the replay lease; a resumed claim keeps its
native transcript and re-arms only member re-injection, honoring the
replay-lease-forces-resumed-False invariant) plus any live Slack OPTIONS
(deferred, then drained or cleared in the
finally)./compactgate is moved onto the sameget_provider/is_provider_alive+ member-aware selection, so a deadregistry row can no longer answer for its
get_or_createsuccessor.GET /api/slash-commandsfilters/todosfrom suggestions by the configureddefault backend's capability.
is_claude_backend_namestays imported inchat_runner.py(undernoqa) as abase-surface re-export the composition contract requires; the identity branch
that read it is gone.
Backwards compatibility
Compatible: nothing that works today stops working.
/todoswas globally blockedin the dashboard; this only widens where it is allowed (a Claude harness) and
keeps it refused everywhere it was before. The capability defaults False for every
backend except Claude, matching the prior static behaviour on kiro/kas.
Removes nothing: no path is hidden, no record pruned, no validator tightened, no
key or public function removed. The one legacy
claude_code+Kiro-backend case nowrefuses
/todos(it previously passed on the provider axis) — H2 admits onlyprovider=acp, so that label never selected the Claude harness; the refusalcorrects a path that would have forwarded an unservable command.
Tests
test_agent_sdk_capabilities.py— pinssupports_native_todosper backend(Claude True, others False) and that the field has a consumer.
test_backend_cards.py— the new set is classified by the card.test_api_slash_commands.py—/todosappears in suggestions only when thedefault backend supports it.
test_chat_runner_coverage.py— the acquired-provider authority after stale-roweviction; reprojected-claim confirmation; fresh-vs-resumed first-claim
bookkeeping; deferred Slack-OPTIONS drain across early-failure and cancellation;
member override vs global default both directions; busy-session and warm-refusal.
test_manual_compact_gate.py—/compactdead-row-successor and member-overridecases.
test_chat_runner_composition_contract.py— the base-surface binding set stillresolves.
682 passed locally across these files; flake8 / black / isort / mypy clean.
Manual verification
N/A — unit coverage is sufficient; this is a backend command-gate change with no
rendered delta.
Related Issues
Fixes #17970
Refs #8939
Replaces #13876 by @leonlaiyc
Pattern harvest
Not generalizable: this is a specific capability gate for one slash command;
the capability-set +
capabilities_forpattern it uses is already theestablished H6 shape, not a new rule to harvest.