Skip to content

Commit 4088bd3

Browse files
committed
fix(runner): include cliVersion on direct chat success
Fetch and return cliVersion before the early chat-success return so AgentResult is consistent across successful execution paths.
1 parent da4e947 commit 4088bd3

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cursor-action": patch
3+
---
4+
5+
Ensure `runAgent` returns `cliVersion` when the primary `cursor-agent chat` invocation succeeds, keeping successful result shape consistent with fallback paths.

src/runner.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,17 @@ export const runAgent = async (inputs: ActionInputs): Promise<AgentResult> => {
304304
clearTimeout(chatTimeout);
305305
}
306306

307+
const cliVersion = await fetchCliVersionLine(env, cwd);
308+
debug(`cursor-agent --version: ${cliVersion}`);
309+
307310
if (chatResult.exitCode === 0) {
308311
return {
309312
...chatResult,
313+
cliVersion,
310314
invocationMode: "chat",
311315
};
312316
}
313317

314-
const cliVersion = await fetchCliVersionLine(env, cwd);
315-
debug(`cursor-agent --version: ${cliVersion}`);
316-
317318
if (!shouldTryPrintFallback(chatResult)) {
318319
warnOnFailure(
319320
chatResult.exitCode,

0 commit comments

Comments
 (0)