From daf955480416b5c4667ea7b3ff5461d6be162bff Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Sun, 2 Aug 2026 12:55:10 +0800 Subject: [PATCH] refactor(subagent): scope the setup transaction to the creation callback The setup validation and commit moved into the callback, so the outer definite-assignment slot and its type import are no longer needed; declare the transaction as a callback-local const. --- packages/subagent/subagent/src/continuation.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/subagent/subagent/src/continuation.ts b/packages/subagent/subagent/src/continuation.ts index bc4833bbd0..82f66d08cb 100644 --- a/packages/subagent/subagent/src/continuation.ts +++ b/packages/subagent/subagent/src/continuation.ts @@ -42,7 +42,6 @@ import type { ContinuableCreateRequest, ContinuableCreateSpec, SubagentStartRequ import type { ActivationObserver } from './lifecycle.ts' import { SubagentError } from './error.ts' import type SubagentActivationSetupRegistry from './activation-setup-registry.ts' -import type { ActivationSetupTransaction } from './activation-setup-registry.ts' /** Attribution for a model coordinator's follow-up to one of its children. */ export interface CoordinatorMessageSource { @@ -800,10 +799,9 @@ export class SubagentContinuationManager { // `AgentRegistry.enter()` is the authoritative collision boundary for an id // some other owner holds — a duplicate would reject there with rollback. inputs.signal.throwIfAborted() - let setupTransaction!: ActivationSetupTransaction const setup = (childCtx: Context): void => { applyChildComposition(childCtx, inputs.composition) - setupTransaction = this.setupRegistry.apply(childCtx) + const setupTransaction = this.setupRegistry.apply(childCtx) // Validate and freeze the batch inside the creation callback, before the // factory can publish the session: a revoked contribution must reject // the create/resume call pre-publication, so no persisted session is