|
|
há 2 meses atrás | |
|---|---|---|
| .. | ||
| src | há 2 meses atrás | |
| tests | há 2 meses atrás | |
| README.md | há 2 meses atrás | |
| package.json | há 2 meses atrás | |
| tsconfig.json | há 2 meses atrás | |
The continuable-subagent control service (ctx.subagentControl): the one orchestration path that binds a durable child session to a series of disposable Task-backed activations. Model tools and human-facing adapters call the same contract; the low-level ctx.subagents seam stays collection-, Task-, and persistence-agnostic.
A continuable background subagent is a durable child session with a series of Task-backed activations. startContinuable() allocates the stable child session id before Task creation, snapshots the descriptor inputs (a non-JSON input throws with no Task), and registers the initial activation's Task; the provider publishes exactly that child id and appends the versioned subagent/descriptor event inside the child's first turn. Every activation — initial or resumed — creates a fresh Task whose settlement awaits the child result, disposes the run, and only then records the TaskOutcome: a terminal Task leaves the durable child session but no live child Agent.
sendMessage(parent, childId, message) owns steer-or-resume routing. A running activation receives live delivery through the run's strict steer capability and returns the existing Task id (steered); an absent activation starts a fresh Task that loads the persisted child, authorizes the recorded parentSession as the direct parent, folds the descriptor, and dispatches SubagentService.resume() (started). Failure throws and means the message was not delivered: losing a strict-steering race with Task settlement never falls through to cold resume within the same call, and a live registry Agent outside the activation association is an ownership conflict rather than an adoption target.
Cancellation targets the whole activation. task_kill or owner disposal aborts the Task-owned signal; before publication the provider rejects only after its creation transaction rolled back to quiescence, afterwards the signal cancels the published run, and settlement records killed only once the activation is quiescent. Human input shares this path: an adapter submits child input through sendMessage() under the loaded parent, so parent and human messages that joined one turn share its result and cancellation outcome, and TaskService.start()'s control-surface requirement applies (load @deepseek-ai/dsh-tool-tasks or attach a surface).
The activation association is process-local routing state, installed before any persistence or provider await and removed after run disposal and Task terminal publication. It is not a durable catalog: restart recovers the child session, not in-flight Tasks or their notifications.
None directly, as this package registers no tool and no prompt text; the model observes continuable children through @deepseek-ai/dsh-tool-subagent's background acknowledgement, @deepseek-ai/dsh-tool-subagent-control's send_message results, and the generic task surface, whose outputs this service produces.
None beyond the consuming tools' own results.
None; this service appends nothing to any model-visible sequence.
AcpProvider.resume and per-child continuation advertisement are deferred until the remote-session descriptor contract is resolved.