Repository navigation
Description
Summary
maka run --graph can hang indefinitely when the root supervisor's provider request fails before it commits the first update_agent_graph schedule. The AgentRun is already terminal (failed) and the Session is blocked, but the CLI continues waiting for graph completion even though no graph was created and therefore nothing can ever close.
The same failure path also collapses a structured provider error to Operation failed / [object Object], which prevents classification and diagnosis.
Reproduction
Tested from the top of the #1593 fix stack (agent/1593-large-output-regression, commit 03fdf594) with:
node packages/cli/dist/cli.js run - \
--cwd <repo> \
--connection sub2api-stg \
--model gpt-5.6-sol \
--thinking medium \
--timeout 3600 \
--permission-mode bypass \
--graphUse a prompt whose first action should create graph work, then make the initial provider stream fail (the live reproduction used a transient upstream failure).
Observed twice:
- Session
8c89dfff-73d3-4d79-8a17-aa2bac0bff25: root AgentRun failed before any tool call; CLI printedmaka run: Operation failedand exited. - Session
af1d5c81-20fd-453f-8d23-fc220068ac0b: root AgentRun failed afterview_agent_graph, before any work was scheduled; the process remained alive and silent until explicitly sentSIGTERM. - Session
1a078bda-caf7-4ee9-80d6-cf6fa23ae8b1: initial request failed at only 3.2 KiB; the process again remained alive after the run was terminal. Two interactive Ctrl-C attempts did not stop it;kill -TERMdid.
Representative operational events:
model_stream_failed errorClass=Other error="Operation failed"
rawErrorName="object" rawErrorType="object"
redactedErrorMessage="[object Object]"
run_failed failureClass=unknown
No subagent_spawns or graph schedule existed for the affected root session.
Expected
- If the root run fails before a graph exists,
maka run --graphexits non-zero immediately with the underlying classified provider error. - If a graph exists, waiting should be canceled when the root terminal state makes further reconciliation impossible, or should have an explicit durable terminal failure state.
- SIGINT should always stop the CLI wait.
- Structured non-
Errorprovider failures should be normalized without reducing them to[object Object].
Suggested direction
Race agentGraph.waitForCompletion(sessionId) against the root invocation terminal result and process cancellation. Before waiting, distinguish graph exists and remains reconcilable from no schedule was ever committed. Normalize thrown objects at the provider boundary (status/code/message/body where safe) before redaction and failure classification.
Activity