Repository navigation
fix(spawn): pass effort_pendings to the spawn_run receipt helper - #19485
Conversation
_spawn_run_receipt is keyword-only and renders every effort verdict list it is handed, but the pending list was read as a free name from the builder's scope. Every spawn that started a member raised NameError while rendering its receipt, and flake8 reported F821. Pass effort_pendings through like effort_drops and effort_applies, and pin both the plain no-effort spawn and the helper's pending line. Fixes #19484
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 0c94f4f Description read[DESCRIPTION-READ] 0981465d967ca1bb8accff9c203c82b61944618e8db2ff538064984b5054a08b 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 |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (3 items) — 3 justifiedIntent: when someone asks the agent to start a subagent with
[FIRST-PRINCIPLES-REVIEWED] 0c94f4f Description read[DESCRIPTION-READ] 6e050b185219c1fbee2d9597dc0b2e1dc3b1a34a8699490ed0a1f0601fbc2fa5 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsThe fix is correct and complete: the parameter now exists, the only caller passes it, and the body already uses it. No findings. [OPUS-REVIEWED] 0c94f4f 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 — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- docs/decisions/2026-10-10-conductor-board-tab-replaces-the-in-chat-board.md:5 -- Superseding decision requires a maintainer override (origin: validation)
[BLOCK-MERGE] 0c94f4f Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (fenced): the condition is present, not rare. False positive or not applicable? A repository writer can comment: |
|
Quick fix on main test issues |
Problem / Motivation
Goal: Make
spawn_runrender its receipt again instead of raising aNameErrorafter starting its sub-agents.On main, every
spawn_runthat starts at least one member raisesNameError: name 'effort_pendings' is not definedwhile rendering the receipt, with or without areasoning_effort. flake8 reports F821 onsrc/kiro_crew/mcp_tools/spawn.py, which turns the lint lane red on every PR.Why it matters
Every crew that spawns sub-agents gets an error result back instead of the receipt naming the started members, so callers cannot tell what was started. Every open PR also carries the F821 lint red and the spawn-path test reds this causes.
Not a goal
test/test_subagent_turn_resilience.py; that is fixed separately in test(subagent): wait on signals in the captured-deadline recovery tests #19478.What changed (motivation → approach → change)
NameErroroneffort_pendingsat the pending-verdict loop of_spawn_run_receipt._spawn_run_receipt, which receives each verdict list as a parameter. fix(acp): apply a reasoning effort chosen while no model is pinned #18905 added the pending list in the builder and read it in the helper as a free name, but never passed it in.effort_pendingsto the helper's keyword parameters and pass it from the_receiptclosure, the same wayeffort_dropsandeffort_appliesgo. The pending line text is unchanged.Backwards compatibility
Compatible:
_spawn_run_receiptis private and has one caller, updated here; the receipt text is what #18905 intended.Removes nothing: the diff only adds a parameter and its argument.
Tests
TestAppliedLineRendering::test_plain_spawn_without_effort_renders_its_receipt: a spawn with no effort rendersSpawned 1 subagent(s). Fails on main with theNameError.TestAppliedLineRendering::test_pending_verdicts_reach_the_receipt_helper: the helper renders a pending verdict handed to it by keyword. Fails on main withTypeError(no such parameter).test_pending_line_claims_neither_applied_nor_droppedandtest_applied_line_renders_with_id_and_keyalso fail on main with theNameErrorand pass here.flake8 src/kiro_crew/mcp_tools/spawn.py test/test_spawn_reasoning_effort.py: clean.test_spawn_reasoning_effort,test_spawn_run_per_task_overrides,test_mcp_core_spawn_sub_agents,test_spawn_queued_reason,test_spawn_backend,test_spawn_single_task_gate,test_spawn_release_queued,test_spawn_queued_scope,test_spawn_followup): 371 passed.Manual verification
N/A — unit coverage sufficient: the failing path is the pure receipt renderer, driven end to end through
spawn_runwith a fake gateway.Related Issues
Fixes #19484
Pattern harvest
Rule candidate: lint
Pattern: a free name read inside a helper extracted from a closure; flake8 F821 already catches it, so the gap is that F821 landed on main, not a missing rule.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.