Roo-Code 3.11.0: why 'Failed to create api configuration' with maxTokens null?
Installing Roo-Code 3.11.0 in VS Code on Windows with OpenRouter and DeepSeek R1, the log immediately shows 'Failed to list configs' and 'Failed to create api configuration' with 'Expected number, received null' at apiConfigs.default.openRouterModelInfo.maxTokens. Why does the extension fail to read or save provider profiles right after installation, and what is the fix?
Originally asked on GitHub: https://github.com/RooCodeInc/Roo-Code/issues/2138
3 answers
Status: a maintainer acknowledged the bug the same day and said it should be fixed in Roo-Code 3.11.1; the issue is closed as completed, with a request to reopen if it still happens (the fix was tracked in PR 2139). The error is a data validation failure, not an OpenRouter authentication problem: the stored provider profile has openRouterModelInfo.maxTokens set to null while the schema expects a number, so every attempt to list or save an API configuration throws 'Expected number, received null'.
There is no configuration step in 3.11.0 that avoids it, since the error appears immediately after installing. Update the extension to 3.11.1 or later. If you cannot upgrade right away, the only workaround discussed in the thread is rolling back to 3.10.5; the user who did that did not explicitly confirm the errors disappeared.
General advice (not tested in this thread): the failing value comes from VS Code's secret storage for the extension (the error text says 'Failed to read provider profiles from secrets'), so if the problem persists after upgrading, removing the saved Roo-Code API configuration from VS Code secrets so the extension recreates it would be a reasonable next step.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Installed Roo-Code 3.11.0 in VS Code on Windows; the error appeared right after install, with listConfig and saveConfig both failing because maxTokens was null instead of a number.
Source: https://github.com/RooCodeInc/Roo-Code/issues/2138 (opens external site)
Did this work for you?What @fsrm365 tried on GitHub (Outcome unclear)
Rolled back from 3.11.0 to Roo-Code 3.10.5 after hitting the same issue; the comment does not say whether the error was confirmed gone.
Source: https://github.com/RooCodeInc/Roo-Code/issues/2138#issuecomment-2765213307 (opens external site)
Did this work for you?