feat(proxy): use tenant catalog token limits for VS Code models - #608
Open
bohdanmaliar wants to merge 10 commits into
Open
bohdanmaliar wants to merge 10 commits into
bohdanmaliar wants to merge 10 commits into
Conversation
Refs: EPMCDME-15572 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Resolve each limit as tenant catalog, then built-in table, then defaults. Refs: EPMCDME-15572 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Refs: EPMCDME-15572 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
vscode-model-token-limits task 1 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
vscode-model-token-limits task 3 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
vscode-model-token-limits task 2 Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
…rule Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codemie proxy connect vscodewrites thelanguageModelsconfig for VS Code from a hardcoded capability table. Those token limits were static, so models whose limits differ per tenant got the wrongmaxInputTokens/maxOutputTokens. This PR reads the limits from the tenant model catalog and uses the table only as a fallback.Changes
tenant-catalog.ts):TenantModelDescriptornow carriesmaxInputTokensandmaxOutputTokensfrommax_input_tokens/max_output_tokens. Values are kept only when they are finite numbers > 0. Zero, negative, string, null and missing values are dropped.vscode-models.ts): newresolveVsCodeTokenLimits(entry, descriptor).maxInputTokensis a prompt budget, so input plus output has to fit.maxInputTokensis used.vscode.ts):buildManagedModeltakes the descriptor and applies the resolved limits to both table-matched and default (untabled) models.sso.http-client.ts: small type tweak (LlmModel) so the catalog type can be reused.docs/COMMANDS.md: documents the resolution order (tenant catalog, then built-in table, then defaults) and the input-minus-output rule.Examples
claude-4-5-sonnet(tabled)gpt-6-sol(untabled)claude-4-5-sonnetclaude-4-5-sonnetTests
Added unit tests for catalog parsing (valid and invalid values),
resolveVsCodeTokenLimits(all cases above) and an end-to-end config-write test covering both tabled and untabled models.The
docs/superpowers/tasks/2026-10-02-vscode-model-token-limits/files are planning artifacts from the SDLC run that produced this change.