Interactive-mode tool calls have no automatic timeout — a hung command blocks the session forever #1544
Replies: 2 comments
|
补充一点核心诉求(维护者视角的 root cause): 问题的本质不是"命令会卡",而是"卡的时候用户和 agent 完全失明"。 一个工具的执行过程必须:
对 agent 工具类产品,无限静默挂起 = 把故障成本转嫁给用户:既占住对话,又没有信息让上层模型决策。建议至少在交互模式提供:可配置 tool timeout(默认 ~5-10min,自动 kill 子进程组 + 返回 abort 错误),以及运行中命令的心跳/进度暴露。 |
|
This is the primary upstream match for the Python failure I was investigating. The visible Orca daemon-reconnect error appears to be a downstream symptom of an interactive Additional sanitized integration context:
The v0.7.3 source confirms the timeout gap:
So a blocked Python/ The fix should preserve the existing uncertain-side-effect boundary: configurable interactive tool timeout, visible heartbeat/last-activity state, interrupt/kill of the kernel-side process tree when safe, and an explicit |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
In interactive mode, a tool call that never returns blocks the session indefinitely. Observed case: a
%%bashcell running a Node script that callschromium.launch()through the built-in Playwright driver hung for 31 minutes with no output and no auto-abort (BrowserType.launch's own 30s timeout never fired because the hang occurred earlier in the driver handshake). The only escape was a manual Ctrl+C, which correctly surfaced as "Request was aborted".Environment
ipythontoolExpected behavior
A configurable per-tool-call wall-clock timeout for interactive mode (CLI flag such as
--tool-timeout-ms, or a settings.json entry, default ~5-10 min). On expiry the runtime should kill the underlying subprocess and return anisErrortoolResult so the agent can react (report/retry) instead of blocking the conversation with no path forward.Current behavior
Timeout/abort machinery exists only in autonomous mode (
--autonomous-timeout-msdefault 1800000,--autonomous-gate-timeout-msdefault 300000). Interactive mode has no tool-level timeout at all; the only builtin tool isipython, whose%%bash/subprocess execution waits forever. User must notice and manually interrupt.Suggested fix
Wrap interactive tool execution in a wall-clock watchdog that mirrors the autonomous wall-clock limit: kill the kernel-side subprocess group and return an abort error to the model, preserving the existing "Request was aborted" cancellation plumbing already proven in the codebase.
All reactions