From 651b513850594569249f47dac03eb929c0803de7 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Thu, 3 Sep 2026 09:09:42 +0000 Subject: [PATCH] fix(xce-build skill): dispatch builds via Bash run_in_background, not Agent subagent Replaces the "always dispatch via the Agent tool" instruction with a direct Bash-tool run_in_background pattern, following the harness's own task-notification mechanism instead of trusting a subagent's self-reported "I'll report back." Confirmed broken 2026-09-03: a general-purpose subagent given the exact "wait for it, do not background it" instruction redirected the build to a log file, announced it would report back once finished, and returned immediately with no result -- its own Agent-tool call showed completed with nothing to relay. The harness did eventually deliver a second, fuller notification for that same subagent several minutes later, but a controller cannot rely on that arriving, per the prior "fork claimed will report back, never reachable in a new session" incident already logged in .wolf/cerebrum.md. The new pattern (proven reliable twice this session: a full `all debug` build and a `controller` ASAN rebuild) runs the resolved command directly with Bash's own run_in_background, waits for the harness's real completion notification, then reads only the log's tail plus a targeted error grep -- keeping context usage low without depending on a subagent's compliance. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd --- .claude/skills/xce-build/SKILL.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.claude/skills/xce-build/SKILL.md b/.claude/skills/xce-build/SKILL.md index fba78ce5..9847083f 100644 --- a/.claude/skills/xce-build/SKILL.md +++ b/.claude/skills/xce-build/SKILL.md @@ -27,11 +27,21 @@ nix develop ./src --command bash src/tools/xce-build.sh [--incremental] \ + > /xce-build--.log 2>&1; \ + echo "EXIT_CODE=$?" >> /xce-build--.log +``` + +Call this once with `run_in_background: true` (substitute the resolved component/profile/build_dir and a scratchpad log path first — do not make anything downstream re-parse ARGUMENTS). Then stop and wait; do not poll, sleep-loop, or call `ScheduleWakeup` — the harness delivers a `` the moment the process exits, exactly like any other backgrounded Bash command. When it arrives, read the log's **tail** (e.g. `tail -30`) plus a targeted `grep -nE "error:|FAILED|undefined reference|Traceback"` rather than the whole log, to get the meson test Ok/Fail summary line and any failures without pulling the full (often thousands-of-lines) compiler output into context. Then `ls -la` the expected output binaries to confirm fresh mtimes, the same verification this skill has always asked for — just performed directly instead of trusted from a subagent's claim. + +This is deliberately not `context: fork` either — that frontmatter field reproducibly failed to thread a non-empty ARGUMENTS payload into a forked subagent (see above). Running the resolved command directly via `Bash`/`run_in_background` sidesteps both failure modes: there is no subagent in the loop to either drop the ARGUMENTS payload or silently background-and-return. ## Installing the xceadmin wheel elsewhere