Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Clear VCS presentation state on finish (#3764)

Julius Marminge4414f922fe4c
diff --git a/packages/client-runtime/src/state/vcsAction.test.ts b/packages/client-runtime/src/state/vcsAction.test.ts
index 7e618535a..dac852c16 100644
--- a/packages/client-runtime/src/state/vcsAction.test.ts
+++ b/packages/client-runtime/src/state/vcsAction.test.ts
@@ -155,6 +155,46 @@ describe("vcsActionState", () => {
});
});
+ it("clears running presentation state once the action finishes", () => {
+ const initial = beginVcsActionState({
+ operation: "run_change_request",
+ label: "Running source control action",
+ actionId,
+ });
+ const pushing = applyVcsActionProgressEvent(
+ initial,
+ progress({
+ actionId,
+ action,
+ cwd,
+ kind: "phase_started",
+ phase: "push",
+ label: "Pushing...",
+ }),
+ );
+ const finished = applyVcsActionProgressEvent(
+ pushing,
+ progress({
+ actionId,
+ action,
+ cwd,
+ kind: "action_finished",
+ result,
+ }),
+ );
+
+ expect(finished).toMatchObject({
+ isRunning: false,
+ operation: "run_change_request",
+ actionId,
+ action,
+ currentLabel: null,
+ currentPhaseLabel: null,
+ lastOutputLine: null,
+ error: null,
+ });
+ });
+
it("retains a terminal action error for presentation", () => {
const initial = beginVcsActionState({
operation: "run_change_request",
diff --git a/packages/client-runtime/src/state/vcsAction.ts b/packages/client-runtime/src/state/vcsAction.ts
index 8ae3219a2..f2cba39cf 100644
--- a/packages/client-runtime/src/state/vcsAction.ts
+++ b/packages/client-runtime/src/state/vcsAction.ts
@@ -386,12 +386,10 @@ export function applyVcsActionProgressEvent(
};
case "action_finished":
return {
- ...current,
- isRunning: false,
+ ...EMPTY_VCS_ACTION_STATE,
actionId: event.actionId,
action: event.action,
operation: "run_change_request",
- error: null,
};
case "action_failed":
return {