Repository navigation
fix(cli): emit JSON envelope for local media extraction - #570
officialasishkumar wants to merge 1 commit into
Conversation
`summarize <local audio/video> --extract --json` exited successfully but wrote the plain transcript to stdout, so JSON consumers failed to parse the result. The media presenter's extraction branch wrote `extracted.content` directly without checking JSON mode; only the `--slides` path (which goes through the URL flow) produced the envelope. When `--json` is set, local media extraction now writes the standard `input`/`env`/`extracted`/`prompt`/`llm`/`metrics`/`summary` envelope. `input` uses the same file/asset-url shape as media summaries, and `extracted` carries the full transcript result (content, transcriptionProvider, transcript segments with `--timestamps`, etc.), matching what the URL and `--slides` paths already expose. Plain text extraction output is unchanged. Fixes steipete#562
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR emits the standard JSON envelope when extracting transcripts from local audio or video with --json. Example: Run summarize a.wav --extract --json --metrics off.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR fixes a documented JSON-output bug still present on main; no introduced correctness or security defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe CLI routes acquired media through transcription, then passes the extracted result to the media presenter, which writes text or JSON to stdout. flowchart LR
A[Local audio or video] --> B[CLI input acquisition]
B --> C[Media execution]
C --> D[Transcript provider]
D --> E[Media presenter]
E --> F[JSON envelope or text stdout]
Technical reviewBest possible solution: Emit the existing JSON envelope in the media presenter while preserving full transcript metadata and ordinary text extraction. Do we have a high-confidence way to reproduce the issue? Current-main source independently establishes the failure, supported by the linked reporter’s release reproduction; no target code or tests were run during this read-only review. Is this the best way to solve the issue? The repair belongs in presentation because transcription already succeeds, and reusing the existing input helper preserves the established JSON contract without changing provider behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against aaccb7c9c30e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 11, 2026, 7:16 AM ET / 12:16 UTC. |
Local audio/video extraction ignores `--json`, Markdown and transcription diagnostics misidentify their providers, and the Codex adapter pins an unavailable default while hiding backend failure reasons. Optional OpenRouter diagnostics can also wait beyond the request deadline, and Windows uninstall deletes launcher files even when Task Scheduler refuses deletion. This consolidates and finishes #559, #560, #570, and #571, retaining their authors' fixes and adding truthful extraction provenance, supported Codex default selection, and regression coverage. It also corrects the YouTube fallback order and incorporates the small gateway documentation example from #568 through the existing OpenAI-compatible transport. Existing string-returning library converters remain compatible; explicitly requested Codex models remain explicit. Validation: - The new regression set fails on unmodified main across six test files, including denied task deletion, stalled HTTP response bodies, local media JSON, provenance, and Codex failure/default handling. - Full `pnpm run build` and `pnpm run check` passed on Linux/Node 24: 605 test files passed, 3,909 tests passed, 49 skipped; coverage 94.52% lines and 85.67% branches. - Independent Codex P0–P2 autoreview: scoped clean after fixing one stale test assertion. - No version bump, release, deployment, or Chrome Web Store operation. Addresses #561 Addresses #562 Addresses #563 Addresses #564 Addresses #565 Addresses #566 Addresses #567 Co-authored-by: Sebastien Tardif <[email protected]> Co-authored-by: Vincent Peng <[email protected]> Co-authored-by: Asish Kumar <[email protected]> Co-authored-by: Nirupam Bhowmick <[email protected]>
|
Thanks for the focused contribution. Incorporated into #572 with co-author and changelog credit. The WAV and MP4 regressions fail on main and now pass. Local extract-only JSON uses the shared input shape and the documented envelope. Full build/check passed (3,909 tests), and #572 passed exact-head CI before landing. Closing this superseded branch. |
Summary
summarize <local audio/video> --extract --jsonexits 0 but writes the plain transcript (Transcript:\n…) to stdout, so anything that parses the documented JSON envelope fails. Only the--slidesvariant produced JSON, because it runs through the URL flow. The cause is inpresentMediaFileResult: its extraction branch wroteextracted.contentwithout checking JSON mode.With
--json, local media extraction now writes the standard envelope (input,env,extracted,prompt,llm,metrics,summary):inputuses the samefile/asset-urlshape as local media summaries (it reusesbuildAssetJsonInput, which is now exported).extractedis the full transcript result, so.extracted.content,.extracted.transcriptionProviderand the--timestampssegment fields look the same as on the URL and--slidespaths.prompt,llmandsummaryarenull.metricsfollows--metrics, as it does on the other extract-only JSON paths.Output without
--jsonis unchanged.Fixes #562
Validation
tests/cli.asset.audio-file.test.tsrun--extract --jsonon a local.wavand.mp4with a stubbed ONNX transcriber. They fail onmainbecause stdout is not JSON, and pass with this change.tests/cli.asset.media-file-options.test.tsalso checks the new extraction args.pnpm check: formatting, localization, lint, typecheck and coverage all pass. 605 test files passed, 30 skipped; 3,896 tests passed, 49 skipped.node dist/cli.js a.wav --extract --json --transcriber parakeet …): stdout parses as one JSON value withinput.kind: "file",extracted.content: "Transcript:\nhello transcript",extracted.transcriptionProvider: "onnx-parakeet",llm: null,summary: null. Running the same command without--jsonstill prints the plain transcript.No new options, configuration or dependencies.