GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(provider-core): ACP sign-in failures tell the user to sign in (#2… · mattiaz9/t3code@8d5f21f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2/testkit
    • AcpRegistryReplayFixtures.integration.test.ts
  • packages/provider-core/src/server
    • failure.test.ts
    • failure.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/testkit/AcpRegistryReplayFixtures.integration.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/testkit/AcpRegistryReplayFixtures.integration.test.ts
+6-11Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,12 @@ describe("ACP registry replay fixtures", () => {
182182
const errors = projection.turnItems.filter((item) => item.type === "error");
183183
assert.lengthOf(errors, 1);
184184
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+
);
196191
}).pipe(
197192
Effect.provide(
198193
layerProviderReplay(scenario, AcpRegistryOrchestratorReplayHarness, {
Collapse file

‎packages/provider-core/src/server/failure.test.ts‎

Copy file name to clipboardExpand all lines: packages/provider-core/src/server/failure.test.ts
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ it("names how the provider process exited and the stage it failed in, without it
165165
);
166166
});
167167

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+
168186
it("keeps unrecognized reasons and provider text out of category messages", () => {
169187
for (const cause of [
170188
"Private launch command",
Collapse file

‎packages/provider-core/src/server/failure.ts‎

Copy file name to clipboardExpand all lines: packages/provider-core/src/server/failure.ts
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ function curatedCauseMessages(cause: unknown): {
158158
category: categoryMessage(),
159159
};
160160
}
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+
};
161169
case "ContextHandoffDeliveryUncertainError":
162170
return {
163171
known:

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.