Repository navigation
Done
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Open an ACP agent with saved conversations in Settings → Providers.
- Click List sessions for the project where a conversation was saved.
- Click Import on a conversation while the agent cannot read its saved history.
- Once the history becomes available again, check the conversation's row without refreshing the list.
Expected behavior
The row offers a retry for the missing conversation history.
Actual behavior
Settings reports a successful import and disables Import. The T3 thread lacks the earlier messages, and the Import button only reappears after refreshing the list.
Impact
Major degradation or frequent failure. Anyone whose initial ACP history load fails loses the immediate way to retry.
Version or commit
main at 59651c1761. The cause is at apps/server/src/provider/AcpRegistrySessions.ts:257.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
Import can be retried after the history read failedAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/acp-failed-history-keeps-import-available.e2e.ts b/scripts/scenarios/acp-failed-history-keeps-import-available.e2e.ts
new file mode 100644
index 0000000000..bbc63cdb27
--- /dev/null
+++ b/scripts/scenarios/acp-failed-history-keeps-import-available.e2e.ts
@@ -0,0 +1,102 @@
+// @effect-diagnostics nodeBuiltinImport:off -- The scenario supplies a local ACP agent.
+import * as NodeFSP from "node:fs/promises";
+import * as NodePath from "node:path";
+
+import { ProviderDriverKind, ProviderInstanceId } from "@t3tools/contracts";
+import { expect } from "e2e";
+import * as Effect from "effect/Effect";
+
+import { T3_HOME } from "../e2e.config.ts";
+import { rpcClient, runPromise, test, WEB } from "./t3.ts";
+
+const SESSION_TITLE = "Conversation with temporarily unavailable history";
+const ACP = `
+import { existsSync } from "node:fs";
+import { createInterface } from "node:readline";
+
+const [recovered] = process.argv.slice(2);
+for await (const line of createInterface({ input: process.stdin })) {
+ const { id, method, params } = JSON.parse(line);
+ if (id === undefined) continue;
+ const reply = (body) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...body }) + "\\n");
+ if (method === "initialize") {
+ reply({ id, result: {
+ protocolVersion: 1,
+ agentInfo: { name: "history-scenario", version: "1.0.0" },
+ agentCapabilities: { loadSession: true, sessionCapabilities: { list: {} } },
+ authMethods: [],
+ } });
+ } else if (method === "session/new") {
+ reply({ id, result: { sessionId: "health-probe" } });
+ } else if (method === "session/list") {
+ reply({ id, result: { sessions: [{
+ sessionId: "native-history",
+ cwd: params.cwd,
+ title: ${JSON.stringify(SESSION_TITLE)},
+ }] } });
+ } else if (method === "session/load") {
+ if (!existsSync(recovered)) {
+ reply({ id, error: { code: -32000, message: "History temporarily unavailable" } });
+ continue;
+ }
+ reply({ method: "session/update", params: {
+ sessionId: params.sessionId,
+ update: {
+ sessionUpdate: "agent_message_chunk",
+ content: { type: "text", text: "An earlier answer from the native session" },
+ },
+ } });
+ reply({ id, result: {} });
+ } else {
+ reply({ id, error: { code: -32601, message: "Method not found" } });
+ }
+}
+`;
+
+test(
+ "A failed native ACP history read leaves Import available without refreshing Settings",
+ WEB,
+ async ({ t3, app, screen }) => {
+ const instanceId = ProviderInstanceId.make("scenario-history-agent");
+ const workspaceRoot = await t3.project("demo", { "history-agent.mjs": ACP });
+ const recovered = NodePath.join(workspaceRoot, "history-recovered");
+ await runPromise(
+ Effect.gen(function* () {
+ const client = yield* rpcClient(T3_HOME, app.baseUrl ?? "");
+ yield* client["server.updateSettings"]({
+ patch: {},
+ providerInstanceMutation: {
+ operation: "upsert",
+ instanceId,
+ instance: {
+ driver: ProviderDriverKind.make("acpRegistry"),
+ displayName: "History scenario agent",
+ enabled: true,
+ config: {
+ source: "local",
+ commandPath: process.execPath,
+ commandArgs: [NodePath.join(workspaceRoot, "history-agent.mjs"), recovered],
+ },
+ },
+ },
+ });
+ }).pipe(Effect.scoped),
+ );
+
+ await t3.open(`/settings/providers?instanceId=${instanceId}`);
+ await screen.getByRole("button", "List sessions", { exact: true }).tap({ timeout: 60_000 });
+ await screen.getByText(SESSION_TITLE, { exact: true }).waitFor();
+ const importButton = screen.getByRole("button", "Import", { exact: true });
+ await importButton.tap();
+ await screen.getByRole("button", "Importing", { exact: true }).waitFor({
+ state: "hidden",
+ timeout: 60_000,
+ });
+ await NodeFSP.writeFile(recovered, "");
+ await app.screenshot("native-session-after-history-failure");
+ expect(
+ (await importButton.isVisible()) && (await importButton.isEnabled()),
+ "Import can be retried after the history read failed",
+ ).toBe(true);
+ },
+);pnpm scenarios:prove scripts/scenarios/acp-failed-history-keeps-import-available.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity
TroyLiu2023 commentedon Nov 28, 2026
Another repro of the same "marked complete without history" path, where the history read succeeds but the agent replays nothing.
Environment
T3 Code v0.1.12 (Linux, background service). Provider: Local ACP command
dsh --profile acp(DeepSeek Harness 0.2.2-rc.5). This agent advertises onlysessionCapabilities: { close, list, resume }, noloadSession, and itssession/resumedeliberately restores the log without replaying updates (documented in the agent's README), so T3 falls back tosession/resumeand gets an empty replay.Steps
Observed
importNativeHistoryV2succeeding andsession/resumesucceeding, no failures.logs/provider/events.thread-…-native-….log) contains exactlyinitialize → session/resume → session/closeand zerosession/updatenotifications.importNativeHistorythen callscommit(messages)unconditionally (apps/server/src/project/AgentSessionImporter.ts), sohistoryOriginbecomes"v1_import",isNativeHistoryPendingis false, and nothing tells the user that this agent cannot supply history at all.Suggestion
Beyond retry-on-failure: when the replayed history is empty and the agent does not advertise
loadSession, either keep the import pending or show an explicit notice on the thread or session row, e.g. "This agent doesn't support loading its history. Earlier turns are only visible in the agent's own UI; continuing the conversation still works because the agent restores its own context." Since the commit is final, an agent that later gainssession/loadcannot repair an already-imported thread either, so a way to re-pull history would help.Related: #22015, #44116.