Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7293,6 +7293,8 @@ describe("AcpAdapterV2", () => {
if (event.type === "turn.terminal" && event.providerTurnId === firstProviderTurnId) break;
}
const snapshotBeforeRollback = yield* runtime.readThreadSnapshot({ providerThread });
// Turns reach orchestration as events; the session keeps no record of them.
assert.deepEqual(snapshotBeforeRollback.providerTurns, []);

const rolledBack = yield* runtime.rollbackThread({
providerThread: { ...providerThread, appThreadId: rollbackThreadId },
Expand Down
15 changes: 2 additions & 13 deletions packages/provider-acp/src/server/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,6 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
const emitNativeResponseLifecycle =
options.testHooks?.onNativeResponseLifecycle ?? (() => Effect.void);
const nextElicitationOrdinal = yield* Ref.make(0);
const providerTurns = yield* Ref.make(new Map<string, OrchestrationV2ProviderTurn>());
const snapshot = yield* Ref.make(emptySnapshotState());

const awaitRuntimeTeardown = Effect.fnUntraced(function* () {
Expand Down Expand Up @@ -8006,7 +8005,6 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
yield* Ref.set(promptRuntimeInstructions, new Map());
yield* Ref.set(compactionMarkers, new Map());
yield* Ref.set(completedCompactionIds, new Set());
yield* Ref.set(providerTurns, new Map());
yield* Ref.set(snapshot, emptySnapshotState());
yield* continuationPermit.withPermit(
Effect.gen(function* () {
Expand Down Expand Up @@ -8718,11 +8716,6 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
}
yield* reportAgentModeChanges(context.input.threadId);
const turn = providerTurnPayload(context, settledStatus, now);
yield* Ref.update(providerTurns, (current) => {
const updated = new Map(current);
updated.set(String(turn.id), turn);
return updated;
});
yield* emitProviderEvent({
type: "provider_turn.updated",
driver,
Expand Down Expand Up @@ -9622,11 +9615,6 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
yield* Ref.set(activeTurn, context);
yield* Ref.set(stoppedRunQuarantine, false);
const runningTurn = providerTurnPayload(context, "running", null);
yield* Ref.update(providerTurns, (current) => {
const updated = new Map(current);
updated.set(String(runningTurn.id), runningTurn);
return updated;
});
yield* emitProviderEvent({
type: "provider_turn.updated",
driver,
Expand Down Expand Up @@ -10707,7 +10695,8 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
status: "idle" as const,
updatedAt: now,
},
providerTurns: [...(yield* Ref.get(providerTurns)).values()],
// Imports read only the transcript; turns reach orchestration as events.
providerTurns: [],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
messages,
reasoningMessageIds: [...state.reasoningIds],
runtimeRequests: [],
Expand Down
Loading