Skip to content

Import upstream #840, and pass --effort to native reviews (from #837) - #28

Merged
Edo771977 merged 5 commits into
mainfrom
claude/focused-carson-khonz0
Nov 11, 2026
Merged

Edo771977 merged 5 commits into
mainfrom
claude/focused-carson-khonz0

Conversation

@Edo771977

Copy link
Copy Markdown
Owner

This imports upstream openai#840 as a merge commit, keeping upstream authorship. It also adapts one piece of upstream openai#837, which fixes fork issue #19.

openai/codex-plugin-cc#840: branch review pinned to commits

buildBranchComparison now resolves HEAD and the base to commits once (rev-parse --verify --end-of-options <ref>^{commit}) and builds both ranges from those SHAs. The adversarial-review guidance tells Codex to read surrounding files with git show <commit>:<path>. This fixes two problems that the fork also had:

  • switching branches while a review runs could change what Codex sees;
  • a base given as an annotated tag was not peeled to its commit.

--end-of-options also keeps a base starting with - from being parsed as a git option. It needs git 2.24 or newer.

  • Conflict in lib/git.mjs: I took upstream's options.currentBranch and kept the fork's NUL-separated file list (listFilesZ, from fix: keep the status column and non-ASCII file names in review context openai/codex-plugin-cc#817).
  • Conflict in tests/git.test.mjs: both sides' imports and tests are kept.
  • Adapted tests: upstream's two snapshot tests switch branches when they see git diff --name-only as the first git arguments. This fork runs git as git -c core.quotePath=false …, so that trigger never fired. The trigger now skips that prefix; nothing else in the tests changed.
  • Check: restoring the fork's previous lib/git.mjs makes three of the imported tests fail.

/codex:review --effort reaches Codex (adapted from openai/codex-plugin-cc#837)

Before this change, --effort was validated and then dropped (fork issue #19). A native review starts a thread and calls review/start. It never sends turn/start, which is the only request that carries a per-turn effort.

The effort now goes on thread/start as the config override model_reasoning_effort:

  • It is merged into any config the access parameters already carry. The --read-root permission profile uses that same field, which is how we know thread/start accepts config.
  • It is sent only when --effort is given, so otherwise the user's config.toml still decides.

Nothing else from openai#837 is taken. Its other changes are already in this fork in its own form: --sandbox, --model/--effort on reviews, atomic writes, gating detached workers, and interrupting a disconnected client's turns. Its max effort stays out, as with openai#761.

  • Test: a new test checks that the override reaches thread/start and that nothing is sent without --effort. Removing the effort from the companion call makes it fail.
  • Not verified against a real codex, which is not available here.

README now describes the effort as set on the review's thread, instead of saying it is dropped. The CHANGELOG is updated too.

Verification

  • node --test tests/*.test.mjs: 451/451 on two full runs. No broker was left running afterwards.
  • npx tsc -p tsconfig.app-server.json: clean.

Not imported


Generated by Claude Code

Linxiushen and others added 5 commits November 9, 2026 21:45
…isions

Conflicts:
- plugins/codex/scripts/lib/git.mjs, collectBranchContext: upstream's
  options.currentBranch is taken, and the fork's NUL-separated file list
  (listFilesZ, from openai#817) is kept.
- tests/git.test.mjs: both sides' imports and tests are kept. Upstream's
  two snapshot tests switch branches when they see `git diff --name-only`
  as the first arguments; this fork runs git as
  `git -c core.quotePath=false ...`, so the trigger never fired and both
  failed. The trigger now looks past that prefix. Nothing else in them
  changes.

Restoring the fork's previous lib/git.mjs fails three of the imported
tests. Note that --end-of-options needs git 2.24 or newer.
…ng effort

`/codex:review --effort <level>` was validated and then dropped (fork
issue #19): a native review starts a thread and calls review/start, and
never sends turn/start, the only request that carries a per-turn effort.

Adapted from upstream openai#837. Only this piece is taken; the rest of that PR
(--sandbox, --model/--effort on reviews, atomic writes, gating detached
workers, interrupting a disconnected client's turns) is already in this
fork in its own form. The effort goes on thread/start as the config
override model_reasoning_effort. It is merged into any config the access
parameters already carry (the --read-root permission profile uses that
same field, which is how we know thread/start accepts it), and it is only
sent when set, so without --effort the user's config.toml still decides.

Not verified against a real codex here. The new test checks the
override reaches thread/start, and that nothing is sent without --effort;
dropping the effort in the companion fails it.

Also records the openai#840 import in README and CHANGELOG.
@Edo771977
Edo771977 merged commit ed2a119 into main Nov 11, 2026
1 check passed
@Edo771977
Edo771977 deleted the claude/focused-carson-khonz0 branch November 11, 2026 18:20
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