feat(provider): OpenCodeNursedProvider for full process lifecycle management#366
Open
aaronwong1989 wants to merge 5 commits intohrygo:mainfrom
Open
feat(provider): OpenCodeNursedProvider for full process lifecycle management#366aaronwong1989 wants to merge 5 commits intohrygo:mainfrom
aaronwong1989 wants to merge 5 commits intohrygo:mainfrom
Conversation
added 5 commits
March 29, 2026 11:15
…gement (Refs hrygo#358) Implements complete process management for opencode serve with: - ProcessGuardian: Process lifecycle management with exponential backoff restart - HTTPSessionManager: Deterministic UUID v5 session mapping with server-side recovery - EventRelay: SSE event subscription, filtering, and routing - OpenCodeNursedProvider: Provider interface combining all components New OpenCodeConfig fields: - BinaryPath: Path to opencode binary for managed mode - ServeArgs: Additional arguments for serve command - WorkDirTemplate: Template for session workdir resolution - HealthCheckInterval: Health check interval (default 10s) - StartupTimeout: Process startup timeout (default 60s) - RestartBackoff: Custom backoff intervals - MaxFailBurst: Max consecutive failures before dead state (default 1000)
…Provider P1-1: Connect OpenCodeConfig fields to ProcessGuardian - Parse HealthCheckInterval, StartupTimeout, RestartBackoff, MaxFailBurst - Add GuardianConfig struct and NewProcessGuardianWithConfig - Use DefaultGuardianConfig() for defaults P1-2: Fix Plugin type conflict - Comment out OpenCodeServerProvider init() registration - OpenCodeNursedProvider now the sole ProviderTypeOpenCodeServer plugin P1-3: Implement session recovery stubs - HTTPSessionManager: add baseURL and password fields - ListSessions: implement GET /session API call - findSessionByTitle: iterate sessions to find matching title - RecoverMappings: restore in-memory map from server sessions - Add OCSession.Status field for status tracking P2-4: Fix handleUnhealthy lock management - Remove confusing defer/unlock mix - Restructure to clear lock boundaries - Remove unused recordFailure method P2-5: Eliminate mapEvent/mapPart duplication - Expose EventRelay.MapEvent public method - OpenCodeNursedProvider.ParseEvent delegates to relay.MapEvent P2-6: Use tool status constants - Replace string literals with ToolStatusPending, ToolStatusRunning, etc. - Update both opencode_nursed.go and opencode_relay.go
…stream API change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
实现 OpenCodeNursedProvider,完全纳管 opencode serve 进程生命周期。
Components
Key Features
Config Fields (OpenCodeConfig)
Review Fixes Applied
Refs #358