Repository navigation
fix: preserve audio responses in generated commands - #439
petebacondarwin wants to merge 2 commits into
Conversation
commit: |
|
LGTM! |
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 282.2 ms | 10.5 ms | 269.4 ms | 309.5 ms |
| base | 274.5 ms | 3.4 ms | 269.2 ms | 281.2 ms |
Δ (PR vs base): ↑ +7.7 ms (+2.8%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
|
✅ Approved — The generator fix is correct and has regression tests for each changed path. The changeset now accurately says this only affects future command generation, which resolves the one earlier warning. The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed🚀 Release: ✅ LGTMRisk: Low
🔒 Security: ✅ LGTMNo security concerns. 📖 AGENTS.md: ✅ LGTMThe pull request follows the repository conventions: conventional commits, a patch changeset for a fix, and the generic emission rule kept in the generator plugin. 📋 Code Quality: ✅ LGTMThe
⚡ Performance: ✅ LGTMNo performance concerns. 📝 Documentation: ✅ LGTMNo documentation concerns. Reviewed commit: |
|
Review: 1 findings. Posted 2 inline suggestions covering case-insensitive audio MIME handling. |
The generator classified
audio/*responses as JSON, and operation descriptors could discard audio responses when their schemas omittedformat: binary. Recognize audio MIME types as binary in both paths so future commands generated for audio endpoints will write the exact response bytes to stdout.No commands generated from the currently pinned OpenAPI specification declare audio responses, and regeneration produces no tracked changes. This fixes future command generation without changing the behavior of any currently shipped command. Retain a patch changeset that explicitly describes this scope.
Add regression coverage for audio classification, generated POST handlers, operation descriptors without binary schema annotations, and the existing hand-written
cf ai runbyte output for MP3, WAV, PNG, and octet-stream responses.Related to #437. The current hand-written
cf ai runalready preserves non-JSON response bytes, and its expanded mocked-response tests pass before this generator fix. This PR does not establish that the reported live API behavior is fixed.Validation:
pnpm checkoutput-kind.test.ts,emit.test.ts,forge-model.test.ts, andai-run.test.ts