fix: Migrate planner, predictor, supervisor to SDK (#6) #17
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #6
Changes
AI Review
Summary
Migrates planner, predictor, and supervisor from the tmux/phase-file orchestration pattern to synchronous
claude -pviaagent-sdk.sh. Also refactors the gardener to use the newbuild_sdk_prompt_footerhelper and adds two reusable helpers toformula-session.sh.What was checked
build_sdk_prompt_footer(lib/formula-session.sh:299-304): Correctly setsPHASE_FILE="", delegates tobuild_prompt_footer, then strips the phase protocol block. The resulting## Environmentsection showsPHASE_FILE=(empty) which is cosmetic but harmless since the Phase protocol block itself is stripped.formula_worktree_setup(lib/formula-session.sh:311-319):cd ... || returncorrectly satisfies SC2164.git fetchhas|| trueso offline runs degrade gracefully. EXIT trap uses the SC2064 disable to expand$worktreeat trap-definition time — correct.git worktree add ... 2>/dev/null(lib/formula-session.sh:316): Stderr suppressed; if this fails,set -eaborts silently with no log entry. Minor debuggability concern, not a bug.agent_run(lib/agent-sdk.sh:51): The|| trueon the claude invocation means timeouts and crashes are swallowed silently (no session_id saved). Intentional fault-tolerance; scratch files are always deleted even after a failed run. Acceptable trade-off for SDK mode.FINAL_PHASE=PHASE:done; now unconditional. Correct for SDK mode — no phase signal exists to check.predictor-run.sh:68,supervisor-run.sh:78):export CLAUDE_MODELis set beforeagent_runin all three agents. Functionally fine.gardener-run.sh:95): Old:${PROMPT_FOOTER%%## Phase protocol*}## Completion protocol...; new:build_sdk_prompt_footer(strips) then append## Completion protocol. Semantically identical.SESSION_NAME,PHASE_FILE,PHASE_POLL_INTERVALremoved from all three agents. Clean.FORGE_TOKEN; no vault-only secrets in agent code.Findings
No blocking issues. One minor note:
lib/formula-session.sh:316:git worktree addstderr is suppressed with2>/dev/null. If this fails, the script exits viaset -ebut leaves no diagnostic in the log. Using2>>"$LOG_FILE"here (consistent with other error handling) would improve debuggability — nit only.Verdict
APPROVE — Clean, consistent migration of planner/predictor/supervisor from tmux+phase-file to SDK pattern; new helpers are correct and well-factored
Reviewed at
ab5f96d| AGENTS.mdAI Review: APPROVE — Clean, consistent migration of planner/predictor/supervisor from tmux+phase-file to SDK pattern; new helpers are correct and well-factored