singularity-forge/packages
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
..
agent-core sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00
ai sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00
coding-agent fix(swarm): surface worker tool call count to bypass parent-ledger guard 2026-05-15 05:46:17 +02:00
daemon sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00
google-gemini-cli-provider refactor(extensions): merge ttsr into guardrails 2026-05-15 02:28:40 +02:00
native build: switch full build pipeline to TypeScript 7 native (tsgo) 2026-05-10 11:58:58 +02:00
openai-codex-provider sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00
rpc-client feat(swarm): honor worker checkpoint outcomes 2026-05-15 04:59:15 +02:00
tui sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00