fix(inference): propagate anthropic wire mode to Hermes sandbox config sync - #4747
fix(inference): propagate anthropic wire mode to Hermes sandbox config sync#4747jahubba wants to merge 1 commit into
Conversation
…g sync nemoclaw inference set left Hermes-type sandboxes unable to run inference after switching to anthropic-prod or compatible-anthropic-endpoint: the Hermes config sync wrote model.provider: custom without an api_mode, so Hermes spoke OpenAI chat-completions at an anthropic-type provider and the gateway L7 policy denied every call (POST /chat/completions not allowed). Two fixes: - patchHermesInferenceConfig now writes model.api_mode: anthropic_messages when the route is anthropic-wire (and clears the key otherwise, so a stale wire mode never survives a provider switch). - getSandboxInferenceConfig keeps compatible-anthropic-endpoint on the OpenAI wire only for an explicit preferredInferenceApi, not the null default - callers without a baked preference (the Hermes sync) now get the anthropic branch an anthropic-type provider requires. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR fixes Hermes sandbox inference for Anthropic providers by adding the missing ChangesHermes Anthropic Provider Wire-Mode Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
#4402 did fix the issue on v0.0.59 |
|
Thanks @sandl99. I think #4847 is needed to fully resolve this one. The path this issue reports — |
Summary
nemoclaw inference set --provider anthropic-prod(orcompatible-anthropic-endpoint) leaves Hermes-type sandboxes unable to run any inference: the Hermes config sync writesmodel.provider: customwithout anapi_mode, so the agent speaks OpenAI chat-completions at an anthropic-type provider and the gateway L7 policy denies every call (DENIED inference.local:443 POST /chat/completions). This PR propagates the anthropic wire mode through the Hermes sync, matching whatpatchOpenClawInferenceConfigalready does for OpenClaw sandboxes.Related Issue
Fixes #4746
Changes
src/lib/actions/inference-set.ts—patchHermesInferenceConfigwritesmodel.api_mode: anthropic_messageswhenroute.inferenceApi === "anthropic-messages"(Hermes honors this key forcustomproviders), and clears the key on non-anthropic routes so a stale wire mode never survives a provider switch.src/lib/inference/config.ts—getSandboxInferenceConfigkeepscompatible-anthropic-endpointon the OpenAI wire only for an explicitpreferredInferenceApi === "openai-completions"; the null-default no longer silently selects the OpenAI branch for an anthropic-type provider (the Hermes sync never passes a preference).inference-set.test.tsandconfig.test.ts: anthropic wire propagation for both providers, staleapi_modecleanup on switch-away, anthropic-prod route mapping, default-vs-explicit preference forcompatible-anthropic-endpoint.Note on local verification: this was developed on an aarch64 Jetson host where a fixed set of environment-dependent suites (NIM/GPU preflight/install checks) fail identically on a clean
maincheckout; the affected test files pass 51/51 andnpm run typecheck:cli+ Biome are clean. Relying on CI for the full matrix.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Jason Hubbard jasonahubbard@gmail.com
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests