Skip to content

test: pin object streaming, content codecs, and openrouter reasoning formats - #421

Open
LarsArtmann wants to merge 1 commit into
charmbracelet:mainfrom
LarsArtmann:characterization-tests
Open

LarsArtmann wants to merge 1 commit into
charmbracelet:mainfrom
LarsArtmann:characterization-tests

Conversation

@LarsArtmann

Copy link
Copy Markdown
Contributor

object had no tests at all, and the content codecs' provider metadata/options decode and openrouter's reasoning format labels were only pinned implicitly. These tests pin that behavior before #420 refactors it, so the refactor lands with its safety net already on main.

  • object/object_test.go drives both streamers (StreamWithText, StreamWithTool) with a scripted model: partial deltas, parser-repaired truncation, the repair callback, duplicate-emission suppression, schema misses ending in NoObjectGeneratedError, finish-metadata forwarding, stream errors, and consumer-stop propagation (a counter proves the model stops being pulled).
  • content_json_test.go pins the provider metadata and provider options decode through a test-registered provider type, including the no-data and empty-map paths and non-string text rejection.
  • providers/openrouter/language_model_hooks_test.go pins the openai-responses-v1/xai-responses-v1 reasoning format labels following the model prefix.

No production code changes: all three files pass on main as-is (a0f6ed1), and each test fails when the branch it covers is disabled (mutation-checked), so #420 is checked by these tests rather than merely accompanied by them.

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

💘 Generated with Crush

…formats

Characterization tests for the code the dedup PRs refactor next:
object had no tests at all; the content codecs' provider metadata/options
decode and openrouter's reasoning format labels were only pinned
implicitly. Each test fails when the branch it covers is disabled.
@LarsArtmann
LarsArtmann force-pushed the characterization-tests branch from fa798ab to 959c0c8 Compare October 24, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant