Skip to content

refactor(images): isolate image workflows and presentation - #560

Merged
jbeckwith-oai merged 4 commits into
mainfrom
codex/layout-image-workflows
Oct 20, 2026
Merged

jbeckwith-oai merged 4 commits into
mainfrom
codex/layout-image-workflows

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Image workflows still lived in pkg/custom, mixed with application policy. Move model discovery, picker/editor state, request preparation, saving/stream handling, previews/preferences, and shell setup mechanics into internal/commands/images.

Assembly retains registration order, request/output/error policy, saved-image route selection, and first-run worker admission/timeout. Prepared multipart state and stream cleanup remain feature-owned. Shared loading feedback moves to internal/output, terminal writer classification to internal/terminal, and image command ordering to internal/commands. Generated sources, provenance, dependencies, and the zero-budget policy are unchanged.

Feature unit tests stay with the implementation. Integration tests call application entrypoints directly, with test-only accessors for private feature state; there is no callback-injection test harness or forwarding-test layer. Assembly registers the feature directly without compatibility wrappers. Original test names are preserved; native CI package selectors and strict persistence inventories are updated without dropping cases. WSL runs the moved image contracts in their own integrity-checked Linux test binary. Demo script paths and the comparison patch target the moved source; the comparison build succeeds.

Validation:

  • All 235 image test entrypoints and assertion-call counts preserved through simplification; 55 offline WSL harness controls pass.
  • go test ./... -run '^$'; go test ./pkg/custom -count=1.
  • Focused image/loading contracts and race tests across images, output, and assembly, excluding the known local shell-setup failures below.
  • Public image command tests, including large JSON/stream payloads, uploads, cancellation, inline/saved previews, help, and completion ordering.
  • Windows amd64/arm64 test compilation for images, output, assembly, and the executable.
  • go vet ./internal/commands/images ./internal/output ./internal/terminal; go mod verify; formatting, diff, shell syntax, workflow selector/test-name inventory, and generation-boundary checks.
  • python3 scripts/image-picker-layout/build_two_column.py /tmp/cli-layout-images-two-column.

Local limitation: the complete image suite encounters 17 macOS shell/first-run test failures due to protected/unreadable extended metadata. Running those tests on an unchanged archive of base f5558be reproduces exactly the same 17 failing test roots. Assertions and hosted native coverage are preserved; no production workaround or test weakening is included. Hosted CI will verify native execution and the authoritative custom-code budget.

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 19, 2026 22:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T23:05:38.450802Z 57e95bc New commits
🔒 Security Review ✅ Completed 2026-10-19T23:06:16.839034Z 57e95bc New commits
ℹ️ 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 Oct 19, 2026 •

Copy link
Copy Markdown

Castiron custom code

Evaluated main: e539d9772a0db679dc2c5c1f77fec4df556c9980.

Trusted main policy: e539d9772a0db679dc2c5c1f77fec4df556c9980.

✅ No new custom-code files detected.

0 mixed files remain; 0 existing customizations changed.

Compared e539d9772a0d → 57e95bc2fa5e. Generated baselines verified.

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 39339094038 --repo openai/openai-cli \
  --name castiron-custom-code-39339094038-1 --dir /tmp/castiron-custom-code-39339094038-1
git apply --stat /tmp/castiron-custom-code-39339094038-1/custom-code.patch
cat /tmp/castiron-custom-code-39339094038-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin e539d9772a0db679dc2c5c1f77fec4df556c9980 57e95bc2fa5e857c47e28249f4a932d65fc66de3
python3 scripts/castiron/custom_code_report.py report \
  --base e539d9772a0db679dc2c5c1f77fec4df556c9980 \
  --head 57e95bc2fa5e857c47e28249f4a932d65fc66de3 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-57e95bc2fa5e
cat /tmp/castiron-custom-code-57e95bc2fa5e/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

@markstuart-oai markstuart-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 faafe4c9575f94a1d49133452d0e35604977b6b9. The WSL correction builds and runs the moved image tests from their new package while preserving the complete existing inventory. I found no further issues in the image refactor or the four-file correction.

Source review only; I did not run repository code. Current-head CI was still running at the inspected snapshot.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 19, 2026
@jbeckwith-oai
jbeckwith-oai removed this pull request from the merge queue due to a manual request Oct 19, 2026
@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 6ec6708 Oct 20, 2026
45 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/layout-image-workflows branch October 20, 2026 00:24
@openai-sdks openai-sdks Bot mentioned this pull request Oct 19, 2026
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.

3 participants