Decide the thread lifecycle for resume: clean-exit revoke versus reopenable threads #209
- AtlantisPleb opened this issue 2d ago
-
A Author 2d ago Decided and implemented in eb8ea8f: option 1, stop revoking on clean exit. A thread is durable, so --resume works by construction and anything that touches a thread again — a delegated child still running, a second window, a resumed session — is no longer told it was revoked.
The quota interaction the issue flagged was resolved by removing the cap rather than raising it: with threads durable, a count of open threads is a count of every session the account has ever run, so maximum_open_threads_per_account is now unbounded and what bounds an account is its credit — the same answer as the grant ceilings and the grant clock. Terminal stays honest.
- closed this as completed 2d ago
Problem
The resume work (OpenAgentsInc/openagents#24) exposed a lifecycle tension: the CLI revokes its thread on clean exit (
DELETE→cancelled), and a terminal thread refuses both new events and re-minting (POST /api/v3/threads/{id}/grants, THREAD-001). So today--resumecan only continue sessions that crashed or ran on another machine — a cleanly exited session is unresumable by design.Options
/donegesture that finishes the thread with a report.cancelled → openbefore re-minting. Cost: "terminal" stops meaning terminal; THREAD-001's fence semantics and the transcript-closed refusal both weaken.Option 1 with an idle-expiry sweep looks strongest — it keeps terminal honest and matches how Codex-style resume behaves — but the quota interaction needs a decision.
Related
The transcript is already durable either way; this decision is only about who may keep writing.