Skip to content

fix(manifest-model-router): use AUTO_MODEL in injectProviderConfig#1492

Open
thomas-norg-ai wants to merge 1 commit intomnfst:mainfrom
norgai:norgai/fix-inject-provider-auto-model
Open

fix(manifest-model-router): use AUTO_MODEL in injectProviderConfig#1492
thomas-norg-ai wants to merge 1 commit intomnfst:mainfrom
norgai:norgai/fix-inject-provider-auto-model

Conversation

@thomas-norg-ai
Copy link
Copy Markdown

@thomas-norg-ai thomas-norg-ai commented Apr 9, 2026

injectProviderConfig was writing a minimal model object {id:"auto", name:"auto"} missing the input, cost, contextWindow, and maxTokens fields. OpenClaw crashes with "Cannot read properties of undefined (reading 'input')" because the model catalog entry has no input field.

Export AUTO_MODEL from auth.ts and use it in provider-inject.ts so the injected config includes all required fields.

Fixes #1464


Summary by cubic

Fixes an OpenClaw crash in the manifest model router by exporting and using the full AUTO_MODEL when injecting provider config, ensuring required fields are present. Also spreads buildModelConfig(...) during provider registration so models is a flat array, preventing a TypeError in provider resolution (fixes #1464).

Written for commit 1203934. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

…nd config injection

Two fixes:

1. injectProviderConfig was writing a minimal model object {id:"auto",
   name:"auto"} missing input, cost, contextWindow, maxTokens fields.
   Now uses exported AUTO_MODEL constant with all required fields.

2. registerProvider was passing models as a nested config object
   {baseUrl, api, models: [AUTO_MODEL]} instead of spreading it.
   OpenClaw's provider resolution tried to read .input on the config
   object (not a model entry), causing TypeError. Now spreads
   buildModelConfig() so models is a flat array on the provider.

Fixes mnfst#1464
@thomas-norg-ai thomas-norg-ai force-pushed the norgai/fix-inject-provider-auto-model branch from 03a6cc3 to 1203934 Compare April 9, 2026 08:38
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.77%. Comparing base (d1eb190) to head (1203934).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1492   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files         123      123           
  Lines        8002     8002           
  Branches     3085     3085           
=======================================
  Hits         7904     7904           
  Misses         89       89           
  Partials        9        9           
Flag Coverage Δ
frontend 98.85% <ø> (ø)
manifest 97.72% <ø> (ø)
plugin 94.66% <100.00%> (ø)
shared 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

manifest-model-router: injectProviderConfig uses minimal model object instead of AUTO_MODEL

2 participants