disinto/gardener/pending-actions.json

23 lines
6.8 KiB
JSON
Raw Normal View History

[
{
"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 journa
},
{
"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`."
}
]