fix(inference): map abstract tier models to provider-native defaults for custom cloud slugs#2146
Conversation
…l-changes fix(providers): remap abstract model tiers for custom cloud providers
📝 WalkthroughWalkthroughDetects and remaps abstract tier model identifiers (e.g., ChangesAbstract Tier Model Detection and Remapping
Vendored Submodule Update
Sequence Diagram(s)(No sequence diagrams generated — changes are localized to provider resolution logic and tests; the control flow is straightforward and adequately represented in the hidden flowchart.) Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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/inference/provider/factory.rs (1)
35-40: 💤 Low valueConsider using existing model tier constants instead of hardcoded strings.
The codebase already defines constants like
MODEL_REASONING_V1,MODEL_REASONING_QUICK_V1, etc. incrate::openhuman::config(used at lines 225-228). Using those here would eliminate duplication and prevent drift if tier names change.♻️ Suggested refactor
+use crate::openhuman::config::{ + MODEL_REASONING_V1, MODEL_REASONING_QUICK_V1, MODEL_AGENTIC_V1, MODEL_CODING_V1, +}; + fn is_abstract_tier_model(model: &str) -> bool { - matches!( - model.trim(), - "reasoning-v1" | "reasoning-quick-v1" | "agentic-v1" | "coding-v1" | "summarization-v1" - ) + let trimmed = model.trim(); + trimmed == MODEL_REASONING_V1 + || trimmed == MODEL_REASONING_QUICK_V1 + || trimmed == MODEL_AGENTIC_V1 + || trimmed == MODEL_CODING_V1 + || trimmed == "summarization-v1" // Add a constant if one exists }🤖 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/inference/provider/factory.rs` around lines 35 - 40, Replace the hardcoded model name strings in is_abstract_tier_model with the existing constants from crate::openhuman::config (e.g., MODEL_REASONING_V1, MODEL_REASONING_QUICK_V1, MODEL_AGENTIC_V1, MODEL_CODING_V1, MODEL_SUMMARIZATION_V1): import or bring those constants into scope and use them in the matches! call (keep model.trim() as before) so the function compares against the canonical constants instead of literal strings to avoid duplication and drift.
🤖 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/inference/provider/factory.rs`:
- Around line 35-40: Replace the hardcoded model name strings in
is_abstract_tier_model with the existing constants from crate::openhuman::config
(e.g., MODEL_REASONING_V1, MODEL_REASONING_QUICK_V1, MODEL_AGENTIC_V1,
MODEL_CODING_V1, MODEL_SUMMARIZATION_V1): import or bring those constants into
scope and use them in the matches! call (keep model.trim() as before) so the
function compares against the canonical constants instead of literal strings to
avoid duplication and drift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a0ca2408-66d5-4142-b954-972343185886
📒 Files selected for processing (2)
src/openhuman/inference/provider/factory.rssrc/openhuman/inference/provider/factory_test.rs
Addresses @coderabbitai nitpick on factory.rs:35-40 — use crate::openhuman::config::MODEL_* constants instead of duplicated literals so abstract-tier detection follows tier renames automatically. Also fixes the new failing-default test: Box<dyn Provider> doesn't implement Debug, so `.expect_err(..)` failed to compile. Replace with an explicit match so the test builds (was breaking the Rust Core Tests CI job on this PR).
# Conflicts: # src/openhuman/inference/provider/factory_test.rs
Bumps vendored tauri-cef submodule from 4cabccfa8 to c90c8a330 (latest on feat/cef). Picks up: - fix(cef): popup blank-page reload guard skip - fix(cef): move blank reload guard onto UI thread - AppImage fixes (glibc, NSS libs, ld-linux bundling) cargo check passes on both core and tauri shell.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@app/src-tauri/vendor/tauri-cef`:
- Line 1: Update the expected SHA file to match the new tauri-cef submodule
commit: overwrite .github/tauri-cef-expected-sha with the current submodule SHA
c90c8a330056286e7c0d05439ae3d4527fa4fafe so the "tauri-cef Pin Guard" CI check
passes; locate the submodule change in vendor/tauri-cef and update the
single-line file .github/tauri-cef-expected-sha to contain exactly that commit
hash (or consider removing the unrelated submodule bump from this PR and create
a separate PR for the tauri-cef update if you prefer cleaner history).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1af6f149-7d1c-48da-8a71-15be2fb828af
📒 Files selected for processing (1)
app/src-tauri/vendor/tauri-cef
There was a problem hiding this comment.
♻️ Duplicate comments (1)
app/src-tauri/vendor/tauri-cef (1)
1-1:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPin-guard blocker: submodule SHA and expected SHA are out of sync.
Line 1 updates the vendored submodule SHA, but CI shows
.github/tauri-cef-expected-shastill expects a different value. Please sync the expected SHA file to this commit (c90c8a330056286e7c0d05439ae3d4527fa4fafe) so Pin Guard passes.🤖 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 `@app/src-tauri/vendor/tauri-cef` at line 1, The vendored submodule SHA in app/src-tauri/vendor/tauri-cef was updated to commit c90c8a330056286e7c0d05439ae3d4527fa4fafe but the CI pin-guard expects the older value; update the .github/tauri-cef-expected-sha file to contain the new commit SHA c90c8a330056286e7c0d05439ae3d4527fa4fafe so the expected SHA matches the actual submodule reference and Pin Guard will pass.
🤖 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.
Duplicate comments:
In `@app/src-tauri/vendor/tauri-cef`:
- Line 1: The vendored submodule SHA in app/src-tauri/vendor/tauri-cef was
updated to commit c90c8a330056286e7c0d05439ae3d4527fa4fafe but the CI pin-guard
expects the older value; update the .github/tauri-cef-expected-sha file to
contain the new commit SHA c90c8a330056286e7c0d05439ae3d4527fa4fafe so the
expected SHA matches the actual submodule reference and Pin Guard will pass.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ab58d03c-98a9-41ee-b265-73297213b76f
📒 Files selected for processing (1)
app/src-tauri/vendor/tauri-cef
…for custom cloud slugs (tinyhumansai#2146) Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
…for custom cloud slugs (tinyhumansai#2146) Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
…for custom cloud slugs (tinyhumansai#2146) Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
Summary
reasoning-v1) could be forwarded directly to custom cloud providers.OpenhumanJwtproviders, remaps abstract tiers tocloud_providers[].default_modelwhen available.Problem
Custom providers such as DeepSeek require provider-native model IDs (for example,
deepseek-v4-pro). Sending OpenHuman tier aliases upstream causedmodel-not-founderrors.Solution
In
make_cloud_provider_by_slug, detect abstract tier names and:default_modelfor non-OpenhumanJwtproviders, orAdded regression tests in
factory_test.rsto lock in both behaviors.Impact
Related
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores