fix(tool-access): drop code comments from OAuth redirect-policy check

Addresses Greptile review: CONTRIBUTING.md forbids code comments in PRs.
The rationale stays in the PR description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
devinfoleyandClaude Opus 5.5 committed 2026-12-01 07:06:10 +00:00
1 parent 97a4b46447
commit a9211af9ca
2 files changed
-11

No files matched your search

-2
View File
@@ -220,8 +220,6 @@ export function errorHandler(
); );
// An unreachable public provider catalog still answers 503 with its // An unreachable public provider catalog still answers 503 with its
// retry guidance, but it is the provider's outage, not a server fault. // retry guidance, but it is the provider's outage, not a server fault.
// An OAuth provider refusing Paperclip's callback URL is its redirect
// policy; the person still gets the 502 and its remediation.
reportCrash( reportCrash(
reportableError, reportableError,
req, req,
@@ -17,15 +17,6 @@ export function oauthProviderFailureDiagnosticsFor(error: unknown): Readonly<OAu
return error instanceof Error ? recorded.get(error) ?? null : null; return error instanceof Error ? recorded.get(error) ?? null : null;
} }
/**
* A registration endpoint that refuses Paperclip's callback URL with 400
* `invalid_redirect_uri` is applying its own redirect policy, such as an
* allowlist of approved clients or an HTTPS rule. Paperclip only sends a
* callback it built from a trusted origin, so it cannot change that answer;
* the person already gets remediation copy. Other registration 400s, such as
* `invalid_client_metadata` or an unrecognized code, can mean Paperclip sent
* bad metadata and stay reportable.
*/
export function isExpectedOAuthProviderFailure(error: unknown): boolean { export function isExpectedOAuthProviderFailure(error: unknown): boolean {
const diagnostics = oauthProviderFailureDiagnosticsFor(error); const diagnostics = oauthProviderFailureDiagnosticsFor(error);
return diagnostics?.operation === "dynamic_client_registration" return diagnostics?.operation === "dynamic_client_registration"