-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature]: Use interrupt() method as graceful timeout alternative #347
Copy link
Copy link
Closed
Labels
effort:medium1-4 hours1-4 hoursenhancementNew feature or requestNew feature or requestperformancePerformance and efficiency improvementsPerformance and efficiency improvementspriority:highImportant but not blockingImportant but not blockingsdk:agentClaude Agent SDK usage (Stage 3)Claude Agent SDK usage (Stage 3)stage:executionStage 3: Agent SDK execution with tool captureStage 3: Agent SDK execution with tool capturestatus:analyzedIssue has been analyzed by ClaudeIssue has been analyzed by Claude
Metadata
Metadata
Assignees
Labels
effort:medium1-4 hours1-4 hoursenhancementNew feature or requestNew feature or requestperformancePerformance and efficiency improvementsPerformance and efficiency improvementspriority:highImportant but not blockingImportant but not blockingsdk:agentClaude Agent SDK usage (Stage 3)Claude Agent SDK usage (Stage 3)stage:executionStage 3: Agent SDK execution with tool captureStage 3: Agent SDK execution with tool capturestatus:analyzedIssue has been analyzed by ClaudeIssue has been analyzed by Claude
Parent Issue
Sub-issue of #344 (Leverage Additional SDK v0.2.25 Capabilities)
Feature Type
SDK integration (Agent SDK)
Problem or Need
Scenario timeouts currently use
AbortControllerwithsetTimeout(agent-executor.ts:224-225,session-batching.ts:727). While functional,AbortControllerforce-kills execution rather than allowing the agent to stop gracefully and potentially produce a partial result.Proposed Solution
Use the SDK v0.2.25
interrupt()method as an alternative toAbortControllerfor scenario execution timeouts.Key considerations:
interrupt()signals the agent to stop gracefully, potentially allowing a partial result messageSDKResultMessagefor metrics extraction (extractResultMetricsatagent-executor.ts:390)AbortControllerwith configuration toggle initiallysession-batching.tsFiles Affected
src/stages/3-execution/agent-executor.ts— prepareExecutionContext, executeScenario, executeScenarioWithCheckpointsrc/stages/3-execution/session-batching.ts— executeScenarioWithRetrysrc/stages/3-execution/sdk-client.ts— QueryObject interfaceRisk Assessment
Medium risk — Need to verify
interrupt()still triggers thefor awaitloop to complete and produce anSDKResultMessage. Affects timeout handling which is a core reliability feature.Testing Requirements
SDKResultMessageis produced after interruptPriority Rationale
High value for timeout handling semantics. Second-highest priority per #344 analysis.
🤖 Created with Claude Code