Skip to content

fix(cli): allow Content Understanding conversion from stdin - #2318

Merged
afourney merged 2 commits into
microsoft:mainfrom
uczltw6:codex/fix-cu-stdin
Aug 31, 2026
Merged

fix(cli): allow Content Understanding conversion from stdin#2318
afourney merged 2 commits into
microsoft:mainfrom
uczltw6:codex/fix-cu-stdin

Conversation

@uczltw6

Copy link
Copy Markdown
Contributor

Summary

  • preserve the CLI's filename-optional stdin mode when --use-cu is enabled
  • let piped input use the existing convert_stream() dispatch path
  • add a regression test for Content Understanding stdin routing

Problem

The CLI documents piping input without a filename, but the --use-cu branch exits before reaching the shared stdin path. Content Understanding analyzes binary input and does not require a local file path, so this guard unnecessarily prevents cat report.pdf | markitdown --use-cu --cu-endpoint ....

The endpoint validation remains unchanged, and filename-based conversion is unaffected.

Tests

  • hatch test tests/test_cu_converter.py tests/test_cli_misc.py -q — 127 passed
  • hatch test -q — 337 passed, 4 skipped
  • Black 23.7.0 on both changed files — passed

OpenAI Codex assisted with identifying the inconsistent CLI branch and preparing the focused regression test; the behavior and test results were verified locally.

@afourney
afourney requested review from sapentia-ola and a balanced review from Copilot August 31, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Content Understanding conversion for piped stdin input.

Changes:

  • Removes the filename requirement for --use-cu.
  • Adds regression coverage for stdin routing through convert_stream().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/markitdown/src/markitdown/__main__.py Allows --use-cu without a filename.
packages/markitdown/tests/test_cu_converter.py Tests Content Understanding stdin dispatch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@afourney

Copy link
Copy Markdown
Member

Merged. Thanks.

@afourney
afourney merged commit a01f1cb into microsoft:main Aug 31, 2026
3 checks passed
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.

4 participants