Merge branch 'codex/simp-hide-concrete-agent-loop' into codex/simp-hide-subagent-internals

This commit is contained in:
Tianyi Cui
2026-07-14 09:29:12 +08:00
2 changed files with 2 additions and 1 deletions

View File

@@ -457,7 +457,7 @@ export function apply(ctx: Context): void {
)
} catch (error: unknown) {
// The ONE expected failure: the agent was disposed between task
// completion and this injection (ReactLoopAgent.inject throws
// completion and this injection (Agent.inject throws
// `agent "<id>" is disposed`). That race is benign — drop the notice.
// Anything else is a real bug and must surface, not be swallowed.
if (error instanceof Error && error.message.includes('is disposed')) return

View File

@@ -62,6 +62,7 @@ interface SessionRecord {
/** Recover the delegating parent carried by every service-owned subagent lifecycle event. */
function subagentParentOf(carrier: Scoped<SubagentService>): Agent {
// SubagentService emits this lifecycle pair only through scopeTarget(this, parent).
return carrierKeyOf(carrier) as Agent
}