singularity-forge/packages/coding-agent/src
Mikael Hugo dbfaca61cf
Some checks are pending
CI / detect-changes (push) Waiting to run
CI / docs-check (push) Blocked by required conditions
CI / lint (push) Blocked by required conditions
CI / build (push) Blocked by required conditions
CI / integration-tests (push) Blocked by required conditions
CI / windows-portability (push) Blocked by required conditions
CI / rtk-portability (linux, blacksmith-4vcpu-ubuntu-2404) (push) Blocked by required conditions
CI / rtk-portability (macos, macos-15) (push) Blocked by required conditions
CI / rtk-portability (windows, blacksmith-4vcpu-windows-2025) (push) Blocked by required conditions
fix(swarm): surface worker tool call count to bypass parent-ledger guard
Round 7 dogfood failed with "0 tool calls — context exhaustion" even
though the swarm worker's session DID call tools. Root cause: the
phases-unit.js zero-tool-call guard reads from the PARENT session's
message ledger via snapshotUnitMetrics. The swarm worker runs in an
ISOLATED subagent session — its tool calls never appear in the
parent's messages, so the guard always sees 0 and fires a false-
positive context-exhaustion retry.

Fix:
- runUnitViaSwarm now returns swarmToolCallCount on the UnitResult,
  surfacing the real worker tool call count from the onEvent stream
  (collectedToolCalls.length, accurate end-to-end).
- phases-unit.js zero-tool-call guard checks
  unitResult._via === "swarm" && swarmToolCallCount > 0 and bypasses
  the false-positive retry, logging "zero-tool-calls-swarm-bypass".

Also adds a debug stderr line in subagent-runner.ts printing the tool
count after bindExtensions, confirming the worker session HAS the
full tool set (checkpoint + built-ins) — Hypotheses 1 and 2 from the
Round 8 brief ruled out by direct observation.

Tests: 3 new (swarmToolCallCount = 0 / N / 1-on-checkpoint-only);
2518 tests pass total, 0 regressions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 05:46:17 +02:00
..
cli sf snapshot: uncommitted changes after 197m inactivity 2026-05-10 15:59:33 +02:00
core fix(swarm): surface worker tool call count to bypass parent-ledger guard 2026-05-15 05:46:17 +02:00
modes feat(swarm): event streaming + outcome derivation for runUnitViaSwarm 2026-05-15 04:54:58 +02:00
resources/extensions/memory fix(lint): fix all pre-existing lint failures 2026-05-11 04:02:31 +02:00
tests feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00
types feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00
utils fix(lint): fix all pre-existing lint failures 2026-05-11 04:02:31 +02:00
cli.ts refactor: strip internal pi branding (Phase 2A) 2026-05-10 11:50:55 +02:00
config.ts feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00
index.ts feat(subagent): event streaming for in-process runSubagent 2026-05-15 04:04:52 +02:00
main.ts feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00
migrations.ts feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00