feat(agent): simplify durable operation graph

This commit is contained in:
Mario Zechner 2026-08-26 16:10:53 +02:00
parent 3a68f018c0
commit c60dd63fdf
49 changed files with 2460 additions and 2772 deletions

View file

@ -27,6 +27,7 @@ const emptyLaneSnapshot: LaneSnapshot = {
lane: "main",
transcript: [],
tipId: null,
lastOperationId: null,
operation: null,
queues: { steer: [], followUp: [], nextRun: [] },
pendingWrites: [],
@ -149,7 +150,15 @@ export class TestHarness {
}
const result = this.nextPromptResult ?? {
ok: true,
value: { kind: "completed", runId: "run-1", tipId: "leaf-1" },
value: {
operationId: "run-1",
kind: "run",
status: "completed",
fromTipId: null,
tipId: "leaf-1",
startedAt: 1,
endedAt: 2,
},
};
this.nextPromptResult = undefined;
return result;

View file

@ -131,7 +131,15 @@ describe("Session protocol", () => {
attachClient: async () => ({
prompt: async () => ({
ok: true,
value: { kind: "completed" as const, runId: "run-1", tipId: "leaf-1" },
value: {
operationId: "run-1",
kind: "run" as const,
status: "completed" as const,
fromTipId: null,
tipId: "leaf-1",
startedAt: 1,
endedAt: 2,
},
}),
release: () => {},
}),
@ -423,7 +431,18 @@ describe("Session protocol", () => {
type: "response",
id: "request-3",
ok: true,
result: { ok: true, value: { kind: "completed", runId: "run-1", tipId: "leaf-1" } },
result: {
ok: true,
value: {
operationId: "run-1",
kind: "run",
status: "completed",
fromTipId: null,
tipId: "leaf-1",
startedAt: 1,
endedAt: 2,
},
},
});
expect(host.latestHarness("session-1").promptCalls).toEqual([["Hello"]]);
});
@ -660,7 +679,15 @@ describe("routed Session acquisition failures", () => {
return {
prompt: async () => ({
ok: true,
value: { kind: "completed" as const, runId: "run-1", tipId: "leaf-1" },
value: {
operationId: "run-1",
kind: "run" as const,
status: "completed" as const,
fromTipId: null,
tipId: "leaf-1",
startedAt: 1,
endedAt: 2,
},
}),
release: () => {
releaseCount += 1;