Expand description
Compatibility path for native background-job state.
Structs§
- Captured
Output - Bounded, incrementally-appended output capture shared (via
Arc) between a job’s stdout/stderr reader tasks and whatever later polls it (background_status/background_list). Thread-safe; every method is fail-soft on a poisoned lock (treats it as “temporarily unavailable”, the same posturecrate::permissions::approval::ApprovalCachealready documents for itself) rather than panicking a reader task or a tool call.
Enums§
- JobStatus
- A background job’s run state, as observed by
background_status/background_list.
Constants§
- DEFAULT_
MAX_ CONCURRENT - P5-6 (resource bound, mirroring
crate::subagents’s “max concurrent… cap, fail-closed… configurable” precedent): the default maximum number of background jobs this agent may have in flight at once. - DEFAULT_
MAX_ OUTPUT_ BYTES - P5-6 (build brief “cap the buffer like P5-2’s 16MiB caps”): the default
per-job bounded-capture ceiling, matching
crate::mcp::MCP_MAX_RESPONSE_BYTES’s hardening precedent — generous for real command output while bounding how much memory one background job (let alonemax_concurrentof them at once) can force this process to hold.
Functions§
- next_
job_ id - A fresh, process-unique background job id (
"bg-<hex-ts>-<hex-seq>"), given the caller’s own millisecond timestamp (kept as a parameter rather than reading the clock in here, so this stays a pure function for the unit tests below).