fix(quick-pane): preserve lifecycle and answer history
This commit is contained in:
@@ -162,7 +162,7 @@ test("sends abort without waiting behind a blocked prompt", async () => {
|
||||
await registry.stop();
|
||||
});
|
||||
|
||||
test("keeps a runtime healthy after a non-terminal adapter diagnostic", async () => {
|
||||
test("keeps a runtime healthy after an unknown non-terminal Pi notification", async () => {
|
||||
const worktrees = await createWorktrees();
|
||||
const fixture = createAdapterFactory();
|
||||
const registry = createAgentRegistry({
|
||||
@@ -173,7 +173,10 @@ test("keeps a runtime healthy after a non-terminal adapter diagnostic", async ()
|
||||
await registry.start();
|
||||
|
||||
fixture.calls[0].options.onError(
|
||||
{ code: "frame_too_large", message: "Pi RPC frame exceeds 32 bytes" },
|
||||
{
|
||||
code: "unsupported_event",
|
||||
message: "Pi RPC emitted unsupported event: future_pi_notification",
|
||||
},
|
||||
{ terminal: false },
|
||||
);
|
||||
|
||||
@@ -184,6 +187,31 @@ test("keeps a runtime healthy after a non-terminal adapter diagnostic", async ()
|
||||
await registry.stop();
|
||||
});
|
||||
|
||||
test("keeps explicit transport failures terminal", async () => {
|
||||
const worktrees = await createWorktrees();
|
||||
const fixture = createAdapterFactory();
|
||||
const registry = createAgentRegistry({
|
||||
homeWorktree: worktrees.home,
|
||||
sessionRoot: worktrees.sessionRoot,
|
||||
startAdapter: fixture.startAdapter,
|
||||
});
|
||||
await registry.start();
|
||||
|
||||
fixture.calls[0].options.onError({
|
||||
code: "invalid_json",
|
||||
message: "Pi RPC emitted invalid JSON",
|
||||
});
|
||||
|
||||
const runtime = registry.getWorkspace().directories[0].runtimes[0];
|
||||
assert.equal(runtime.state, "error");
|
||||
assert.equal(runtime.attention, true);
|
||||
assert.deepEqual(runtime.error, {
|
||||
code: "invalid_json",
|
||||
message: "Pi RPC emitted invalid JSON",
|
||||
});
|
||||
await registry.stop();
|
||||
});
|
||||
|
||||
test("stops agents created during shutdown and rejects new selections", async () => {
|
||||
const worktrees = await createWorktrees();
|
||||
const fixture = createAdapterFactory();
|
||||
|
||||
Reference in New Issue
Block a user