fix(pixel-settings): reject active token limits exceeding provider capacity - #5696
Merged
gabsprogrammer merged 1 commit intoSep 19, 2026
Conversation
This was referenced Sep 17, 2026
Open
This was referenced Sep 18, 2026
This was referenced Sep 19, 2026
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.
Why this matters
In
ods/bin/pixel_settings/contract.py,_capabilities(value)validates runtime capability evidence reported by providers and host environments before computing preferences or accepting settings readbacks. WhileproviderMaxOutputTokens > providerContextTokensandactiveMaxOutputTokens > activeContextTokensare explicitly rejected, the contract omitted checks bounding active token limits against provider capacity:activeContextTokens > providerContextTokensandactiveMaxOutputTokens > providerMaxOutputTokens.When inconsistent capability documents are received where active context or active output tokens exceed provider capacities (such as corrupted state or misconfigured models),
_capabilities()silently accepts the dictionary as valid. Later callers invokingpreview_preferences()with empty change sets then fail with deferred preference-validation errors (context-exceeds-declared-or-observed-capacityoroutput-exceeds-capacity) rather than immediately diagnosing the malformed runtime capability evidence withinvalid-runtime-capabilities.This surgical fix adds upper-bound constraints ensuring that active token limits do not exceed provider capacities during runtime capability validation.
Validation
contract.preview_preferences({}, caps(activeContextTokens=200000))andcontract.preview_preferences({}, caps(activeMaxOutputTokens=20000))on unpatchedcontract.py; baseline failed capability evidence validation assertions by yielding deferred preview rejection instead ofinvalid-runtime-capabilities.SettingsError("invalid-runtime-capabilities")during_capabilitiesverification; all 46 contract unit tests pass cleanly.pixel-settings suites: 46 passed. New-test syntax and diff checks pass; new regressions wired into test suite.Overlap check
fix(dashboard-api): tolerate evicted or missing attempts during pixel chat cancel): Touches dashboard API chat result store lifecycle; zero overlap with settings contract validation.fix(pixel-gateway): answer 401 for non-ASCII Authorization headers): Restricts header bytes validation in provider gateway; zero overlap with settings capability contracts.fix(pixel-edge): reject query parameters on chat completions route): Enforces edge route query strictness; no overlap with token capability boundaries.fix(pixel-settings): validate runtime capability bounds): Introduced capability schema checks; this change completes the active capacity invariant checks without modifying existing contracts or defaults.Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens capability validation bounds and does not change valid runtime profiles or downstream defaults. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #5695 at
b44474771without conflicts. Production and test diffs passed together; settings and provider checks remain intact.Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.