Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/call-status-started-unknown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@call-e/cli": patch
---

Report `call_started: "unknown"` on `call status` failures instead of hardcoding `true`.
5 changes: 4 additions & 1 deletion packages/cli/docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ first clarification question when available.

Call workflow failures include a `stage` of `plan_call`, `run_call`, or
`get_call_run`, plus `call_started` and `retry_safe` guidance. A `plan_call`
failure reports `call_started: false` and is safe to retry. If `run_call` may
failure reports `call_started: false` and is safe to retry. A `call status`
(`get_call_run`) failure reports `call_started: "unknown"` and `retry_safe:
true`: a status lookup cannot know whether a call exists, and `true` is
reserved for a stable `run_id` from `run_call`. If `run_call` may
have been accepted but no stable `run_id` was received, the CLI reports
`call_started: "unknown"`, `retry_safe: false`, an opaque `recovery_id`, and
`next_argv`. Use that array as the next request's `argv`, preserving all
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ async function fetchCallStatus({ config, deps, runId }) {
deps,
stage: "get_call_run",
toolArguments: { run_id: runId },
callStarted: true,
callStarted: "unknown",
retrySafe: true,
});
}
Expand Down Expand Up @@ -1508,7 +1508,7 @@ async function handleCallCommand({ command, positional, options, config, deps, s
deps,
stage: toolName,
toolArguments: buildStatusArguments(options),
callStarted: true,
callStarted: "unknown",
retrySafe: true,
});
localizeCallStatusResultTimestamps(result, options, deps.env || process.env);
Expand Down
33 changes: 33 additions & 0 deletions packages/cli/test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,39 @@ test("call run invokes run_call then get_call_run once", async () => {
assert.doesNotMatch(result.stdout, /run-token/);
});

test("call status auth failure reports call_started unknown", async () => {
const cacheRoot = makeTempRoot("calle-cli-call-status-auth");
let fetchCalled = false;
const result = await run(
[
"call",
"status",
"--run-id",
"run_does_not_exist",
"--base-url",
"https://mcp.example",
"--cache-root",
cacheRoot,
],
{
fetchImpl: async () => {
fetchCalled = true;
throw new Error("fetch should not be called");
},
}
);
const payload = JSON.parse(result.stdout);

assert.equal(result.code, 1);
assert.equal(fetchCalled, false);
assert.equal(payload.ok, false);
assert.equal(payload.error.code, "auth_required");
assert.equal(payload.stage, "get_call_run");
assert.equal(payload.call_started, "unknown");
assert.equal(payload.retry_safe, true);
assert.notEqual(payload.call_started, true);
});

test("call status maps flags to get_call_run arguments", async () => {
const cacheRoot = makeTempRoot("calle-cli-call-status");
const serverUrl = "https://mcp.example/mcp/openagent_oauth";
Expand Down