Skip to content
Closed
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
10 changes: 5 additions & 5 deletions packages/app-acp/adapter-tool-calls-permissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ test("interrupted permission recovers on load with no effects or repeated reques
expect(completions).toBe(1);
expect(ran).toBe(0);
expect(loaded.messages.some((m) => m.method === "session/request_permission")).toBe(false);
expect(
loaded
.updates()
.some((m) => m.update.sessionUpdate === "tool_call_update" && m.update.status === "failed"),
).toBe(true);
// The journal holds the call and no outcome for it, so the card is drawn with no result.
expect(loaded.updates().map(({ update }) => update.sessionUpdate)).toContain("tool_call");
expect(loaded.updates().some(({ update }) => update.sessionUpdate === "tool_call_update")).toBe(
false,
);
await loaded.close();
});

Expand Down
12 changes: 3 additions & 9 deletions packages/app-acp/rpc/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { isAbsolute } from "node:path";
import { RequestError, type AgentContext, type NewSessionRequest } from "@agentclientprotocol/sdk";
import {
createSession,
projectConversation,
restoreSession,
SessionNotFoundError,
type SessionOptions,
Expand All @@ -28,7 +27,7 @@ import type { AdapterCore } from "./core.ts";
import { forwardPermission } from "./permission.ts";
import type { Session } from "./session.ts";
import type { SessionRegistry } from "./sessions.ts";
import { toolEvidence, type SessionUpdates } from "./updates.ts";
import { transcriptUpdates, type SessionUpdates } from "./updates.ts";

/** Everything opening a session needs from the connection. */
export type OpenDeps = Readonly<{
Expand Down Expand Up @@ -377,13 +376,8 @@ export function opener(deps: OpenDeps): OpenSession {
sessions.set(sessionId, commandEntry);
entry.revision = runtime.snapshot.durable.revision;
if (id && replay) {
const durable = runtime.snapshot.durable;
const view = projectConversation(durable);
const evidence = toolEvidence(durable);
updates.replay(client, id, view.context, `${id}/context`, evidence, renderers);
view.log.forEach((turn, index) => {
updates.replay(client, id, turn.messages, `${id}/history/${index}`, evidence, renderers);
});
for (const update of transcriptUpdates(runtime.snapshot.durable, renderers))
core.send(client, id, update);
}
const registry = runtime.registry;
if (registry.kind === "pending_adoption")
Expand Down
Loading
Loading