mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 05:26:47 +03:00
docs(core): clarify subagent settlement lifecycle
This commit is contained in:
@@ -55,8 +55,8 @@ export const outstanding = Effect.fnUntraced(function* (
|
||||
|
||||
/**
|
||||
* Whether an idle Session will be woken again by its own work: a background job of its own or a
|
||||
* descendant's still running, or admitted input not yet delivered, such as a finished shell's
|
||||
* notice. A subagent's report waits for this so it carries the child's final state.
|
||||
* descendant's still running, completion notices awaiting admission, or admitted input not yet
|
||||
* delivered. A subagent's report waits for this so it carries the child's final state.
|
||||
*/
|
||||
export const unsettled = Effect.fnUntraced(function* (
|
||||
jobs: Pick<Job.Interface, "runningBackground" | "pendingBackground">,
|
||||
|
||||
@@ -58,8 +58,8 @@ const make: Effect.Effect<
|
||||
}).pipe(Effect.catchTag("Session.NotFoundError", () => Effect.void))
|
||||
})
|
||||
|
||||
// Waits until the child stops for good: idle, with no background work or undelivered input left
|
||||
// to wake it. It only waits and never resumes, since resuming an idle child runs a model step.
|
||||
// Resume once for launch, then wait until the child is idle with no background work or input
|
||||
// left. Never resume just to inspect settlement: resuming an idle child runs another model step.
|
||||
const settle = Effect.fnUntraced(function* (sessionID: SessionSchema.ID) {
|
||||
const outcomes = [
|
||||
SessionEvent.Execution.Succeeded,
|
||||
|
||||
Reference in New Issue
Block a user