Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): fail open post-settle replies and cancel pending requests on agent exit #40484

Mergeditsthecsguy(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/40484/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 75 additions and 3 deletions.

x
0 of 2 viewed, 2 left
65 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsModified
View file
@@ -3194,6 +3194,71 @@
assert.equal(opened.cancels(), cancels);
}).pipe(Effect.provide(layerSession)),
+​
+ it.effect(
+ "fails a post-settle reply immediately and cancels pending requests when the agent exits",
+ () =>
+ Effect.gen(function* () {
+ const opened = yield* openSessionWithRunningCommand({ WaitMsBeforeAsync: 10000 });
+ yield* opened.startTurn(1, false);
+ yield* opened.throughPromptSettled;
+ yield* opened.send({
+ sessionUpdate: "tool_call_update",
+ ...opened.command,
+ status: "completed",
+ rawOutput: { output: "Command exited with code 0.", exit_code: 0 },
+ });
+ yield* opened.send({
+ sessionUpdate: "agent_message_chunk",
+ content: { type: "text", text: "Partial post-settle reply" },
+ });
+ yield* opened.runtimeDies;
+ const terminal = (yield* opened.throughTerminal).at(-1);
+ assert.equal(terminal?.type === "turn.terminal" && terminal.status, "failed");
+​
+ const withQuestion = yield* openSessionWithRunningCommand({ WaitMsBeforeAsync: 10000 });
+ yield* withQuestion.startTurn(1, false);
+ yield* withQuestion.throughPromptSettled;
+ const question = yield* withQuestion