Skip to content

fix(output): honor case-insensitive explore format - #169

Merged
markstuart-oai merged 1 commit into
mainfrom
markstuart-oai/explorer-format-case
Sep 8, 2026
Merged

fix(output): honor case-insensitive explore format#169
markstuart-oai merged 1 commit into
mainfrom
markstuart-oai/explorer-format-case

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

--format EXPLORE and mixed-case spellings pass format validation, but list output compares the original value with explore. A successful list request then fails with Invalid format, while the lowercase spelling works.

Use the existing strings.ToLower convention 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:

  • Fresh clean-main CLI/localhost and PTY RED-before-GREEN proof for EXPLORE and ExPlOrE, with lowercase parity, exact stdout/stderr comparisons, limit/transform controls, and successful explorer row display and quit.
  • Focused tests cover casing, explicit-only warnings, output, transforms, bounded consumption, and deterministic TTY dispatch through an upstream error.
  • go test ./internal/...
  • go test ./... -run '^$' (compilation only)
  • Focused output/binary tests and output/explorer race checks
  • Native Linux PTY checks for explorer dispatch, pager colors/escaping, and binary output
  • go vet ./pkg/cmd ./internal/jsonview
  • go mod verify
  • ./scripts/lint (Go build)
  • Windows amd64 test cross-compilation for all packages; no native Windows execution
  • Two consecutive independent local review rounds without findings
  • Trusted-main custom-code check on the actual committed candidate: 495/1000 lines; isolation and generated-snapshot verification pass

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/test run 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 commit f7c7f1cdb3af25c1a6d10a8b0550ed4e842d5d75 has the published head 7f8d764e9a01809a222e1a28644c3d52a51b9ec4 and 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.

@markstuart-oai
markstuart-oai requested a review from a team as a code owner September 8, 2026 06:46
Copilot AI lite review requested due to automatic review settings September 8, 2026 06:46
@markstuart-oai markstuart-oai added the autoimprove Scoped automated improvement label Sep 8, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-09-08T06:47:36.907388Z 7f8d764 PR opened
🔒 Security Review Completed 2026-09-08T06:52:23.241831Z 7f8d764 PR opened
ℹ️ 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.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Castiron custom code

✅ No new custom-code files detected.

5 mixed files remain; 0 existing customizations changed.

Compared 265cf6378ab27f8d764e9a01. Generated baselines verified.

5 existing customizations unchanged
  • pkg/cmd/adminorganizationcertificate.go
  • pkg/cmd/cmd.go
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download 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.patch

Or 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.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Copilot AI 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.

🟢 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 via strings.ToLower.
  • Add regression tests covering mixed-case explore in 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 jbeckwith-oai 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.

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.

@markstuart-oai
markstuart-oai added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 774c240 Sep 8, 2026
17 checks passed
@markstuart-oai
markstuart-oai deleted the markstuart-oai/explorer-format-case branch September 8, 2026 19:45
@openai-sdks openai-sdks Bot mentioned this pull request Sep 8, 2026
Ultron09 pushed a commit to Ultron09/openai-cli that referenced this pull request Sep 9, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoimprove Scoped automated improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants