SIGINT mid-stream handling
Overview
The whitelist and source excerpts provided do not contain a SIGINT handler, abort-controller wiring for the in-flight request, tool cancellation path, session persistence on interrupt, or an analytics flush-before-exit routine that can be cited .
Steps
- The closest signal-adjacent surfaces in scope are
withRetry, which throwsAPIUserAbortErrorwhen itsoptions.signalis already aborted at the top of each attempt, andqueryModel, which receives anAbortSignalparameter threaded from the caller . Neither function shows where SIGINT is bound to that signal, nor a cleanup chain . runHeadlesscontainsgracefulShutdownSynccall sites for error exits, but the body ofgracefulShutdownSyncand any telemetry/session flush it performs are not included in the provided source .registerCleanupappends to a cleanup set, but no caller that drains it on SIGINT is shown .- Because the actual
process.on('SIGINT', ...)handler, theAbortController.abort()call, the tool-execution cancellation branch incheckPermissionsAndCallTool, the session-log persistence writer, and the OTELforceFlush/shutdownpath ininitializeTelemetryare not present in the whitelist or excerpts, the end-to-end flow cannot be faithfully traced here .
State touched
Decisions
(none in whitelist)