Skip to content

fix(cli): preserve spaced output flag values - #4823

Merged
morluto merged 6 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-valued-output-argument
Oct 17, 2026
Merged

morluto merged 6 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-valued-output-argument

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem and outcome

rea --filter-output --format=json providers --json treats --format=json as the filter's literal value in Incur. REA's token-by-token normalizer split that owned value into --format, json, leaving json to be parsed as a command. The equivalent equals form already worked.

Normalize once with a forward scan that preserves the next nonempty token of each spaced valued output flag. Split equals forms only when the token is an option, preserving Incur's existing missing/empty-value semantics. The shared validator and streaming output consumers continue to use the same normalized arguments.

Merge resolution

Merged main at 666842434 in 34e347703. Main already includes #4824's French README correction, portable cache staging repair and composed Electron cleanup assertions. Retain those versions and remove the superseded build-job cache-retention workaround. Relative to current main, only src/cliOutput.ts and tests/boundary/cli/cliOutput.test.ts change.

Validation

Executed for the merge resolution on macOS with pinned Node 24.18.0:

  • npm run test:focused -- tests/boundary/cli/cliOutput.test.ts tests/boundary/process/electronLaunchRejections.test.ts: 38/38 passed, including 25 CLI output tests and 13 Electron launch rejection tests. This exercises the compiled public CLI, spaced/equals forms, malformed-filter and missing-value controls, structured output, artifact diagnostics, and main's composed cleanup assertions.
  • npm run check:fast: typecheck and lint passed; pre-push repeated the check successfully.
  • Pre-commit formatting/lint and git diff origin/main...HEAD --check: passed.

The author's original Windows regressions failed before the fix (5 failed / 20 passed) and passed afterward (25/25). Those results and the earlier full npm run check apply to the pre-merge revision; a full check and Windows tests were not rerun for this merge resolution. Hosted CI for the new head is pending. Electron launch tests cover controlled failures and local Playwright failure paths, not a real application investigation.

Routine CLI correctness fix, no separate capability scope decision required. No MCP schema, provider, dependency, generated metadata, authority or release changes. Prepared with AI assistance. No separate issue was opened for this reproduced residual normalizer defect.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@morluto
morluto marked this pull request as ready for review October 17, 2026 19:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T20:02:03.271887Z beb1064 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Retain main's portable cache staging and composed Electron cleanup assertions from morluto#4824. Remove the superseded cache-retention workaround so the remaining diff only preserves spaced output flag values and their regressions.
@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Preserves flag-shaped values passed after spaced output flags instead of splitting those values as separate options.

  • Output flags keep spaced values intact even when they look like flags.

Reviews (1) · Last reviewed commit: "fix(cli): resolve output argument merge ..." · Reviewed by Greptile

@morluto
morluto merged commit 9e372c6 into morluto:main Oct 17, 2026
27 of 32 checks passed
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thank you, @ShuaixinHuang, for tracking down why a spaced --filter-output value like --format=json got split and misread as a command. Preserving the option’s next token fixes that invocation without changing Incur’s existing miss handling.

@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants