Skip to content

Commit 4106794

Browse files
committed
refactor(agents): remove stale acp error alias
1 parent ff49b7f commit 4106794

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎src/agents/command/attempt-execution.error-propagation.test.ts‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Covers ACP diagnostic event propagation and sanitized error formatting.
22
import { afterEach, beforeEach, describe, expect, it } from "vitest";
3-
import { AcpRuntimeError } from "../../acp/runtime/errors.js";
3+
import { AcpRuntimeError, formatAcpErrorChain } from "../../acp/runtime/errors.js";
44
import {
55
type AgentEventPayload,
66
onAgentEvent,
@@ -10,7 +10,6 @@ import {
1010
emitAcpLifecycleError,
1111
emitAcpPromptSubmitted,
1212
emitAcpRuntimeEvent,
13-
formatAcpLifecycleError,
1413
} from "./attempt-execution.js";
1514

1615
let captured: AgentEventPayload[] = [];
@@ -132,12 +131,12 @@ describe("emitAcpLifecycleError preserves AcpRuntimeError detail (regression: op
132131
});
133132

134133
it("formats non-Error values without crashing", () => {
135-
expect(formatAcpLifecycleError("just a string")).toBe("just a string");
136-
expect(formatAcpLifecycleError(42)).toBe("42");
137-
expect(formatAcpLifecycleError(undefined)).toBe("undefined");
134+
expect(formatAcpErrorChain("just a string")).toBe("just a string");
135+
expect(formatAcpErrorChain(42)).toBe("42");
136+
expect(formatAcpErrorChain(undefined)).toBe("undefined");
138137

139138
const token = "sk-abcdefghijklmnopqrstuvwxyz123456";
140-
const text = formatAcpLifecycleError(`upstream rejected token=${token}`);
139+
const text = formatAcpErrorChain(`upstream rejected token=${token}`);
141140
expect(text).toMatch(/upstream rejected/);
142141
expect(text).not.toContain(token);
143142
});
@@ -146,7 +145,7 @@ describe("emitAcpLifecycleError preserves AcpRuntimeError detail (regression: op
146145
const e: Error & { cause?: unknown } = new Error("loop");
147146
e.cause = e;
148147

149-
const text = formatAcpLifecycleError(e);
148+
const text = formatAcpErrorChain(e);
150149

151150
// Should produce a finite string with the message, not hang.
152151
expect(text).toMatch(/loop/);

‎src/agents/command/attempt-execution.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,6 @@ export function emitAcpLifecycleError(params: {
982982
});
983983
}
984984

985-
/** @deprecated use formatAcpErrorChain from src/acp/runtime/errors.ts */
986-
export const formatAcpLifecycleError = formatAcpErrorChain;
987-
988985
export function emitAcpAssistantDelta(params: { runId: string; text: string; delta: string }) {
989986
emitAgentEvent({
990987
runId: params.runId,

0 commit comments

Comments
 (0)