Skip to content

feat: retain Claude and OpenCode processes with bounded recovery - #20

Draft
dviejokfs wants to merge 3 commits into
feat/codex-process-retentionfrom
feat/provider-process-retention
Draft

dviejokfs wants to merge 3 commits into
feat/codex-process-retentionfrom
feat/provider-process-retention

Conversation

@dviejokfs

Copy link
Copy Markdown
Contributor

Adds opt-in process retention for Claude stream-json and OpenCode serve, sharing a bounded pool with Codex. Existing process-per-turn behavior and the Codex-only API remain unchanged by default.

Healthy follow-up turns reuse the native process. Dead or frozen idle processes are replaced before prompt submission; failures after possible submission are surfaced without automatically replaying user work. Configuration changes replace the process and resume the saved session. Startup and active inactivity deadlines, idle expiry, process cleanup, and typed readiness events are included.

Stacked on #19; this PR contains the incremental Claude/OpenCode changes.

Evidence

SDK final commit: 1946393

cargo test --all-features
339 passed, 1 ignored (9 suites)
cargo clippy --all-targets --all-features -- -D warnings
No issues found
cargo check --no-default-features
passed

Native-process Claude fixtures and loopback OpenCode fixtures cover same-process reuse, killed/frozen idle children, active crash/stall, initialization stalls, idle expiry, policy replacement, and pre-prompt session lookup failures. The OpenCode close/error regression verifies exactly two prompt POSTs across two successful turns and a replacement.

Live Fleet Dev tests used API 7088 through Vite 5188, a separate development data directory, and disposable no-tools workspaces:

  • Claude warm turn reused PID50918: first text1.793s versus3.511s baseline sample.
  • OpenCode warm turn reused PID51463: first text0.945s versus9.606s baseline sample.
  • Both providers recovered after idle kill/freeze while preserving the original session and marker.
  • Active kill produced an explicit failure without replay; the next explicit message succeeded.
  • Permission changes replaced processes.
  • Disabling retention restored per-turn processes and preserved conversation continuation.
  • Browser composer continuation and isolated native desktop attachment were verified.

Timing samples include model latency and are not percentile benchmarks. The installed stable Fleet service was not restarted. Final lifecycle review has no blocking findings.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant