Repository navigation
Conversation
# Conflicts: # src/agents/pi-embedded-helpers.formatassistanterrortext.test.ts # src/agents/pi-embedded-helpers/errors.ts # src/shared/assistant-error-format.ts
Greptile SummaryThis PR rewrites 403 HTML auth page handling so that embedded
Confidence Score: 3/5Not safe to merge until the corrupted ellipsis character is fixed — it will produce garbled output in any truncated error message shown to users. One P1 defect (mojibake ellipsis) is present on the changed path; the new classification logic itself appears sound and is well-covered by the added tests. src/shared/assistant-error-format.ts — line 260 has a corrupted character introduced by this PR. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/shared/assistant-error-format.ts
Line: 260
Comment:
**Corrupted ellipsis character**
The PR replaced the proper Unicode ellipsis `…` (U+2026) with the mojibake sequence `…`, which is what `…`'s UTF-8 bytes (`E2 80 A6`) look like when decoded as Latin-1. Any error message longer than 600 characters will now display garbled text to the user instead of a clean truncation indicator.
```suggestion
return trimmed.length > 600 ? `${trimmed.slice(0, 600)}…` : trimmed;
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/agents/pi-embedded-helpers/sanitize-user-facing-text.ts
Line: 368-374
Comment:
**Duplicated helper function**
`shouldPreferHtmlHttpErrorCopy` is defined identically in both this file and `src/agents/pi-embedded-helpers/errors.ts`. Since both callers already import `extractHtmlHttpError` from the shared module, consider exporting this helper from `assistant-error-format.ts` (or a shared utility) and importing it in both places to avoid divergence.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Errors: rewrite 403 HTML auth pages" | Re-trigger Greptile |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: the branch is stale, conflicting, and targets removed pi-embedded helper paths; generic auth-HTML handling was already merged through #79900, while the remaining Codex/Cloudflare 403 behavior is tracked by #94432 and current-path PRs. Canonical path: Close this PR and keep #94432 with current-path PRs #94440 and #95150 as the active track for any remaining Codex/Cloudflare work. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this PR and keep #94432 with current-path PRs #94440 and #95150 as the active track for any remaining Codex/Cloudflare work. Do we have a high-confidence way to reproduce the issue? Yes for the close decision: live PR metadata, current source, and tracked files prove the branch is obsolete and conflicting; no live Codex OAuth repro was run in this read-only review. Is this the best way to solve the issue? No: reviving this old pi-embedded branch is not the best fix because generic auth-HTML behavior already merged and remaining Cloudflare/Codex behavior belongs on the active embedded-agent helper surface. Security review: Security review cleared: The diff only changes TypeScript error formatting/classification and tests, with no dependency, workflow, secret, permission, package, or code-execution surface changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fix incorrect user-facing error reporting when provider requests return
403HTML auth/challenge pages.Previously these failures could be surfaced as transport or rate-limit style errors, which sent users down the wrong debugging path. This change detects embedded and direct HTML auth pages earlier and keeps them on the authentication failure path instead.
What changed
403HTML auth failures as auth-specific runtime classificationVerification
Passed:
pnpm test src/agents/pi-embedded-helpers.formatassistanterrortext.test.tspnpm test src/agents/pi-embedded-helpers.isbillingerrormessage.test.tspnpm test src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.tspnpm test src/agents/pi-embedded-subscribe.handlers.lifecycle.test.tsAI-assisted PR.