pub struct OrchestratorServer { /* private fields */ }Expand description
Shared state wrapping the managed OpenCode server and HTTP client.
Implementations§
Source§impl OrchestratorServer
impl OrchestratorServer
Sourcepub async fn start() -> Result<Arc<Self>>
pub async fn start() -> Result<Arc<Self>>
Start a new managed OpenCode server and build the client.
This is the eager initialization path that spawns the server immediately.
Prefer start_lazy() for deferred initialization.
§Errors
Returns an error if the server fails to start or the client cannot be built.
Sourcepub async fn start_lazy() -> Result<Self>
pub async fn start_lazy() -> Result<Self>
Lazy initialization path for OnceCell usage.
Checks the recursion guard env var first, then uses retry logic.
Returns Self (not Arc<Self>) for direct storage in OnceCell.
§Errors
Returns the guard message if OPENCODE_ORCHESTRATOR_MANAGED is set.
Returns an error if the server fails to start after 2 attempts.
Sourcepub fn context_limit(&self, provider_id: &str, model_id: &str) -> Option<u64>
pub fn context_limit(&self, provider_id: &str, model_id: &str) -> Option<u64>
Look up context limit for a specific model.
Sourcepub fn session_deadline(&self) -> Duration
pub fn session_deadline(&self) -> Duration
Get the session deadline duration.
Sourcepub fn inactivity_timeout(&self) -> Duration
pub fn inactivity_timeout(&self) -> Duration
Get the inactivity timeout duration.
Sourcepub fn compaction_threshold(&self) -> f64
pub fn compaction_threshold(&self) -> f64
Get the compaction threshold (0.0 - 1.0).
Sourcepub fn extract_assistant_text(messages: &[Message]) -> Option<String>
pub fn extract_assistant_text(messages: &[Message]) -> Option<String>
Extract text content from the last assistant message.