I hit this with context-mode@1.0.169 on Pi interactive sessions.
On an investigate turn, the model called a large ctx_execute (recursive walk + log scan). The session stuck on Working... with no further toolResults. Esc did nothing, Ctrl+C did nothing, and the only recovery was force-killing Pi.
context-mode is actively steering into that path. On investigate turns it injects:
context-mode active. Hierarchy: ctx_batch_execute > ctx_execute > ctx_execute_file > ctx_search.
and after compaction it re-injects:
<session_mode>investigate</session_mode>
The hang itself is not just "model wrote a bad scan". Once ctx_execute is in flight, the Pi adapter cannot cancel it.
In build/adapters/pi/mcp-bridge.js, the registered tool execute path ignores the abort signal:
async execute(_toolCallId, params) {
const result = await client.callTool(tool.name, params ?? {});
// no `signal`
}
And tools/call is intentionally unbounded after #643:
return this.request(
"tools/call",
{ name, arguments: args ?? {} },
Number.POSITIVE_INFINITY,
);
So a hung or very long ctx_execute never times out, never receives Esc abort, and Pi never leaves Working.
What I expected:
- Esc / Ctrl+C should cancel an in-flight
tools/call and return a normal tool error
- long jobs can still be allowed, but there needs to be either a default timeout with opt-out, or a hang watchdog that fails the tool and clears Working
- investigate routing should not make an unrecoverable hang easy
The useful fix is not "ban ctx_execute". It is making the Pi adapter abortable and fail-safe. Something like:
async execute(_toolCallId, params, signal) {
const result = await client.callTool(tool.name, params ?? {}, { signal });
// reject pending request when signal aborts
}
plus either a finite default timeout for tools/call, or a watchdog that fails the tool after N idle seconds.
I am not saying context-mode caused the Cloudflare/provider error that started the session. The issue is that once the model follows the investigate/ctx_execute path and that call hangs, there is currently no recovery short of killing Pi.
I hit this with
context-mode@1.0.169on Pi interactive sessions.On an investigate turn, the model called a large
ctx_execute(recursive walk + log scan). The session stuck onWorking...with no further toolResults. Esc did nothing, Ctrl+C did nothing, and the only recovery was force-killing Pi.context-mode is actively steering into that path. On investigate turns it injects:
and after compaction it re-injects:
The hang itself is not just "model wrote a bad scan". Once
ctx_executeis in flight, the Pi adapter cannot cancel it.In
build/adapters/pi/mcp-bridge.js, the registered tool execute path ignores the abort signal:And
tools/callis intentionally unbounded after #643:So a hung or very long
ctx_executenever times out, never receives Esc abort, and Pi never leaves Working.What I expected:
tools/calland return a normal tool errorThe useful fix is not "ban ctx_execute". It is making the Pi adapter abortable and fail-safe. Something like:
plus either a finite default timeout for
tools/call, or a watchdog that fails the tool after N idle seconds.I am not saying context-mode caused the Cloudflare/provider error that started the session. The issue is that once the model follows the investigate/
ctx_executepath and that call hangs, there is currently no recovery short of killing Pi.