Repository navigation
fix(session-control): name the backend refusal code in the session_create reply - #33220
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change appends the backend refusal code inside the reply hook that already exists for create refusals. [DESIGN-REVIEWED] 877e5cb Description read[DESCRIPTION-READ] 149bea79d983d30a370e10b63e8bd7fddb56d3eb1e98aebec49087e275956ded 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The code suffix fixes the gap where it occurs, in the one remedy hook that both What this change shipsInventory (3 items) — 2 justifiedIntent: let a conductor that is refused a
[FIRST-PRINCIPLES-REVIEWED] 877e5cb Description read[DESCRIPTION-READ] a92eaed29d8ba9435754504ee2ec8939b4d44316da8429203708e4b2a312da54 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
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: |
bolichen97
left a comment
There was a problem hiding this comment.
Approving on 877e5cb. Base is main, and all 96 checks are green.
_create_refusal_remedy now names the code for the create route's three backend refusals (unknown_backend, backend_not_installed, backend_restart_required), plus a short next step, so a conductor can branch on it. Other refusal codes fall through as before. A test covers the unknown_backend reply.
No regex, no new restrictions.
Problem / Motivation
Goal: When
session_createorwork_dispatchrefuses abackend, the tool reply names the refusal code, as the tool description promises.The create route refuses a
backendthat cannot start here withunknown_backend,backend_not_installedorbackend_restart_required(from #33145). The MCP tool reply printed only the message, so the code a conductor is told to branch on never reached it.Why it matters
A conductor that picks a harness for a worker needs to tell "no such harness" from "not installed here" to choose its next step: pick another listed backend, or drop
backend. Today it has to parse prose. The gap was found in the end-to-end run recorded on #33126.Not a goal
session_createrefusals.code.What changed (motivation → approach → change)
The create route already returns the code; only the MCP reply dropped it. The tool's existing per-code remedy hook (
_create_refusal_remedyinmcp_dashboard_session_runs.py) now appends the code and the remedy for the three backend refusal codes. One branch, no new state.Before (tool reply, end-to-end run on a real gateway):
After (same call, same gateway, this change):
Backwards compatibility
Compatible: the reply only gains a suffix on these three refusals; every other reply is unchanged.
Removes nothing: no route, field or reply is removed or tightened.
Tests
test/test_session_create_backend.py::TestTheTools::test_a_backend_refusal_names_its_code: a create route answeringunknown_backendmakes thesession_createtool reply contain(code `unknown_backend`).test/test_mcp_dashboard_facade.py; flake8, isort, black and mypy clean on the changed files.Proof: PROVEN test/test_session_create_backend.py::TestTheTools::test_a_backend_refusal_names_its_code (head 877e5cb)
Manual verification
On the isolated end-to-end gateway used for #33145, a conductor called
session_createwithbackendnonesuch,codexandpi. Replies after this change:(code `unknown_backend`),(code `backend_not_installed`),(code `backend_not_installed`). No session was created for any of them.Sibling sweep
Swept:
git grep -n "_create_refusal_remedy\|refused.code" -- src/kiro_crew/mcp_dashboard_session_runs.pySibling: src/kiro_crew/mcp_dashboard_session_runs.py -- changed here
Both
session_createandwork_dispatchrender create refusals through_create_session, which calls this hook, so the one change covers both.Pattern harvest
Not generalizable: the one place a tool description named refusal codes its reply did not print; the reply hook already existed for exactly this.
Other notes
None.
Related Issues
Closes #33218
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)