Skip to content

fix(pixel-chat): validate bytes type for response payload in complete_direct - #5972

Closed
Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-chat-results-complete-direct-bytes-type
Closed

Vishaaallll wants to merge 1 commit into
Osmantic:public-betafrom
Vishaaallll:fix/pixel-chat-results-complete-direct-bytes-type

Conversation

@Vishaaallll

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/pixel_chat_results.py, complete_direct(self, key, data) writes direct responses into the chunks table without validating that data is binary bytes or bytearray. If a text string or other object is passed, SQLite accepts it as TEXT rather than BLOB, leading to decoding failures in the SSE stream generator.

This surgical fix validates isinstance(data, (bytes, bytearray)) in complete_direct, raising TypeError("Chunk data must be bytes").

Validation

  • Baseline reproduction: verified that complete_direct(key, "text") passed type checking on baseline.
  • Post-fix behavior: properly raises TypeError("Chunk data must be bytes").
  • 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; zero overlap with direct response payload validation.

Risk / AI disclosure

AI-assisted investigation, patch, and regression tests. Enforces payload type safety for direct chat responses. 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