disinto/gardener/pending-actions.json
Claude eb3327d2c9
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
chore: gardener housekeeping 2026-04-11
2026-04-11 20:45:04 +00:00

22 lines
6.8 KiB
JSON

[
{
"action": "edit_body",
"issue": 690,
"body": "## Symptom\n\nEvery architect run since the polling-loop hotfix at 2026-04-11 19:35 UTC has fired correctly but produced **0 sprint pitches**. From `/home/agent/data/logs/architect/architect.log` for the 20:23 run:\n\n```\n[2026-04-11T20:23:27Z] architect: Generating pitch for vision issue #623\n[2026-04-11T20:23:27Z] architect: agent_run: starting (resume=(new), dir=/home/agent/repos/disinto)\nError: Input must be provided either through stdin or as a prompt argument when using --print\n[2026-04-11T20:23:29Z] architect: agent_run: empty output (claude may have crashed or failed, exit code: 0)\n[2026-04-11T20:23:29Z] architect: WARNING: empty pitch generated for vision issue #623\n[2026-04-11T20:23:29Z] architect: WARNING: failed to generate pitch for vision issue #623\n...\n[2026-04-11T20:23:31Z] architect: Generated 0 sprint pitch(es)\n```\n\n3 vision issues processed (#647, #623, #557), all failed identically. The wrapper still exits 0 and writes a journal entry, so the polling loop thinks it's healthy — but no architect work is actually happening.\n\n## Root cause\n\n`architect/architect-run.sh:519` calls `agent_run` with the **old positional-after-flags** signature:\n\n```bash\npitch_output=$(agent_run -p \"$pitch_prompt\" --output-format json --dangerously-skip-permissions --max-turns 200 ${CLAUDE_MODEL:+--model \"$CLAUDE_MODEL\"} 2>>\"$LOGFILE\") || true\n```\n\nBut `lib/agent-sdk.sh:123-156` was rewritten so `agent_run` now adds `-p`, `--output-format`, `--max-turns`, `--dangerously-skip-permissions`, and `--model` *itself*, and expects only `[--resume X] [--worktree Y] PROMPT`:\n\n```bash\nagent_run() {\n local resume_id=\"\" worktree_dir=\"\"\n while [[ \"${1:-}\" == --* ]]; do\n case \"$1\" in\n --resume) shift; resume_id=\"${1:-}\"; shift ;;\n --worktree) shift; worktree_dir=\"${1:-}\"; shift ;;\n *) shift ;;\n esac\n done\n local prompt=\"${1:-}\"\n\n local -a args=(-p \"$prompt\" --output-format json --dangerously-skip-permissions --max-turns 200)\n ...\n}\n```\n\nWhen architect calls `agent_run -p \"$pitch_prompt\" --output-format json …`:\n\n- `$1` = `-p` (does NOT match `--*` — pattern requires two dashes), so the option-stripping loop exits immediately\n- `local prompt=\"${1:-}\"` → `prompt=\"-p\"`\n- `args=(-p \"-p\" --output-format json …)` is passed to `claude`\n- `claude` sees `-p` repeated and effectively no prompt → `Error: Input must be provided either through stdin or as a prompt argument when using --print`\n\nThe bug has been latent since `agent_run` was rewritten. It only became visible today because before the cadence change to `ARCHITECT_INTERVAL=540`, architect ran every 6h and most operators didn't notice the empty output. With the new ~45-min cadence (9-iteration aliasing of 540s against 300s POLL_INTERVAL), the failure became obvious within an hour.\n\n`dev-agent.sh:894` already uses the correct new signature for comparison:\n\n```bash\nagent_run \"${RESUME_ARGS[@]}\" --worktree \"$WORKTREE\" \"$PROMPT_FOR_MODE\"\n```\n\n## Fix\n\nChange `architect/architect-run.sh:519` from:\n\n```bash\npitch_output=$(agent_run -p \"$pitch_prompt\" --output-format json --dangerously-skip-permissions --max-turns 200 ${CLAUDE_MODEL:+--model \"$CLAUDE_MODEL\"} 2>>\"$LOGFILE\") || true\n```\n\nto:\n\n```bash\npitch_output=$(agent_run \"$pitch_prompt\" 2>>\"$LOGFILE\") || true\n```\n\n`agent_run` already injects `--output-format json`, `--dangerously-skip-permissions`, `--max-turns 200`, and `--model \"$CLAUDE_MODEL\"` via its internal `args` array, so they don't need to be passed at the call site.\n\nSearch the rest of the tree for the same anti-pattern — likely candidates: `gardener/gardener-run.sh`, `planner/planner-run.sh`, `predictor/predictor-run.sh`, `vault/`, `supervisor/`. Any `agent_run -p …` callsites should be updated.\n\n```sh\ngrep -rn 'agent_run -p\\|agent_run --output-format' .\n```\n\n## Bonus bug\n\nThe architect wrapper's exit-status handling is wrong. Even with all pitches empty, `architect-run.sh` still exits 0 and writes a journal entry. It should at minimum:\n- Log a top-level WARNING / fail the run when `Generated 0 sprint pitch(es)` happens *and* there were vision issues to process\n- Propagate non-zero exit so the polling loop's eventual health checks can detect it\n\nThat's a smaller follow-up but worth filing separately if confirmed in the other slow agents too (planner runs in ~5 min, gardener in ~10 min — we'll see if they hit the same `--print` bug).\n\n## Impact\n\nArchitect has been silently producing no output since the `agent_run` rewrite — possibly weeks. Vision issues have not been getting pitches generated, so the planner has nothing to schedule from the architect's side, so the dev-poll backlog never gets refreshed from the vision pipeline. The factory's \"self-development\" loop has been broken at the architect → planner handoff for an unknown amount of time.\n\n## Verification after fix\n\nAfter the one-line change merges and is deployed:\n\n```sh\ndocker exec disinto-agents bash -c \"cd /home/agent/repos/_factory && DISINTO_AGENTS=architect bash architect/architect-run.sh projects/disinto.toml\"\ntail -50 /home/agent/data/logs/architect/architect.log\n```\n\nExpect: at least one `Generated N sprint pitch(es)` with N > 0, no `Error: Input must be provided` lines, and a non-empty `pitch_output` JSON for at least one vision issue.\n\n## Files\n\n- `architect/architect-run.sh` — line 519, the broken call\n- (search) other slow agents likely affected by the same drift\n\n## Acceptance criteria\n- [ ] `architect/architect-run.sh` call to `agent_run` updated to new signature (prompt-only, no flags)\n- [ ] All `agent_run -p …` / `agent_run --output-format` call sites in the repo found and updated\n- [ ] Architect produces at least one sprint pitch when vision issues are open\n- [ ] CI green\n\n## Affected files\n- `architect/architect-run.sh` — line ~519, broken `agent_run` call site\n- `gardener/gardener-run.sh` — possible same drift\n- `planner/planner-run.sh` — possible same drift\n- `predictor/predictor-run.sh` — possible same drift\n- `supervisor/supervisor-run.sh` — possible same drift\n"
},
{
"action": "remove_label",
"issue": 647,
"label": "backlog"
},
{
"action": "add_label",
"issue": 647,
"label": "vision"
},
{
"action": "comment",
"issue": 647,
"body": "Quality gate: stripped `backlog` label — this issue is missing required backlog sections (`## Acceptance criteria` with checkboxes and `## Affected files`). The body also explicitly states this is a vision issue, not backlog. Relabeled as `vision`. When the work is ready for implementation, please use the issue templates at `.forgejo/ISSUE_TEMPLATE/` to add the required sections before re-adding `backlog`."
}
]