fix(subagent): preserve published run failures

This commit is contained in:
Dudu-0223
2026-08-02 12:51:09 +08:00
committed by Tianyi Cui
parent 8b0a7a5d8d
commit a977ef30ee
57 files changed
+444 -208

No files matched your search

@@ -56,7 +56,7 @@ export enum HostToWorkerType {
Go = 'go',
/** Cancel the run: hooks start throwing and the script dies at its next await. */
Cancel = 'cancel',
/** Child RPC reply: the provider fulfilled with a ready run (exactly one start reply per ChildStart). */
/** Child RPC reply: the provider fulfilled with a published run (exactly one start reply per ChildStart). */
ChildStarted = 'child-started',
/** Child RPC reply: the provider's asynchronous start failed. */
ChildStartError = 'child-start-error',
@@ -89,7 +89,7 @@ class ChildRpcBridge implements ChildPort {
return new RpcChildHandle(this.post, callId, entry, childId)
}
/** The host established a ready child; releases the `startAgent` await. */
/** The host established a published child; releases the `startAgent` await. */
onChildStarted(callId: number, childId: string): void {
this.pending.get(callId)?.started.resolve(childId)
}
@@ -87,7 +87,7 @@ export interface ChildPort {
/**
* Start one child agent on the host (the `agent()` hook's start half).
* @param request - the prompt and validated options.
* @returns the ready child handle; rejects when synchronous start or the
* @returns the published child handle; rejects when synchronous start or the
* provider's asynchronous start fails.
*/
startAgent(request: ChildStartRequest): Promise<ChildHandle>