Repository navigation
Description
Architect Terminal Broken on Windows
Context
Codev uses a multi-agent workflow: an architect coordinates the work (writes specs, reviews plans, spawns builders, handles PR integration), and builders implement the code in isolated worktrees. The architect is the central orchestrator — without it, the entire SPIR/ASPIR/AIR flow breaks down.
When we tried to run a full SPIR protocol flow on Windows, the architect terminal crashed repeatedly and never stayed alive. This blocked the entire workflow — the builder was stuck waiting for the architect to relay gate approvals, and no plan review or PR coordination could happen.
Environment
- OS: Windows 11 (build 22631)
- Node: v22.23.3
- npm: 10.9.9
- pnpm: 10.33.0
- codev: 3.3.8 (global npm install)
- Shell: Git Bash (for builder scripts), PowerShell (for Tower)
- Tower: v3.3.8
Steps to Reproduce
- Install codev globally:
npm install -g @cluesmith/codev - Set up a project with codev:
codev init my-project --yes - Configure the architect to use opencode (or claude):
// .codev/config.json { "shell": { "architect": "opencode run", "architectHarness": "opencode-architect" } }
- Start the workspace:
afx workspace start - Open the Tower dashboard:
http://localhost:4100 - Observe the architect terminal tab
Expected Behavior
The architect terminal should start and stay running, showing the opencode/claude TUI. The architect should be available to receive mail from builders, relay gate approvals, and coordinate the workflow.
Actual Behavior
The architect terminal crashes immediately and enters a restart loop (up to 50 retries). The Tower log shows:
Session <id> exited (code=1)
Session <id> auto-restart #1/50 in 2000ms
Session <id> exited (code=1)
Session <id> auto-restart #2/50 in 2000ms
...
Session <id> exhausted max restarts (50); giving up
After 50 retries, the architect is permanently dead. The builder is left waiting for an architect that will never respond.
Root Cause
There are three compounding issues that make the architect impossible to run on Windows:
1. Claude CLI not authenticated
The default architect command is claude. On a fresh Windows install, claude isn't logged in:
claude --print "hi" → "Not logged in · Please run /login"
The architect crashes immediately.
2. opencode TUI freezes in Tower PTY
When configured to use opencode instead, the TUI mode (opencode) freezes when launched through the Tower's PTY. The Tower uses ConPTY (Windows Pseudo Console) via node-pty, but opencode's TUI doesn't recognize ConPTY as a real interactive terminal. The process hangs at the start screen, never rendering, never responding.
3. opencode run exits after one response
The non-interactive mode (opencode run) works (doesn't freeze), but it exits after processing one prompt. The architect needs to be long-running — it must stay alive to receive mail, respond to gate approvals, and coordinate builders. A one-shot command can't do that.
Summary: claude isn't authenticated, opencode TUI freezes in the PTY, and opencode run isn't long-running. There is no working architect harness on Windows.
Possible Fix
Option A: Architect loop mode (most practical)
Wrap opencode run in a loop that processes mail between runs:
while true; do
opencode run < /path/to/architect-prompt.txt
# Process any pending mail
afx inbox --process
sleep 2
doneThis isn't ideal (the architect exits between runs), but it works around the PTY freeze.
Option B: Fix the Tower PTY to provide a real TTY
Deep node-pty/ConPTY fix so claude/opencode TUI recognizes it as interactive. This is complex and uncertain.
Option C: Authenticate claude + fix PTY
Run claude /login to authenticate, then fix the PTY freeze. Still requires the PTY fix.
Evidence
Tower log (architect crash loop)
[INFO] Session 19e23568 exited (code=1)
[INFO] Session 19e23568 auto-restart #1/50 in 2000ms
...
[ERROR] Shellper session 19e23568: Max restarts (50) exceeded
claude not authenticated
$ claude --print "hi"
Not logged in · Please run /login
opencode TUI freeze
- opencode process alive (PID 67440), responding to OS signals
- CPU stays idle (6.5s after 60s — no active generation)
- 0 requests reach the proxy (localhost:8000)
- Process never exits, never renders
opencode run exits
$ echo "hi" | opencode run
> build · baidu/ernie-5.5-flash-preview:free
Hi! How can I help you today?
# exits immediately
Impact
- Blocks all SPIR/ASPIR/AIR flows — the builder can't proceed without the architect
- No plan review — the architect does 3-way plan reviews
- No gate relay — the architect relays human approvals to the builder
- No PR coordination — the architect handles integration review and merge
Related
- Finding [Spec 0013] Document OS dependencies and add codev-doctor #32 in the Windows findings artifact
- Blocks findings Why doesn't the protocol have any code? #24-27 (builder PTY freeze) — same root cause, different fix needed
Activity