Skip to content

fix: preserve wrapped client stdout - #431

Open
panDing19 wants to merge 9 commits into
liaohch3:mainfrom
panDing19:fix/preserve-wrapped-stdout
Open

fix: preserve wrapped client stdout#431
panDing19 wants to merge 9 commits into
liaohch3:mainfrom
panDing19:fix/preserve-wrapped-stdout

Conversation

@panDing19

@panDing19 panDing19 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the wrapped client’s stdout unchanged for every launch mode
  • route claude-tap operational output—status, diagnostics, summaries, dashboard URLs, and launch information—to stderr unconditionally
  • remove the proposed --tap-preserve-stdout option and all Codex-specific output-mode detection
  • keep explicitly requested command data exports, including prompt export to -, on stdout
  • update stream-contract tests and documentation

Fixes #425.

Validation

  • uv run pytest tests/ -x --timeout=60 — 1090 passed, 26 skipped
  • uv run ruff check .
  • uv run ruff format --check .
  • uv lock --check
  • git diff --check

Evidence

This is a CLI stream-routing fix with no viewer/UI behavior change. Stream separation is covered directly by regression tests for CLI launch modes, prompt export, the exported async entry point, and concurrent host-task stdout. The previously attached dashboard screenshot was removed because it showed trace capture rather than stdout/stderr separation and therefore did not prove this fix.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5f85b5562

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated
@panDing19
panDing19 force-pushed the fix/preserve-wrapped-stdout branch from e466c13 to 9331da5 Compare August 14, 2026 09:04
@panDing19

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9331da5bc5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated
@panDing19

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a54b47d3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated
@panDing19

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ade35b56e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated
Comment thread claude_tap/cli.py Outdated
@panDing19

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: c1f4aa11de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@liaohch3

Copy link
Copy Markdown
Owner

Thanks for the fix. I suggest removing the public --tap-preserve-stdout option: the affected Codex machine-readable/protocol modes can already be detected automatically, and the extra flag adds API surface without a clear user-facing need.

Please keep the automatic detection, but consider renaming _codex_debug_outputs_json to something like _codex_debug_is_machine_readable, since the overall handling also covers MCP/app-server and stdio protocol output, not only JSON. Normal interactive Markdown/text output should remain unchanged.

@liaohch3

Copy link
Copy Markdown
Owner

Correction to my previous comment: I think the entire preserve-stdout path is unnecessary for claude-tap, not just the public flag. Please remove the --tap-preserve-stdout option and the internal auto-detection/redirect logic as well, unless there is a concrete supported use case requiring claude-tap to wrap machine-readable Codex stdout. Normal interactive Markdown/text output should remain unchanged.

@liaohch3

Copy link
Copy Markdown
Owner

Final clarification: the desired contract is unconditional, with no alternate state or mode detection. claude-tap operational output (status, dashboard/startup messages, summaries, diagnostics) should always go to stderr, while the wrapped client stdout should always pass through unchanged. In that model, the old stdout behavior is simply a bug, so please remove both the public --tap-preserve-stdout flag and the internal Codex-mode detection. Keep only any explicitly requested data export that is intentionally part of the command output (for example, prompt export to -).

@panDing19 panDing19 changed the title fix: preserve machine-readable client stdout fix: preserve wrapped client stdout Aug 14, 2026
@panDing19

Copy link
Copy Markdown
Contributor Author

Addressed the final clarification in e51ef04: claude-tap operational output now always goes to stderr, wrapped-client stdout always passes through unchanged, and the public flag plus all internal mode detection have been removed. Explicit prompt export to - remains on stdout. Updated the broader E2E/locking expectations without moving genuine child output. Local validation: 1089 passed, 26 skipped; Ruff check/format, lock check, and git diff --check all pass. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e51ef0463c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32a0a08e6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread claude_tap/cli.py Outdated
@panDing19

Copy link
Copy Markdown
Contributor Author

Addressed in ffd97c9: removed process-wide redirect_stdout, routed claude-tap operational messages through an explicit shared stderr helper, kept prompt export payloads on the captured command stdout, and added a concurrency regression test proving unrelated host-task stdout is untouched. Validation: uv run ruff check ., uv run ruff format --check ., uv lock --check, and full uv run pytest tests/ --timeout=60 (1090 passed, 26 skipped).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review


P1 Badge Provide evidence that demonstrates stream separation

When this image is used as evidence for wrapped-client stdout preservation, it shows only dashboard trace entries—including failed /v1/models and /v1/responses requests—and contains no observation of the client’s stdout versus claude-tap’s stderr, so it cannot verify the claimed output-routing fix. Replace or supplement it with compliant real-run evidence where the two streams are separately observable. .agents/docs/standards/screenshot-standards.mdL23-L27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@panDing19

Copy link
Copy Markdown
Contributor Author

Addressed the evidence finding in 4216317: removed the dashboard screenshot because it showed trace capture rather than stdout/stderr separation, and updated the PR body to state that this non-UI CLI contract is verified directly by the stream-routing regression tests. I did not replace it with handcrafted or synthetic evidence. Validation remains green: Ruff check/format, lock check, and the full suite (1090 passed, 26 skipped). @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 4216317fac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

bug: status output corrupts structured stdout from wrapped clients

2 participants