Skip to content

fix(noema): add price-attested provider fallback - #1410

Closed
seonghobae wants to merge 3 commits into
mainfrom
fix/noema-auto-provider-fallback
Closed

fix(noema): add price-attested provider fallback#1410
seonghobae wants to merge 3 commits into
mainfrom
fix/noema-auto-provider-fallback

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Incident

DiskSage Required Noema Review run 33255007404, job 99107057131, reached the trusted contextual-orchestrator sidecar but exited before /healthz because every selected orchestrator/free route failed the bounded plain-chat preflight. The visible 413 request_too_large line was the expected request-envelope self-test, not the crash.

Root cause

The integrated auto-pool repair is free-first and permits a one-time fallback only to routes with complete published prompt/completion prices and currency evidence. Required Noema Review still provisions the sidecar without CONTEXTUAL_ORCHESTRATOR_POOL, so it defaults to free, and then hardcodes NOEMA_LLM_MODEL=orchestrator/free. It therefore cannot use the already-governed fallback path when all free routes are temporarily unavailable.

TDD state

Current head is intentionally RED. The test-only commit requires Noema to provision orchestrator/auto and invoke the matching virtual model while preserving ZDR enforcement and direct-provider exclusion. Production workflow changes follow only after the focused test is observed failing for the expected missing behavior.

Intended repair

  • keep zero-cost routes first;
  • fall back once only to fully price-attested routes when every free route rejects preflight;
  • retain private/internal ZDR filtering, loopback-only gateway transport, five-provider KV bootstrap, fail-closed exhaustion, reviewer identity, and branch protection;
  • add no direct-provider fallback and synthesize no review verdict.

The DiskSage failed job was separately re-run as a tactical recovery attempt; this PR is the durable central repair.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 21 minutes.

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: Pro Plus

Run ID: 70a154d8-519a-4135-928c-ebbae7a4ad74

📥 Commits

Reviewing files that changed from the base of the PR and between 6c8ee24 and 4741d8e.

📒 Files selected for processing (3)
  • .github/workflows/noema-orchestrator-quality-ci.yml
  • .github/workflows/noema-review.yml
  • tests/test_noema_orchestrator_workflow_contract.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 marked this pull request as ready for review August 29, 2026 14:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CONTEXTUAL_ORCHESTRATOR_REQUIRE_ZDR: ${{ steps.target_visibility.outputs.require_zdr }}
CONTEXTUAL_ORCHESTRATOR_POOL: auto

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Noema reviews consume paid models

When free providers fail, CONTEXTUAL_ORCHESTRATOR_POOL admits priced routes for required Noema reviews. These reviews can incur unapproved provider charges.

Prompt for agents
Restore the binding zero-cost Noema contract while addressing free-route outages. AGENTS.md and docs/adr/0003-contextual-orchestrator-vendored-free-zdr.md require Noema to use orchestrator/free; orchestrator/auto admits fully price-attested paid routes after free-route preflight exhaustion. Keep Noema fail-closed on free-route exhaustion, or update the governing policy through a separately authorized decision before enabling paid fallback. Align the model exported later in this workflow and all affected contract tests with the selected governed route.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +65 to +68
python -m coverage run -m pytest \
tests/test_noema_orchestrator_workflow_contract.py \
tests/test_contextual_orchestrator_review_sidecar_contract.py \
-q

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Focused CI remains predictably red

Existing tests still require orchestrator/free, while this workflow runs one unchanged suite. Every affected pull request fails before validating fallback behavior.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #1415. Exact review found this branch would violate the governing zero-cost Noema contract by admitting priced orchestrator/auto routes. #1415 preserves orchestrator/free, broadens only the bounded free-route preflight catalog, and retains fail-closed exhaustion.

@seonghobae seonghobae closed this Aug 29, 2026
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