@devries-cameron20 / t3code-1 / commits / 1402a2c9bf
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(provider-core): ACP sign-in failures tell the user to sign in (#29548)

Julius Marminge committed Nov 16, 2026 at 17:50 UTC 1402a2c9bf30e8329145386070386f65cc81f942
3 files changed +32 -11
apps/server/src/orchestration-v2/testkit/AcpRegistryReplayFixtures.integration.test.ts
+6 -11
@@ -182,17 +182,12 @@ describe("ACP registry replay fixtures", () => {
182 const errors = projection.turnItems.filter((item) => item.type === "error");
183 assert.lengthOf(errors, 1);
184 assert.equal(errors[0]?.failure.class, "provider_error");
185 - if (testCase.code === -32602) {
186 - assert.equal(
187 - errors[0]?.failure.message,
188 - 'The agent did not accept the model "replay-model-b". Choose another model for this provider, then retry.',
189 - );
190 - } else {
191 - assert.match(
192 - errors[0]?.failure.message ?? "",
193 - /^Failed to open acpRegistry provider session \S+\.$/u,
194 - );
195 - }
185 + assert.equal(
186 + errors[0]?.failure.message,
187 + testCase.code === -32602
188 + ? 'The agent did not accept the model "replay-model-b". Choose another model for this provider, then retry.'
189 + : "The provider needs you to sign in. Sign in from its provider settings or with its own CLI or app, then retry the turn.",
190 + );
191 }).pipe(
192 Effect.provide(
193 layerProviderReplay(scenario, AcpRegistryOrchestratorReplayHarness, {
packages/provider-core/src/server/failure.test.ts
+18
@@ -165,6 +165,24 @@ it("names how the provider process exited and the stage it failed in, without it
165 );
166 });
167
168 +it("tells the user to sign in only when an ACP agent answers auth_required", () => {
169 + const providerSessionId = ProviderSessionId.make("provider-session:private-id");
170 + const sessionOpenFailure = (code: number) => ({
171 + _tag: "ProviderSessionOpenError",
172 + cause: new ProviderAdapter.ProviderAdapterOpenSessionError({
173 + driver: ProviderDriverKind.make("acpRegistry"),
174 + providerSessionId,
175 + cause: Cause.fail({ _tag: "AcpRequestError", code, errorMessage: "Private agent text" }),
176 + }),
177 + });
178 +
179 + assert.equal(
180 + makeProviderFailure({ cause: Cause.fail(sessionOpenFailure(-32000)) }).message,
181 + "The provider needs you to sign in. Sign in from its provider settings or with its own CLI or app, then retry the turn.",
182 + );
183 + assert.isUndefined(knownProviderFailureMessage(sessionOpenFailure(-32603)));
184 +});
185 +
186 it("keeps unrecognized reasons and provider text out of category messages", () => {
187 for (const cause of [
188 "Private launch command",
packages/provider-core/src/server/failure.ts
+8
@@ -158,6 +158,14 @@ function curatedCauseMessages(cause: unknown): {
158 category: categoryMessage(),
159 };
160 }
161 + // ACP reserves -32000 for auth_required; the agent's own text is not shown.
162 + case "AcpRequestError":
163 + if ((cause as Record<string, unknown>).code !== -32000) break;
164 + return {
165 + known:
166 + "The provider needs you to sign in. Sign in from its provider settings or with its own CLI or app, then retry the turn.",
167 + category: categoryMessage(),
168 + };
169 case "ContextHandoffDeliveryUncertainError":
170 return {
171 known: