Four changes in one commit across 27 agent files:
1. POOL SUPERVISOR PROMPT_ASYNC: All 4 pool supervisors (issue-implementor,
ca-continuous-pr-reviewer, ca-uat-tester, ca-bug-hunter) now dispatch
their internal workers via the OpenCode Server's prompt_async endpoint
instead of the Task tool. This eliminates the wait_for_all bottleneck
at the supervisor level — workers run independently, and a 10-second
polling loop detects completions and immediately refills vacant slots.
Added curl/sleep bash permissions where needed. Each supervisor keeps
N workers running at all times with zero idle slots.
2. SESSION RESUME INSTEAD OF CLEANUP: The product-builder and all 4 pool
supervisors now RESUME existing sessions from a previous interrupted
run instead of aborting them. Phase C.0 queries the server for sessions
titled "[CA-AUTO] supervisor:*" and adopts any that are still active
into the monitoring loop. Pool supervisors similarly adopt existing
"[CA-AUTO] worker-*" sessions. This enables "continue where you left
off" — restarting the product-builder reconnects to running supervisors
and workers rather than duplicating them.
3. DEDICATED CLEANUP AGENT: New ca-session-cleanup.md primary agent for
explicit fresh-start cleanup. Run this BEFORE the product-builder when
you want to abort all previous sessions and start completely fresh. It
finds all "[CA-AUTO]" sessions, aborts them, and deletes them. This is
the ONLY way to kill old sessions — the product-builder never does it
automatically.
4. BOT SIGNATURES: All 26 agents that post content to Forgejo now include
a mandatory "Bot Signature" section requiring every comment, issue body,
PR description, and review to end with:
---
**Automated by CleverAgents Bot**
Supervisor: <category> | Agent: <agent-name>
24 agents have hardcoded categories. 2 shared agents (ca-new-issue-creator,
ca-epic-planner) use a parameter-based category from their caller's prompt.
Two fundamental architectural changes that solve the "supervisor exits and
never gets relaunched" problem:
1. PROMPT_ASYNC LAUNCH: The product-builder no longer uses the Task tool to
launch supervisors. The Task tool blocks until ALL parallel tasks return,
meaning if one supervisor exits, the product-builder can't relaunch it
until all 10 others also exit. Instead, supervisors are now launched via
the OpenCode Server HTTP API's POST /session/:id/prompt_async endpoint,
which returns 204 immediately (true fire-and-forget). The product-builder
then enters a bash-driven monitoring loop that checks session status
every 60 seconds via curl and relaunches any dead supervisor instantly
— independently of whether the other 10 are still running.
Requires: opencode started with --port 4096 (fixed known port).
Added curl and sleep to product-builder's bash allow list.
2. BASH SLEEP FOR GENUINE WAITING: All 11 supervisors now use the Bash
tool with "sleep N" (and explicit timeout > sleep duration) for real
blocking waits between polling cycles. Previously, pseudocode "wait N
minutes" was interpreted by the LLM as "I'm done, return to caller" —
causing supervisors to exit after their first idle cycle. The bash sleep
call genuinely blocks the agent for the specified duration, then the
agent resumes its loop. Every supervisor has a prominent instruction
block explaining this mechanism and warning against returning to caller.
All idle break/exit conditions removed across all 11 supervisors.
Supervisors now loop forever: poll Forgejo → do work → bash sleep → repeat.
Changes across 12 agent definitions:
- product-builder: Phase C.2 rewritten to use curl + prompt_async.
Phase C.3 rewritten as bash sleep + curl monitoring loop (checks every
60s, relaunches dead supervisors, checks convergence every 10 min).
Phase C.4 simplified to cleanup only.
- All 11 supervisors: Added "CRITICAL: Bash Sleep" instruction block.
Replaced all pseudocode "wait N" with bash("sleep N", timeout=N*1.5).
Removed all idle break/exit conditions — agents now sleep and re-poll
instead of exiting.
The product-builder was acting as a workflow orchestrator that ran
supervisors in sequential "rounds" (launch all → wait for ALL to finish →
check convergence → re-launch). This caused three problems:
1. Supervisors were treated as batch jobs, not services — they ran once
and exited, leaving gaps in coverage between rounds.
2. The product-builder blocked on wait_for_all(), meaning if one supervisor
ran for hours, all others were dead during that time.
3. Coordination flowed through the product-builder (passing data between
supervisors) instead of through Forgejo.
The new model treats the product-builder as a process supervisor (like
systemd). Its only jobs are: launch all 11 supervisors in a single
parallel batch, keep them alive (re-launch on exit), and periodically
check convergence by querying Forgejo. It never coordinates between
supervisors — they self-coordinate exclusively through Forgejo issues,
PRs, and comments.
Changes across 11 agent definitions:
- product-builder: Replaced Phase C.2/C.3 rounds loop with watchdog
loop (wait_for_any + re-launch). Added mandatory pre-flight checklist
and post-dispatch validation requiring all 11 supervisors. Removed
all "round" variables and batch-wait semantics.
- issue-implementor: Added 60-minute idle polling loop after queue
drains — polls Forgejo for new issues every 60s before exiting,
allowing it to pick up UAT bugs and human-created issues.
- ca-continuous-pr-reviewer: Increased idle exit from 50 polls (~25 min)
to 300 polls (~150 min).
- ca-backlog-groomer: Increased from 30 cycles/5 clean to 200 cycles/
20 clean before exit.
- ca-bug-hunter: Increased idle tolerance from 5 waits (~5 min) to 60
waits (~60 min).
- ca-uat-tester: Increased idle tolerance from 5 waits (~5 min) to 60
waits (~60 min).
- ca-architecture-guard, ca-spec-updater, ca-docs-writer,
ca-timeline-updater: Converted from one-shot agents to continuous
services with monitoring loops that re-check for new code/changes
at 10-30 minute intervals and exit after 100-300 minutes idle.
- ca-agent-evolver: Clarified idle exit timing (~150 min).