fix: bug: architect-run.sh empty pitch — pitch_output=$(agent_run …) captures stdout but new agent_run writes to side-channels (#716)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Three fixes:

1. architect-run.sh:722 — extract `.result` not `.content` from claude JSON
   output. All other callers (dev-agent, formula-session) use `.result`;
   this was the direct cause of every pitch being empty.

2. lib/agent-sdk.sh — reset `_AGENT_LAST_OUTPUT=""` at the top of each
   `agent_run` call so stale data from a prior invocation can't bleed
   into the next caller when claude crashes or returns empty.

3. lib/agent-sdk.sh — scope the diagnostics file by `$LOG_AGENT` instead
   of hardcoding `dev/`. Concurrent agents (architect, gardener, planner,
   predictor) no longer clobber each other's diag output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-12 00:04:42 +00:00
parent a1da3d5c52
commit cb9381f1e4
2 changed files with 6 additions and 2 deletions

View file

@ -719,7 +719,7 @@ ${pitch_context}
# Extract pitch content from JSON response
local pitch
pitch=$(printf '%s' "$_AGENT_LAST_OUTPUT" | jq -r '.content // empty' 2>/dev/null) || pitch=""
pitch=$(printf '%s' "$_AGENT_LAST_OUTPUT" | jq -r '.result // empty' 2>/dev/null) || pitch=""
if [ -z "$pitch" ]; then
log "WARNING: empty pitch generated for vision issue #${issue_num}"