fix(output): honor case-insensitive explore format - #169
Conversation
Codex Review SummaryThis 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. |
Castiron custom code✅ No new custom-code files detected. 5 mixed files remain; 0 existing customizations changed. Compared 5 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 34197106553 --repo openai/openai-cli \
--name castiron-custom-code-34197106553-1 --dir /tmp/castiron-custom-code-34197106553-1
git apply --stat /tmp/castiron-custom-code-34197106553-1/custom-code.patch
cat /tmp/castiron-custom-code-34197106553-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 265cf6378ab2e6a27c17bc7c0b6a6cbe6dbd477b 7f8d764e9a01809a222e1a28644c3d52a51b9ec4
python3 scripts/castiron/custom_code_report.py report \
--base 265cf6378ab2e6a27c17bc7c0b6a6cbe6dbd477b \
--head 7f8d764e9a01809a222e1a28644c3d52a51b9ec4 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-7f8d764e9a01
cat /tmp/castiron-custom-code-7f8d764e9a01/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
There was a problem hiding this comment.
🟢 Approval recommended
The change is minimal, aligns iterator behavior with existing case-normalization conventions, and includes focused regression coverage for the previously failing scenario.
Pull request overview
This PR fixes a mismatch in handwritten output handling where --format explore was treated case-insensitively during validation, but ShowJSONIterator only recognized the lowercase string and would error after a successful request. It normalizes the iterator explore dispatch using the existing strings.ToLower convention and adds focused regression tests to ensure mixed-case variants behave the same as lowercase.
Changes:
- Normalize
ShowJSONIterator’s"explore"dispatch to be case-insensitive viastrings.ToLower. - Add regression tests covering mixed-case
explorein non-terminal output (fallback to JSON + explicit-format warning behavior) and terminal dispatch behavior when a TTY is available.
File summaries
| File | Description |
|---|---|
| pkg/cmd/cmdutil.go | Makes iterator explore dispatch case-insensitive to match existing output-format normalization patterns. |
| pkg/cmd/cmdutil_format_test.go | Adds targeted tests to prevent regressions for mixed-case explore behavior in both non-TTY fallback and TTY dispatch paths. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Reviewed the complete two-file change at the current exact head. The iterator path now applies the same case-insensitive format comparison already used by single-value output and format validation, while preserving the terminal explorer path, non-terminal JSON fallback and warning, transforms, and bounded iteration. The focused mixed-case regression tests pass; lint/build and go vet pass locally; whitespace checks pass; and all hosted checks, including the full mock-backed test suite, are green. The broader local pkg/cmd run could not use the absent localhost mock server, which is covered by the passing hosted test job. I found no blocking issue.
Automated Release PR --- ## [1.13.0](openai/openai-cli@v1.12.0...v1.13.0) (2026-09-08) ### Features * **api:** document GPT Image 2.5 models and image options ([openai#175](openai#175)) ([7a9994d](openai@7a9994d)) ### Bug Fixes * **autocomplete:** preserve literal completion-token arguments ([openai#171](openai#171)) ([01123b7](openai@01123b7)) * **output:** honor case-insensitive explore format ([openai#169](openai#169)) ([774c240](openai@774c240)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Summary
--format EXPLOREand mixed-case spellings pass format validation, but list output compares the original value withexplore. A successful list request then fails withInvalid format, while the lowercase spelling works.Use the existing
strings.ToLowerconvention at the shared iterator dispatch comparison. Case variants follow the existing interactive explorer path, or fall back to JSON with the same explicit-format warning for non-terminal output. The change leaves pagination, limits, transforms, and other output formats intact. Only handwritten output code and focused regression tests change.Validation
Local validation with Go 1.27.0 on Linux:
EXPLOREandExPlOrE, with lowercase parity, exact stdout/stderr comparisons, limit/transform controls, and successful explorer row display and quit.go test ./internal/...go test ./... -run '^$'(compilation only)go vet ./pkg/cmd ./internal/jsonviewgo mod verify./scripts/lint(Go build)Full LOCAL mock suite NOT RUN: the supported pinned Steady launcher reports
Missing or linked Steady cache. The previously blocked setup route was not retried.Hosted validation
Full CI passed with Go 1.25.14. The hosted
./scripts/testrun started the pinned Steady mock server, passed the package tests, cross-compiled tests for Windows, and completed cleanup. This was Windows compilation, not native execution. The tested merge commitf7c7f1cdb3af25c1a6d10a8b0550ed4e842d5d75has the published head7f8d764e9a01809a222e1a28644c3d52a51b9ec4and current main as its parents.Required checks and the trusted custom-code budget passed. Codex code and security reviews completed; Copilot reviewed both changed files and recommended approval with no comments. No bot findings remain.