Skip to content

fix(pixel-chat): reject used tokens exceeding window in public_context - #5969

Closed
Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-chat-context-used-exceeds-window
Closed

Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-chat-context-used-exceeds-window

Conversation

@Vishaaallll

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/pixel_chat_context.py, public_context(value) validates that state.context.window == state.model.contextWindow. However, it does not check whether state.context.used > state.context.window. When telemetry reports a used token count that exceeds the allocated window, the invalid measurement is dumped and forwarded directly to dashboard callers.

This surgical fix verifies state.context.used <= state.context.window in public_context, raising ValueError("Context measurement exceeds context window").

Validation

  • Baseline reproduction: verified that used: 16000, window: 8192 passed without error on baseline.
  • Post-fix behavior: properly raises ValueError("Context measurement exceeds context window").
  • Telemetry: pixel-chat suite: 1 passed. New-test syntax and diff checks pass; new regression wired into Linux CI.

Overlap check

Inspected open/closed PRs. PR #5808 checked owner_namespace whitespace; zero overlap with public chat context bounds validation.

Risk / AI disclosure

AI-assisted investigation, patch, and regression tests. Enforces telemetry bounds in dashboard chat context. Independent review remains a gate.

Follow-up integration evidence

Composed locally with public-beta at 6a408cc85 without conflicts. CI and unit checks pass.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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.

2 participants