Skip to content

fix(noema): ground verdicts and classify gateway errors - #1831

Merged
seonghobae merged 1 commit into
mainfrom
codex/noema-grounding-error-telemetry
Sep 4, 2026
Merged

fix(noema): ground verdicts and classify gateway errors#1831
seonghobae merged 1 commit into
mainfrom
codex/noema-grounding-error-telemetry

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

  • include a byte-bounded JSON list of exact changed-side locations in the Noema prompt
  • classify bounded canonical gateway HTTP errors as phase=response_error
  • expose only a conservative error.detail.model identifier; malformed, oversized, or unexpected bodies remain unknown
  • never log the HTTP error body or arbitrary response fields

Routing verification

The contextual-orchestrator repository was not modified. Its existing passthrough failover suite passed (59 passed), and the existing response-format preservation test function also passed when invoked with HTTP 502. No routing patch is needed.

Validation

  • uv run pytest -q tests/test_noema_review_gate.py — 110 passed
  • uv run python -m py_compile scripts/ci/noema_review_gate.py tests/test_noema_review_gate.py
  • actionlint .github/workflows/noema-review.yml
  • git diff --check origin/main...HEAD

Base used for the final verification: dafb1e6974c51bc62ce5f606431922bcd0d36414.

Pass a byte-bounded exact changed-line location contract to the reviewer. Extract only a conservative model identifier from bounded canonical HTTP error JSON and report response_error without logging the body.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI)
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: b057f40f-690a-460e-b02e-8983c5debdcf

📥 Commits

Reviewing files that changed from the base of the PR and between dafb1e6 and 978950c.

📒 Files selected for processing (2)
  • scripts/ci/noema_review_gate.py
  • tests/test_noema_review_gate.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae merged commit 6382f3f into main Sep 4, 2026
6 of 19 checks passed
@seonghobae
seonghobae deleted the codex/noema-grounding-error-telemetry branch September 4, 2026 05:18
seonghobae added a commit that referenced this pull request Sep 4, 2026
… and coverage gap (#1835)

[QUEUE_SATURATION_CHICKEN_EGG] Blocks the required test/coverage/docstring suite for every .github PR regardless of diff; bypass-merged per standing chicken-and-egg authorization. Independently reproduced by a peer session on a separate branch before this fix landed. Full evidence in PR description: reproduced on fresh main, fixed (2780 passed, 100% coverage, 100% docstrings).
seonghobae added a commit that referenced this pull request Sep 4, 2026
…g after merging main

Merging origin/main (now including #1832/#1835) surfaced a failure in
test_transport_failure_reports_requested_model_and_not_literal_connecting:
expected phase=awaiting_response, got phase=response_error.

Not a base-branch bug -- ruled out by testing fresh main alone (passes
cleanly) and by a peer session's independent clean run. This is a
silent merge-combination bug specific to this branch: this branch's
own unreleased DNS-pinning/TOCTOU hardening also built a careful
connecting-vs-awaiting_response phase distinction (three prior PRs:
bebd7c7, e7b29f2, 5c9d30e) via a `reported_phase` ternary gated on
`active_phase == "connecting"`. Main's #1831 separately added
`active_phase = "response_error"` for the HTTPError case (to also
extract served_model from HTTP error bodies) on a non-overlapping
line, so the merge produced zero conflict markers -- but by the time
this branch's ternary runs, active_phase has already been overwritten,
silently defeating the phase distinction for exactly the HTTPError
case.

Verified "response_error" is not a regression: it is strictly more
specific than the old "awaiting_response" fallback (an HTTPError
proves a real response arrived, unlike a genuinely ambiguous timeout),
and still satisfies the test's real safety property (never mislabel a
real HTTP-error response as "connecting"). The two sibling tests
covering the non-HTTPError paths are untouched, confirming the fix
scope is exactly this one test's stale string expectation, not a
deeper production-code issue. Updated the assertion and docstring; no
production code change needed.

Full verification after fix: 2811 passed, coverage 100%, interrogate
100%.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
seonghobae added a commit that referenced this pull request Sep 5, 2026
…works (#1868)

The .github-side follow-up this entry named as still-needed (call_llm not
reading the HTTPError response body, so it couldn't surface served_model)
shipped in #1831 (merged), hardened by #1835 and #1850.

Found incidentally while handling an unrelated Autofix event on PR #1757: a
fresh gateway failure now logs phase=response_error and a real model name
(served_model=google/gemma-4-31b-it) instead of the old unknown/connecting
pair. The underlying gateway instability (502 after 284.7s) is still a
separate, open, recurring problem -- but the telemetry gap that made every
prior instance of it undiagnosable is closed.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant