Skip to content

fix(spawn): pass effort_pendings to the spawn_run receipt helper - #19485

Merged
iamwhatever merged 1 commit into
mainfrom
fix/spawn-effort-pendings-nameerror
Oct 12, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/spawn-effort-pendings-nameerror

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make spawn_run render its receipt again instead of raising a NameError after starting its sub-agents.

On main, every spawn_run that starts at least one member raises NameError: name 'effort_pendings' is not defined while rendering the receipt, with or without a reasoning_effort. flake8 reports F821 on src/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

What changed (motivation → approach → change)

  • Symptom: NameError on effort_pendings at the pending-verdict loop of _spawn_run_receipt.
  • Root cause: the receipt lives in the keyword-only helper _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.
  • Change: add effort_pendings to the helper's keyword parameters and pass it from the _receipt closure, the same way effort_drops and effort_applies go. The pending line text is unchanged.

Backwards compatibility

Compatible: _spawn_run_receipt is 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

  • New TestAppliedLineRendering::test_plain_spawn_without_effort_renders_its_receipt: a spawn with no effort renders Spawned 1 subagent(s). Fails on main with the NameError.
  • New TestAppliedLineRendering::test_pending_verdicts_reach_the_receipt_helper: the helper renders a pending verdict handed to it by keyword. Fails on main with TypeError (no such parameter).
  • Existing test_pending_line_claims_neither_applied_nor_dropped and test_applied_line_renders_with_id_and_key also fail on main with the NameError and pass here.
  • flake8 src/kiro_crew/mcp_tools/spawn.py test/test_spawn_reasoning_effort.py: clean.
  • 9 spawn test files (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_run with 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

  • 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

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

_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
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 0c94f4f04ac753d538d8412835f4a079fa991319 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .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 added the readiness: checking Automated validation is still running label Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 0c94f4f04ac753d538d8412835f4a079fa991319 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0c94f4f04ac753d538d8412835f4a079fa991319 — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (3 items) — 3 justified

Intent: when someone asks the agent to start a subagent with spawn_run, the run should finish and show its receipt instead of crashing. FIX (#19484).

  1. Every spawn_run that starts a member renders its receipt again instead of raising NameError — justified
  2. The receipt helper now takes the pending effort verdicts as a keyword argument; spawn.py:1053 is its only caller — justified
  3. Two regression tests: a plain spawn that asks for no effort, and pending verdicts handed straight to the helper — justified

[FIRST-PRINCIPLES-REVIEWED] 0c94f4f

Description read

[DESCRIPTION-READ] 6e050b185219c1fbee2d9597dc0b2e1dc3b1a34a8699490ed0a1f0601fbc2fa5

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

The 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 0c94f4f04ac753d538d8412835f4a079fa991319.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0c94f4f04ac753d538d8412835f4a079fa991319: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 12, 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 0c94f4f04ac753d538d8412835f4a079fa991319. 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

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)

Supersedes: 2026-10-02-conductor-introduces-itself-in-every-chat.md
New superseding entry -> replaces the settled every-chat board decision -> triggers the base rule’s mandatory block, even without an accompanying code change.
Anchor: recorded-decisions-are-not-regressions
Fix: Obtain the explicit maintainer override required for this supersession, or exclude it from this PR.

[BLOCK-MERGE] 0c94f4f
[GPT-REVIEWED] 0c94f4f

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

F1 (fenced): the condition is present, not rare. docs/decisions/2026-10-10-conductor-board-tab-replaces-the-in-chat-board.md:5 has a Supersedes: line. The base-branch rule at .review-base-rules/AUTOSDE.yaml:751-752 (recorded-decisions-are-not-regressions, blocking: true) flags any such PR by design. Lines 784-789 make a maintainer's override the only way it lands.
The entry names Joe Guo (@iamwhatever), who is listed at MAINTAINERS.md:12, and links PR #18620 and a comment on it. I could not check those links offline. A FLAG is reserved for rare, extreme cases, and this one is neither, so it stays upheld for a maintainer's override.

[ADJUDICATION] 0c94f4f04ac753d538d8412835f4a079fa991319 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] 0c94f4f04ac753d538d8412835f4a079fa991319

[ADJUDICATION-FENCED] 0c94f4f04ac753d538d8412835f4a079fa991319 fenced=1 flagged=0
UPHOLD-FENCED F1 docs/decisions/2026-10-10-conductor-board-tab-replaces-the-in-chat-board.md:5 -- The superseding entry is present and the base blocking rule (AUTOSDE.yaml:784-789) requires a maintainer override for every supersession, so the claim stands as written.
[GPT-ADJUDICATED-FENCED] 0c94f4f04ac753d538d8412835f4a079fa991319

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0c94f4f04ac753d538d8412835f4a079fa991319: <one-sentence reason>

@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 12, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Quick fix on main test issues

@iamwhatever
iamwhatever merged commit 8ef30e2 into main Oct 12, 2026
92 of 100 checks passed
@iamwhatever
iamwhatever deleted the fix/spawn-effort-pendings-nameerror branch October 12, 2026 18:19
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn_run receipt raises NameError: effort_pendings not passed to _spawn_run_receipt

1 participant