Skip to content

Windows: architect terminal crashes and never stays alive (claude unauthenticated, opencode TUI freezes in ConPTY) #2009

Backlog

Description

@OdyAsh

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

  1. Install codev globally: npm install -g @cluesmith/codev
  2. Set up a project with codev: codev init my-project --yes
  3. Configure the architect to use opencode (or claude):
    // .codev/config.json
    { "shell": { "architect": "opencode run", "architectHarness": "opencode-architect" } }
  4. Start the workspace: afx workspace start
  5. Open the Tower dashboard: http://localhost:4100
  6. 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
done

This 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions