Skip to content

fix: decode OpenCode SSE response bytes explicitly as UTF-8 #97

Description

@dgokeeffe

Problem

The OpenCode content-filter proxy uses requests.iter_lines(decode_unicode=True). For text/event-stream responses without an explicit charset, Requests can decode bytes as Latin-1, turning valid UTF-8 such as check marks and accented text into mojibake. Large thinking and output slabs expose the corruption consistently.

Acceptance criteria

  • Consume SSE lines as raw bytes.
  • Decode each line explicitly as UTF-8.
  • Preserve valid Unicode across the proxy boundary.
  • Add regression coverage for literal UTF-8 SSE content.
  • Verify a 200-line mixed-Unicode OpenCode response through Omnigent attached to CoDA with zero Latin-1 mojibake markers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions