fix(native-chat): keep the session host under its line limit (#29869)

#29121 and #27925 each added lines to structured-agent-session-host.ts and passed CI on their own; together they left it at 302 countable lines, so static analysis fails on main. Move the late-dispatch and unanswered-dispatch delegates into the mutation delegates that already wrap the same context.
This commit is contained in:
Brennan Benson
2026-10-16 16:16:32 -07:00
committed by GitHub
parent dd70294f0c
commit 39cf8703b7
2 changed files with 10 additions and 9 deletions
@@ -58,6 +58,8 @@ import {
type StructuredAgentSessionOptionsReader
} from './structured-agent-session-options-read'
import { writeStructuredAgentSessionOption } from './structured-agent-session-message-options'
import { settleStructuredAgentSessionLateDispatch } from './structured-agent-session-late-dispatch'
import { releaseStructuredAgentSessionUnansweredDispatches } from './structured-agent-session-unanswered-dispatch-release'
export function sendStructuredAgentSessionTurn(
context: StructuredAgentSessionMutationContext,
@@ -291,6 +293,11 @@ export function structuredAgentSessionMutationDelegates(
readOptions: (
sessionId: string,
reader: StructuredAgentSessionOptionsReader = IN_PROCESS_OPTIONS_READER
) => readStructuredAgentSessionOptions(context(), sessionId, reader)
) => readStructuredAgentSessionOptions(context(), sessionId, reader),
settleLateDispatch: (input: Parameters<typeof settleStructuredAgentSessionLateDispatch>[1]) =>
settleStructuredAgentSessionLateDispatch(context(), input),
releaseUnansweredDispatches: (
input: Parameters<typeof releaseStructuredAgentSessionUnansweredDispatches>[1]
) => releaseStructuredAgentSessionUnansweredDispatches(context(), input)
}
}
@@ -29,8 +29,6 @@ import {
structuredAgentSessionMutationDelegates,
type StructuredAgentSessionMutationContext
} from './structured-agent-session-host-mutations'
import { settleStructuredAgentSessionLateDispatch } from './structured-agent-session-late-dispatch'
import { releaseStructuredAgentSessionUnansweredDispatches } from './structured-agent-session-unanswered-dispatch-release'
import { flushStructuredAgentSessionHost } from './structured-agent-session-host-teardown'
import type {
StructuredAgentSessionCaller,
@@ -341,12 +339,8 @@ export class StructuredAgentSessionHost {
subscribe = (input: AgentSessionSubscribeInput) => this.backgroundTasks.subscribe(input)
settleLateDispatch = (input: Parameters<typeof settleStructuredAgentSessionLateDispatch>[1]) =>
settleStructuredAgentSessionLateDispatch(this.mutationContext(), input)
releaseUnansweredDispatches = (
input: Parameters<typeof releaseStructuredAgentSessionUnansweredDispatches>[1]
) => releaseStructuredAgentSessionUnansweredDispatches(this.mutationContext(), input)
settleLateDispatch = this.mutations.settleLateDispatch
releaseUnansweredDispatches = this.mutations.releaseUnansweredDispatches
publishChildWorkEvidence = this.clientDelivery.publishChildWork
unsubscribe = (sessionId: string, id: string): void => this.subscribers.close(sessionId, id)