





















@@ -353,6 +353,68 @@ describe("AcpxRuntime fresh reset wrapper", () => {
353353});
354354});
355355356+it("ignores unsupported Codex ACP timeout config controls", async () => {
357+const baseStore: TestSessionStore = {
358+load: vi.fn(async () => ({
359+acpxRecordId: "agent:codex:acp:test",
360+agentCommand: CODEX_ACP_COMMAND,
361+})),
362+save: vi.fn(async () => {}),
363+};
364+const { runtime, delegate } = makeRuntime(baseStore);
365+const setConfigOption = vi.spyOn(delegate, "setConfigOption").mockResolvedValue(undefined);
366+const handle: Parameters<NonNullable<AcpRuntime["setConfigOption"]>>[0]["handle"] = {
367+sessionKey: "agent:codex:acp:test",
368+backend: "acpx",
369+runtimeSessionName: "agent:codex:acp:test",
370+acpxRecordId: "agent:codex:acp:test",
371+};
372+373+await runtime.setConfigOption({
374+ handle,
375+key: "timeout",
376+value: "60000",
377+});
378+await runtime.setConfigOption({
379+ handle,
380+key: "Timeout_Seconds",
381+value: "60",
382+});
383+384+expect(setConfigOption).not.toHaveBeenCalled();
385+});
386+387+it("forwards timeout config controls for non-Codex ACP agents", async () => {
388+const baseStore: TestSessionStore = {
389+load: vi.fn(async () => ({
390+acpxRecordId: "agent:claude:acp:test",
391+agentCommand: "npx @agentclientprotocol/claude-agent-acp",
392+})),
393+save: vi.fn(async () => {}),
394+};
395+const { runtime, delegate } = makeRuntime(baseStore);
396+const setConfigOption = vi.spyOn(delegate, "setConfigOption").mockResolvedValue(undefined);
397+const handle: Parameters<NonNullable<AcpRuntime["setConfigOption"]>>[0]["handle"] = {
398+sessionKey: "agent:claude:acp:test",
399+backend: "acpx",
400+runtimeSessionName: "agent:claude:acp:test",
401+acpxRecordId: "agent:claude:acp:test",
402+};
403+404+await runtime.setConfigOption({
405+ handle,
406+key: "timeout",
407+value: "60",
408+});
409+410+expect(setConfigOption).toHaveBeenCalledOnce();
411+expect(setConfigOption).toHaveBeenCalledWith({
412+ handle,
413+key: "timeout",
414+value: "60",
415+});
416+});
417+356418it("keeps stale persistent loads hidden until a fresh record is saved", async () => {
357419const baseStore: TestSessionStore = {
358420load: vi.fn(async () => ({ acpxRecordId: "stale" }) as never),
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。