修复 max_turn_exceeded 中断提示与错误透传#696
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| const CRITICAL_EVENTS = new Set<string>([EventType.Error, EventType.RunError]); | ||
| const SESSION_AGNOSTIC_EVENTS = new Set<string>([ | ||
| EventType.Error, | ||
| EventType.RunError, |
There was a problem hiding this comment.
RunError is run-scoped, but adding it to SESSION_AGNOSTIC_EVENTS lets failures from a stale/different session bypass the session guard. The handler below then calls resetGeneratingState() and finalizeRunningToolCalls("error") globally, so if the user has switched sessions or started another run, an old run_error can stop/corrupt the current UI state. Consider only allowing mismatched RunError through when its run_id matches currentRunId, or otherwise keep the session guard and route the error to the owning session/run.
Summary
max_turn_exceededgateway.run失败事件透传stop_reason=max_turn_exceededrun_error处理,显示明确的最大轮数提示并收敛生成状态Test
go test ./internal/gateway ./internal/runtimego test ./internal/gateway/...go test ./internal/cli -run TestGatewayRuntimePortBridgeRuntimeMethodscd web && npm test -- eventBridgeNotes
go test ./internal/cli整包仍受本地 Windows 环境限制影响,失败点与本次改动无关。close #695