File tree Expand file tree Collapse file tree
openspec/changes/harden-opencode-runtime-integration/specs/server-lifecycle Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Delta for Server Lifecycle
2+
3+ ## ADDED Requirements
4+
5+ ### Requirement: Long-running OpenCode processes use managed lifecycle semantics
6+
7+ The SDK MUST provide a managed process abstraction for long-running OpenCode launch modes instead of applying the ordinary short-command timeout.
8+
9+ #### Scenario: Web process remains alive
10+
11+ - GIVEN a caller starts OpenCode Web through the managed API
12+ - WHEN startup succeeds
13+ - THEN the process MUST remain alive beyond the short-command timeout
14+ - UNTIL the caller stops it, the process exits, or an explicit lifetime policy terminates it
15+
16+ ### Requirement: Readiness is distinct from process spawn
17+
18+ The SDK MUST expose readiness independently from successful process creation.
19+
20+ #### Scenario: Process starts but health endpoint is unavailable
21+
22+ - GIVEN the child process was spawned
23+ - AND the expected OpenCode HTTP endpoint does not become healthy before startup timeout
24+ - WHEN the caller awaits readiness
25+ - THEN readiness MUST fail
26+ - AND the process MUST be cleaned up according to the startup-failure policy
27+
28+ ### Requirement: Managed processes expose deterministic shutdown
29+
30+ The SDK MUST provide graceful stop and force-kill operations with observable exit completion.
31+
32+ #### Scenario: Graceful stop times out
33+
34+ - GIVEN a managed process does not exit after a graceful stop request
35+ - WHEN the graceful shutdown timeout elapses
36+ - THEN the caller MUST be able to force terminate the process
37+ - AND the final exit state MUST be observable
You can’t perform that action at this time.
0 commit comments