Repository navigation
fix(decisions): report a failed model.route put-back as the refusal it is - #20767
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that the new warning ("the turn stays on the model it switched to") is still accurate when What this change shipsInventory (3 items) — 3 justifiedIntent: when
[FIRST-PRINCIPLES-REVIEWED] 58b0d4f Description read[DESCRIPTION-READ] a8f2343a36f8f27a55a358fc56ac711d751d10738e69eefe33123c92320f6f0e That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS When the put-back fails, the turn keeps running on the too-small window, but its durable row now looks the same as a refusal that did put the turn back. Watch
[DESIGN-REVIEWED] 58b0d4f Description read[DESCRIPTION-READ] 1d365b3365c3ec67c327b7bd29fe576b1e6190bbe154203a137da8e480b0400a 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 |
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: |
|
|
19fa9d2 to
58b0d4f
Compare
|
|
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 58b0d4f; no behavior change.
Problem / Motivation
Goal: When
model.routeputs a turn back after a too-small served window and that put-back fails, the log and the decision row say it was a refusal, not a failed switch.The comment above the put-back in
chat_runner._route_model_for_turnsays a restore that raises "is still reported as the refusal it is rather than as a failed apply". Theexcept Exceptionarm never read the_refusedflag. So when the switch back raised, the warning blamedset_model(<tier model>), the switch that had worked, and the row was written asswitch-failedwithpdropped.Why it matters
The
smaller-window-refusedrow is how a reader sees the window rules doing their job (#13167). On this path it went missing, and the warning pointed at the wrong switch.Not a goal
lane=field draft feat(decisions): model.route tier lane on the session provider for hosts without a local model #17132 adds to these rows.What changed (motivation → approach → change)
A failed put-back was logged as a failed switch. The error arm only asked whether a tier was chosen, never whether the rules had already refused it.
The error arm in
src/kiro_crew/dashboard/chat_runner.pynow checks_refusedfirst. When it is set, it logsrestoring <model> failed, writes thesmaller-window-refusedrow withp, and returns. Every other failure keeps itsswitch-failedrow and warning.The row stays the plain refusal row on purpose. A refused tier never carries
appliedormodel_used(spec §11), and a turn left on a substitute that cannot be put back already writes this same row onmain. The warning is what names that the turn stayed on the model it switched to.Backwards compatibility
Compatible: only the row and warning for a raising put-back change; every other path writes what it wrote before.
Removes nothing: no row kind, key, or path is taken away; one path writes the right existing row kind.
Tests
test/test_decisions_model_route_apply.py::TestTheWindowTheSwitchActuallyLandedOn::test_a_put_back_that_raises_is_still_the_refusalmakes the backend substitute a smaller window, then makes the put-back raise. It checks onesmaller-window-refusedrow withtierandp, noswitch-failedrow, and a warning naming the restore, not the forward switch.Red on the parent (the row is
switch-failedand the warning readsset_model('model-b') failed), green on this head. Determinism: 20/20 green on repeat, and green in a shuffled order beside its neighbours inTestTheWindowTheSwitchActuallyLandedOn,TestRefusalsKeepTheCurrentModelandTestARefusalStaysPut. It uses mocks andcaplogonly: no sleeps, clocks or ports.Manual verification
N/A — unit coverage sufficient: the change is one branch in an error arm, and the test drives it through a real
_run_chatturn.Related Issues
Closes #13588
Pattern harvest
Rule candidate: review-prompt
Pattern: a flag set "so the handler reports X" that no
exceptarm below it reads.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)