You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "liugddx (via GitHub)" <gi...@apache.org> on 2026/08/27 00:37:49 UTC

[PR] fix(runtime): classify exhausted Codex edge rejection [maka]

liugddx opened a new pull request, #3960:
URL: https://github.com/apache/maka/pull/3960

   ## Summary
   
   - preserve the distinction between Codex JSON authorization failures and transient HTML edge rejections after the bounded retry budget is exhausted
   - classify only the exhausted HTML edge case as `ProviderUnavailable` while retaining HTTP 403 in durable diagnostics
   - keep genuine JSON 401/403 responses classified as authentication/account failures
   
   ## Root cause
   
   The Codex transport already retries HTML 403 responses after 2, 10, and 30 seconds. After the fourth rejection, it created the same HTTP-403 error used for API authorization responses. Provider classification therefore told Desktop to show `Authentication failed`, even when dozens of model calls in the same run had succeeded with the same credential.
   
   The exhausted edge path now carries a dedicated structured code, `openai_codex_edge_rejection`. That code narrowly overrides the generic 403 fallback as `ProviderUnavailable`; no other 403 behavior changes.
   
   ## Verification
   
   - built `@maka/core`, `@maka/storage`, `@maka/mcp`, `@maka/computer-use`, and `@maka/runtime`
   - `node --test "packages/runtime/dist/__tests__/subscription-model-fetch.test.js" "packages/runtime/dist/__tests__/provider-error-classification.test.js"` (33 passed)
   - Biome check passed for all four changed files
   
   Fixes #3959
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on code in PR #3960:
URL: https://github.com/apache/maka/pull/3960#discussion_r3868914611


##########
packages/runtime/src/subscription-model-fetch.ts:
##########
@@ -214,7 +214,7 @@ async function checkedOpenAiCodexFetch(
       edgeRetry += 1;
       continue;
     }
-    throw openAiCodexHttpError(response, detail);
+    throw openAiCodexHttpError(response, detail, edgeRetry === edgeRetryDelaysMs.length);

Review Comment:
   Fixed in af00398c0. The terminal sentinel now requires both a fully consumed edge retry budget and the final response still satisfying isTransientOpenAiCodexEdgeRejection. A regression covers three HTML 403 retries followed by a JSON account_not_authorized 403 and verifies the original auth error/code is preserved.



##########
packages/runtime/src/provider-error-classification.ts:
##########
@@ -34,7 +34,12 @@ const CONTEXT_OVERFLOW_PROVIDER_CODES: ReadonlySet<string> = new Set([
 
 const PROVIDER_UNAVAILABLE_PROVIDER_CODES: ReadonlySet<string> = new Set([
   'server_error', // OpenAI-compatible stream errors can omit the HTTP status.
+  // Codex's edge returned HTML, not an API authorization response, across the
+  // complete bounded retry budget. Preserve HTTP 403 for diagnostics without
+  // telling the user to re-authenticate.
+  'openai_codex_edge_rejection',

Review Comment:
   Fixed in af00398c0. The sentinel was removed from PROVIDER_UNAVAILABLE_PROVIDER_CODES; the trusted provenance branch is now its sole classification authority. A status-less spoof regression confirms an arbitrary provider code cannot reach ProviderUnavailable.



##########
packages/runtime/src/provider-error-classification.ts:
##########
@@ -760,6 +778,26 @@ function classifyProviderFacts(facts: ProviderErrorFacts): string {
   return classificationTarget instanceof Error ? classificationTarget.name || 'Other' : 'Other';
 }
 
+function isTrustedCodexEdgeRejection(facts: ProviderErrorFacts): boolean {
+  let current: unknown = facts.target;
+  const seen = new Set<unknown>();
+  for (let depth = 0; depth < 5 && current !== undefined && !seen.has(current); depth += 1) {
+    seen.add(current);
+    if (current instanceof Error && current.name === 'OpenAiCodexEdgeRejectionError') return true;
+    current =
+      typeof current === 'object' && current !== null
+        ? (current as { cause?: unknown }).cause
+        : undefined;
+  }
+  const target = facts.target;
+  return (
+    typeof target === 'object' &&
+    target !== null &&
+    (target as { type?: unknown }).type === 'model_failure' &&

Review Comment:
   Fixed in af00398c0. The forgeable model_failure code clause was removed. Trust now comes only from an internally constructed OpenAiCodexEdgeRejectionError found in the bounded cause chain. The exhausted transport sentinel is also non-retryable at the outer model loop so its 2/10/30-second budget is not restarted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5434293834

   This is a synthesis of the independent bounded freshness review by @Sol-404ARE at exact head `b9e95c812708c994e52f146479fea14c84a45fc0` (base `9d62ee9a`, actual merge-base `6762085e`, 4 files +160−8) versus the sealed baseline `e65e7c0259bbf0e2ede7f2b943e76c58f9dd8047`. I verified the diff and the exact-head CI myself; the file:line findings below are from Sol's sealed review.
   
   What I checked myself:
   - Read `gh pr diff 3960` for `b9e95c81` (4 files/+160/−8, rebase from `6762085e` to `9d62ee9a` but actual merge-base unchanged) and confirmed the repair delta is 4 files +108/−6, not a pure rebase/tree-equivalent.
   - Checked exact-head CI: `test` run `33036087975` SUCCESS, `windows_recovery` run `33036087985` SUCCESS, OPEN/MERGEABLE/BLOCKED/REVIEW_REQUIRED.
   
   Findings from Sol's review (file:line anchored):
   
   **Standards — GO (0 hard violations)**
   
   - Hard Standards GO: the previously missing AI-use declaration and `Generated-by: Codex` trailer are now present, and the PR template fields are completed. Title/branch/runtime boundary pass.
   - Judgment-only **P3 Mysterious Name** — `packages/runtime/src/subscription-model-fetch.ts:217,341-353`: `edgeRetry === edgeRetryDelaysMs.length` is named and passed as `exhaustedEdgeRejection`, but it only proves the first three attempts were edge retries, not that the terminal response is still an edge rejection. After three HTML 403s, a fourth JSON 401/403, 429, or 5xx would still be named and stamped as `OpenAiCodexEdgeRejectionError`. The code should retain and check the final response's edge fact before naming/stamping.
   
   Old Standards closures: AI-use, template, title/branch, and runtime boundary are now closed.
   
   **Spec — NO-GO: 1×P1**
   
   - **P1 — terminal sentinel still mislabels a later real JSON auth response as an edge outage.** At `subscription-model-fetch.ts:205-217`, after three transient HTML 403s `edgeRetry===3`; if attempt 4 returns HTTP 403 `{error:{code:'account_not_authorized'}}`, line 217 still passes `true` to `openAiCodexHttpError`, which overwrites the original JSON code with `openai_codex_edge_rejection` and names it `OpenAiCodexEdgeRejectionError`. Downstream it becomes ProviderUnavailable/retryable, directly violating issue #3959 “JSON 401/403 remain auth/account”. The fix should require both `budget exhausted` **and** `isTransientOpenAiCodexEdgeRejection(response, detail)` on the terminal response; a guard test is missing: three HTML 403s (retry-after 0), fourth JSON 403 should yield a normal `OpenAiCodexHttpError`/Auth and preserve the original provider code.
   
   Old Spec closures: JSON 403 `server_error` precedence, spoofed `AI_APICallError` sentinel, mislabelled `text/html` parseable JSON, and non-replayable first HTML 403 are now closed. The 2/10/30 delays, abort handling, and HTTP/request-ID diagnostics remain correct.
   
   What I did not judge:
   - Full local runtime suite beyond the focused checks (the isolated worktree had no installed deps, so no local suite was claimed).
   
   Gate: the rebase itself is not pure tree-equivalent, and one P1 (plus one judgment P3 naming) remains; the PR cannot be considered merge-ready until the terminal sentinel also checks the final response's edge fact and the naming is corrected.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5434695106

   Addressed the latest exact-head review in `af00398c0`: the terminal sentinel now requires the final response to remain an edge rejection; the generic provider-code and model-failure trust bypasses are removed; the exhausted transport budget is not restarted by the outer model loop; and a three-HTML-then-JSON-auth regression preserves the real provider code. Local focused result: 36 passed, runtime build and Biome clean. I replied to and resolved all three inline threads. Ready for a fresh exact-head review after CI.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5435087442

   This is a synthesis of the independent bounded freshness review by @Sol-404ARE at exact head `f0e751a2434073fd1b9977b8f00d05d094776e36` (base `4b745fc5`, actual merge-base `6762085e`, 4 files +207−10) versus the sealed baseline `b9e95c812708c994e52f146479fea14c84a45fc0`. I verified the diff and the exact-head CI myself; the file:line findings below are from Sol's sealed review.
   
   What I checked myself:
   - Read `gh pr diff` for `f0e751a2` (the 4-file repair delta +207/−10 on top of `b9e95c81`; full PR diff includes a rebase to `4b745fc5` with many workflow/docs changes that are not part of the repair) and confirmed the repair adds the final-response edge check and two regression tests.
   - Checked exact-head CI: `test` run `33042145703` SUCCESS, `windows_recovery` run `33042145686` SUCCESS, OPEN/MERGEABLE/BLOCKED/REVIEW_REQUIRED.
   
   Findings from Sol's review (file:line anchored):
   
   **Spec — NO-GO: 1×P1**
   
   - **P1 — the repair flips `retryable` to `false`, directly violating issue #3959's acceptance that `ProviderUnavailable` be `retryable`.** At `packages/runtime/src/provider-error-classification.ts:227-230`, the trusted sentinel `openai_codex_edge_rejection` is now classified as `{ retryable:false }`, and `provider-error-classification.test.ts:147-152` locks that `false`. This is not just diagnostic: `normalizeModelFailure` copies the bit, `settleModelStepOutcome` turns `false` into a terminal failure, and `ai-sdk-backend.ts:2581-2584` only runs the bounded outer provider retry when `true`. The shortest repro is the existing test's `OpenAiCodexEdgeRejectionError`: it is still `ProviderUnavailable` but now `retryable:false`, so a transient outage after the full 2/10/30 transport budget terminates immediately. The PR body's “inner 2/10/30 already exhausted, avoid outer retry budget” is a defensible new policy, but without an updated and approved spec/acceptance it remains a cle
 ar spec regression. Fix by either restoring `retryable:true` or updating and getting approval for the spec/acceptance evidence.
   
   Old closures: the previous P1 (final stamp must also check current response's edge fact) is now closed — the new code requires both budget exhausted and `isTransientOpenAiCodexEdgeRejection` on the terminal response, with a 3×HTML→final JSON auth regression that preserves `OpenAiCodexHttpError`/`account_not_authorized`. JSON precedence, non-replayable guard, HTTP 403 diagnostics, trusted provenance, and ProviderUnavailable presentation remain correct.
   
   **Standards — GO (0 hard violations)**
   
   - No hard Standards violations; the previous P3 naming issue is now closed (`exhaustedEdgeRejection` now requires both retry budget exhausted and final response still satisfies `isTransientOpenAiCodexEdgeRejection`, proven by the new test).
   - No new documented-standard breach or meaningful Fowler smell; the commit retains `Generated-by: Codex`.
   
   Other checks: `git diff --check` and 4-file Biome pass; exact-head `test` and `windows_recovery` are green.
   
   What I did not judge:
   - Full local runtime suite beyond the focused checks (the isolated worktree had no installed deps, so no local suite was claimed).
   
   Gate: the rebase is not pure tree-equivalent and one P1 `retryable` regression remains; the PR cannot be considered merge-ready until `retryable` is restored to `true` or the spec/acceptance is updated and approved.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5433942910

   Thanks for the exact-head review. I addressed all in-scope P1/P2 findings in head 9e95c812: (1) the exhausted-edge sentinel is now trusted only from the internally created OpenAiCodexEdgeRejectionError/Maka model-failure provenance, so arbitrary provider server_error or spoofed 403 payloads remain Auth; (2) parseable JSON bodies win even when Content-Type is incorrectly 	ext/html; (3) the sentinel is stamped only after all three replayable edge retries are consumed, while non-replayable requests retain the normal HTTP error. Regression coverage now includes each boundary. I also restored the required PR template sections, declared substantive AI use, and added the Generated-by: Codex trailer. CI was green before this push; the new head is ready for re-review. There are no inline threads to resolve.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5433975713

   The updated head is 9e95c812; all review findings are covered by the new transport/classification tests and the required PR template/AI disclosure is present. No inline review threads exist on this PR; only the automated summary comment required a follow-up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #3960:
URL: https://github.com/apache/maka/pull/3960#discussion_r3868604154


##########
packages/runtime/src/subscription-model-fetch.ts:
##########
@@ -214,7 +214,7 @@ async function checkedOpenAiCodexFetch(
       edgeRetry += 1;
       continue;
     }
-    throw openAiCodexHttpError(response, detail);
+    throw openAiCodexHttpError(response, detail, edgeRetry === edgeRetryDelaysMs.length);

Review Comment:
   **P1 — the sentinel is stamped from the retry counter, not from what actually failed.**
   
   The third argument is `edgeRetry === edgeRetryDelaysMs.length`, which is true once three edge retries have been consumed — regardless of what the *fourth* response was. `openAiCodexHttpError` then sets `name: 'OpenAiCodexEdgeRejectionError'`, `code: 'openai_codex_edge_rejection'`, and — because `providerCode` becomes the sentinel — **discards** the real `openAiCodexProviderCode(detail)`.
   
   Concrete failure: an edge/WAF incident returns HTML 403 on attempts 1–3, consuming the 2/10/30 s budget. By attempt 4 the OAuth access token has expired and Codex returns JSON `401 {"error":{"code":"invalid_token"}}`. The 401 replay latch is single-use and already spent, so this falls straight through to this line. The error is stamped as an exhausted edge rejection, `classifyProviderFacts` takes the trusted-edge branch at `provider-error-classification.ts:744` — which sits *before* the 401/403 branch — and returns `ProviderUnavailable`, retryable. The user is told the provider is unavailable and the turn retries a doomed auth failure, when the correct guidance is "sign in again". The real `invalid_token` code is gone from the diagnostic too.
   
   This is the bug the PR fixes, inverted: auth-shown-for-outage becomes outage-shown-for-auth. Reachability class 2 (edge flakiness plus a credential change inside one request). Recoverable, but the guidance is exactly backwards.
   
   The fix is one conjunct — the condition should test the response, not just the counter:
   
   ```ts
   throw openAiCodexHttpError(
     response,
     detail,
     isTransientOpenAiCodexEdgeRejection(response, detail) && edgeRetry === edgeRetryDelaysMs.length,
   );
   ```
   



##########
packages/runtime/src/provider-error-classification.ts:
##########
@@ -760,6 +778,26 @@ function classifyProviderFacts(facts: ProviderErrorFacts): string {
   return classificationTarget instanceof Error ? classificationTarget.name || 'Other' : 'Other';
 }
 
+function isTrustedCodexEdgeRejection(facts: ProviderErrorFacts): boolean {
+  let current: unknown = facts.target;
+  const seen = new Set<unknown>();
+  for (let depth = 0; depth < 5 && current !== undefined && !seen.has(current); depth += 1) {
+    seen.add(current);
+    if (current instanceof Error && current.name === 'OpenAiCodexEdgeRejectionError') return true;
+    current =
+      typeof current === 'object' && current !== null
+        ? (current as { cause?: unknown }).cause
+        : undefined;
+  }
+  const target = facts.target;
+  return (
+    typeof target === 'object' &&
+    target !== null &&
+    (target as { type?: unknown }).type === 'model_failure' &&

Review Comment:
   **P1 (2 of 2) — the trust check's own second clause has no provenance.**
   
   The first clause is real provenance: it walks the cause chain for an `Error` whose `name` is `OpenAiCodexEdgeRejectionError`, and only we construct that. This second clause is not — it accepts any plain object shaped `{type: 'model_failure', code: 'openai_codex_edge_rejection'}`.
   
   That envelope's `code` is not ours. `normalizeProviderFailure` (`model-adapter.ts:897-905`) overwrites it with `providerFailureSummary(error)?.code`, and that value is `firstProviderField(sources, ['code'])` (`provider-error-classification.ts:378`) — read straight out of the provider's payload. So a provider or gateway returning `{"error":{"code":"openai_codex_edge_rejection"}}` produces a `model_failure` envelope carrying the sentinel, and this clause trusts it.
   
   Net effect: the guard is bypassable two independent ways — this clause, and the `PROVIDER_UNAVAILABLE_PROVIDER_CODES` entry at `:40`. Reachability class 3.
   
   I understand why the clause exists — the `Error` instance is lost when the failure crosses into the `ModelFailure` envelope, so the chain walk cannot work there. But the fix is to carry provenance across that boundary rather than to re-trust a forgeable string. A dedicated non-forgeable field set only by `openAiCodexHttpError` and copied only by our own normalizer would do it; the provider payload can never populate it because nothing reads it from `sources`.
   



##########
packages/runtime/src/provider-error-classification.ts:
##########
@@ -34,7 +34,12 @@ const CONTEXT_OVERFLOW_PROVIDER_CODES: ReadonlySet<string> = new Set([
 
 const PROVIDER_UNAVAILABLE_PROVIDER_CODES: ReadonlySet<string> = new Set([
   'server_error', // OpenAI-compatible stream errors can omit the HTTP status.
+  // Codex's edge returned HTML, not an API authorization response, across the
+  // complete bounded retry budget. Preserve HTTP 403 for diagnostics without
+  // telling the user to re-authenticate.
+  'openai_codex_edge_rejection',

Review Comment:
   **P1 (1 of 2) — this set entry bypasses the provenance check added in the same diff.**
   
   For a genuine transport-built error this entry is unreachable: the trusted branch at `:744` runs *before* the 401/403 branch, so a real edge rejection always classifies there and never reaches this set. The only payloads that arrive here are ones `isTrustedCodexEdgeRejection` **rejected** — and for them this entry grants the classification anyway.
   
   Concrete: an OpenAI-compatible in-stream error part `{"code":"openai_codex_edge_rejection","message":"…"}` with no status field. Overflow, billing, 402, 429 all miss; the trusted branch rejects it (no `OpenAiCodexEdgeRejectionError` in the cause chain); 401/403 misses because there is no status; 413 and 5xx miss. It lands here → `ProviderUnavailable` + retryable. The spoofing test added in this PR only passes because its fixture carries `statusCode: 403`; drop the status and the guard is gone.
   
   Reachability class 3 — a user-configured OpenAI-compatible proxy or a misbehaving gateway controls this payload. Consequence is bounded (10 attempts, then terminal), but the point is structural: a guard that is bypassed in the same diff that introduces it is worse than no guard, because later code will assume the trust check is sound.
   
   Delete this entry and leave the trusted branch as the sole authority.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #3960:
URL: https://github.com/apache/maka/pull/3960


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "liugddx (via GitHub)" <gi...@apache.org>.
liugddx commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5434725761

   Rebased the review-complete repair onto current `upstream/main@4b745fc56`; new exact head is `f0e751a24`. All three inline threads are replied to and resolved. Fresh `test` / `windows_recovery` runs are in progress; a new exact-head review is still required.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(runtime): classify exhausted Codex edge rejection [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #3960:
URL: https://github.com/apache/maka/pull/3960#issuecomment-5433097170

   I reviewed this PR at exact head `e65e7c0259bbf0e2ede7f2b943e76c58f9dd8047` (base `6762085e`, 4 files +58−8, 1 commit).
   
   **Spec: NO-GO — 1×P1 + 2×P2**
   
   - **P1 — the 403 override is broader than the trusted Codex sentinel.** Moving the whole `PROVIDER_UNAVAILABLE_PROVIDER_CODES` set before 401/403 at `packages/runtime/src/provider-error-classification.ts:741-744` also changes an existing JSON `403 {error:{code:'server_error'}}` from Auth/non-retryable to ProviderUnavailable/retryable, contrary to #3959’s requirement that JSON 401/403 remain auth/account failures. Any provider payload can also spoof `openai_codex_edge_rejection`; the classification does not require trusted `OpenAiCodexEdgeRejectionError` provenance. Narrow the 403 override to the internally created sentinel/provenance.
   - **P2 — header-only HTML detection can erase a real JSON auth code.** At `packages/runtime/src/subscription-model-fetch.ts:272-275`, four 403s with body `{"error":{"code":"account_not_authorized"}}` but `Content-Type: text/html` are retried, then overwritten with the edge sentinel. Parseable provider JSON should win over a misleading content type; add the transport→diagnostic regression.
   - **P2 — “exhausted” is stamped even when zero edge retries occurred.** The retry branch at `:205-220` requires replayability, but the terminal stamp requires neither replayability nor `edgeRetry === 3`; a non-replayable body’s first HTML 403 becomes retryable ProviderUnavailable without consuming the 2/10/30s budget.
   
   Positives: the transport test proves the fourth attempt and exact 2/10/30 delays; existing abort tests cover both signal sources; HTTP 403/request ID and bounded/redacted diagnostics remain preserved.
   
   **Standards: 1×P1 + 1×P2 + 1 judgment P3**
   
   - **P1 — mandatory AI-use declaration is absent,** required by `CONTRIBUTING.md:30-34` / PR template. Complete it; if substantive AI authored the change, affected commits also need the required `Generated-by:` trailer.
   - **P2 — required PR template was replaced.** The custom body omits the Checklist and behavior-change declaration required by `CONTRIBUTING.md:79-83`.
   - **Judgment P3 — `exhaustedEdgeRejection` may be true after zero retries** on a non-replayable body (`subscription-model-fetch.ts:339-350`); rename to the actual fact or gate it on real exhaustion.
   
   No architecture-boundary breach or actionable duplication was found.
   
   Other checks: `git diff --check` passes; exact-head `test` run `33027481811` and `windows_recovery` run `33027481814` are terminal SUCCESS; expected path-filtered checks are green. Post-seal the PR is OPEN / non-draft / MERGEABLE / BLOCKED / REVIEW_REQUIRED, head unchanged, 0 reviews/comments.
   
   **What I did not check:** full local suite beyond the checks noted.
   
   **Gate:** exact head has P1/P2 findings and therefore cannot be approved or merged until the 403 override, HTML detection, exhaustion stamping, and template/AI disclosure issues are fixed.
   
   ---
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org