fix(inference): gate Responses fallback by endpoint host#4236
Conversation
📝 WalkthroughWalkthroughAdds endpoint-host-aware Responses API fallback gating, updates missing-route 404 handling to log and suppress Sentry, and refreshes Reddit, native voice, and Star History links in localized READMEs. ChangesResponses API host-based capability gate and 404 demotion
README link and embed updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/openhuman/config/schema/cloud_providers.rs (1)
240-254: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a debug/trace breadcrumb for the host-based capability decision.
This new gate decides whether
/responsesstays enabled, but there is no debug trail for the builtin/custom branch, the permissive parse-failure path, or the final host-match result. Please log the normalized host and final decision here so routing changes are diagnosable in production. As per coding guidelines, "Add debug logging to entry/exit, branches, external calls, retries/timeouts, state transitions, and errors usinglog/tracingatdebug/tracelevel in Rust".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openhuman/config/schema/cloud_providers.rs` around lines 240 - 254, Add a debug/trace breadcrumb in cloud_endpoint_supports_responses_api so the host-based /responses decision is observable in production. Log the builtin/custom branch, the endpoint_host parse-failure fallback, and the normalized host plus final boolean result using log/tracing at debug or trace level. Use the existing cloud_endpoint_supports_responses_api and endpoint_host flow to place the logs without changing the capability logic.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openhuman/config/schema/cloud_providers.rs`:
- Around line 240-254: Add a debug/trace breadcrumb in
cloud_endpoint_supports_responses_api so the host-based /responses decision is
observable in production. Log the builtin/custom branch, the endpoint_host
parse-failure fallback, and the normalized host plus final boolean result using
log/tracing at debug or trace level. Use the existing
cloud_endpoint_supports_responses_api and endpoint_host flow to place the logs
without changing the capability logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c33294d5-e3df-4e4f-ab9e-5fd6155bed69
📒 Files selected for processing (4)
src/openhuman/config/schema/cloud_providers.rssrc/openhuman/inference/provider/compatible_helpers.rssrc/openhuman/inference/provider/compatible_tests.rssrc/openhuman/inference/provider/factory.rs
be63c48 to
91c03cf
Compare
|
The localized README link fixes are intentionally included because the repository-wide required Markdown Link Check fails on current upstream/main for those stale links, even though #4203 is a Rust inference fix. They are isolated in the docs commit and unblock the required gate; no product behavior changes. |
Summary
/responsesroute-missing 404s: cache the endpoint as unsupported, log at info, skip Sentry, and still propagate the terminal error./responses404 demotion path.Problem
/responses, guaranteeing an extra 404 on fresh processes and a false-positive Sentry event.Solution
cloud_endpoint_supports_responses_api(slug, endpoint)so built-in slugs keep the explicit capability table while custom slugs are also checked against known built-in chat-only hosts./responses404s on fallback paths as endpoint capability discovery instead of reportable provider failures.Submission Checklist
diff-cover) meet the gate enforced by.github/workflows/pr-ci.yml. Local full coverage was not run; required CI coverage gate will enforce this before merge.## Related— N/A: no matrix feature ID.docs/RELEASE-MANUAL-SMOKE.md) — N/A: provider fallback internals only.Closes #NNNin the## RelatedsectionImpact
/responsesfallback./responsesretries and Sentry noise.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
pnpm --filter openhuman-app format:check— N/A: Rust-only app path; docs/Rust change.pnpm typecheck— N/A: no frontend/TypeScript changes.GGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib custom_slug_on_builtin_chat_only_host_does_not_expose_responses_apiGGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib missing_responses_route_404_marks_unsupported_without_sentry_eventGGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib openhuman::inference::provider::factory::factory_testsGGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib openhuman::inference::provider::compatible::testsGGML_NATIVE=OFF cargo test --manifest-path Cargo.toml --lib responsescargo fmt --manifest-path Cargo.toml --checkgit diff --checkGGML_NATIVE=OFF cargo check --manifest-path Cargo.tomlValidation Blocked
command:lychee --versionerror:locallycheebinary is not installed.impact:local link-check replication unavailable; GitHub Markdown Link Check validates the docs change.Behavior Changes
/responsesroutes.Parity Contract
/responses; unknown custom proxies remain permissive.Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
Bug Fixes
/responsesroute returns 404, fallback handling proceeds without generating Sentry events.Tests
/responses” fallback behavior and Sentry suppression.Documentation