Skip to content

fix: repair codex invocation and restore model role routing - #7

Open
metaphorics wants to merge 11 commits into
mainfrom
fix/reflector-routing-and-codex-argv
Open

fix: repair codex invocation and restore model role routing#7
metaphorics wants to merge 11 commits into
mainfrom
fix/reflector-routing-and-codex-argv

Conversation

@metaphorics

@metaphorics metaphorics commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

The reflector has not been reviewing anything. Every codex exec call passed --full-auto, a flag codex-cli 0.147.0 rejects during argument parsing, so the child died before doing any work. invokeCodex treats a non-zero exit as fail-open and returns "", and every caller reads that as "no verdict" and settles. The bash pre-guard waved through every command it was asked to gate, the Stop gate never blocked, and code-change review was dropped. Not degraded — off, on both the OMP and Claude/Cursor surfaces.

Nothing caught it because the suite stubs codex with a fake that ignores argv. All 141 tests passed against an argv the real CLI refuses.

Separately, the OMP surface had drifted off its documented model routing: the Stop gate and precompact metacognition ran on the everyday model instead of frontier, FRONTIER_MODEL was declared but unreachable, and seven tests pinning exact (model, effort) pairs were red on main.

Both are fixed, and both now have a guard that fails if they come back.

Why every gate went quiet

flowchart LR
  A["codex exec --full-auto"] --> B["exit != 0<br/>unexpected argument"]
  B --> C["invokeCodex returns empty string"]
  C --> D["if (!raw) return undefined"]
  D --> E["bash guard:<br/>command runs unreviewed"]
  D --> F["Stop gate:<br/>settles, never blocks"]
  D --> G["code review:<br/>advisory dropped"]
Loading

--sandbox read-only is what actually provides the read-only guarantee, as AGENTS.md already said, so the flag bought nothing even on a codex version that accepted it. Removed from both surfaces.

Model routing restored

a744dac ("update") retiered every preset and carried no rationale. Reverted to the documented role-to-preset map:

Preset On main This PR
CODE_REVIEW luna@high terra@medium
CODE_REVIEW_HARD terra@medium sol@medium
CODE_REVIEW_COMPLEX terra@high sol@high
BASH_FAILURE luna@high terra@medium
BASH_GUARD luna@medium luna@low
STOP_REVIEW terra@medium sol@medium
PRECOMPACT terra@low sol@low

Reverting rather than updating the doc, because four independent things agreed the doc was right: AGENTS.md states load-bearing product reasons for each rule, the sibling Python surface still followed them, seven tests pinned the exact pairs, and the commit made no argument for the change. A doc is only stale when something argues against it.

The practical cost of the drift: STOP_REVIEW is the only post-hoc gate that can block, and it was running on the everyday model to save cost.

Guards added

Role cardinality. ROUTED_MODELS derives every preset's model, and a test asserts three distinct roles remain reachable. The per-preset tests own role identity, but each pins one preset, so none of them catches a sweep that retiers everything and updates its own expectation in the same edit — which is exactly what landed.

Cardinality rather than literal slugs, because AGENTS.md expects the role constants to be re-pinned when OpenAI renames the lineup, and a slug list would fail that legitimate edit. Asserting against the constants instead would be worse: aliasing FRONTIER_MODEL to DEFAULT_MODEL is the collapse, and both sides would dedupe together and pass.

Real-CLI flag acceptance. The OMP argv moved into an exported codexExecArgs, and a test checks every long flag against the installed codex exec --help — local, no auth, skipped when codex is absent. This catches any rejected flag, not just this one, and closes the hole that let a fake-codex suite bless a broken argv.

Validation

Check Before After
bun test omp/codex-reflector.test.ts 133 pass / 7 fail 143 pass / 0 fail
python3 scripts/codex-reflector.py --test-parse 67/67 67/67
ruff check scripts/ 4 (pre-existing) 4 — unchanged

Both guards were mutation-verified rather than assumed:

  • Collapsing the frontier presets onto DEFAULT_MODEL fails the cardinality test; renaming all three slugs passes it.
  • Reintroducing --full-auto fails both codexExecArgs tests.

Against the real binary: the old argv fails at parse with error: unexpected argument '--full-auto' found; the new argv launches OpenAI Codex v0.147.0 and reaches the API.

A full review round trip is unconfirmed — the Codex account is over its usage limit until Aug 8. The proof here covers argument acceptance, which is the layer this PR fixes. Worth one live review once quota resets.

Commit 9a29ca0 was verified green in isolation before 22755b7 was layered on, so either can be bisected to independently.

Release manifests

Each commit carries its own paired bump per AGENTS.md: OMP 1.3.61.3.8, Claude 1.2.101.2.12 across all three fields with lastUpdated refreshed. Cursor 1.2.51.2.6, bumped only in the commit that touches the shared Python hook.

Known gap, not addressed here

Nothing in this repo runs the suite before a push, which is how a commit with seven failing tests reached main. These guards catch these two regressions; a pre-push hook would catch the class. Left out deliberately to keep this PR scoped.


Summary by cubic

Fixes a no-op Codex invocation by removing --full-auto, restores model role routing, and retiers OMP complex reviews to frontier@high to stay under the 30s host cap with a 26s/28s timeout hierarchy.

  • Bug Fixes

    • Removed --full-auto from both OMP/Python codex exec; exported codexExecArgs and added a --help validation that checks every long flag (skips only when codex is missing; fails on non‑zero exit or other spawn errors).
    • Restored routing and tightened guards: base review default@medium; hard frontier@high; complex now frontier@high on OMP (Python stays frontier@xhigh); Stop review and precompact on frontier; BASH_FAILURE to default@low; BASH_GUARD to fast@low. Added ROUTED_MODELS cardinality test and pinned classify routes to exact category/model/effort triples; ensured CODEX_REFLECTOR_MODEL overrides model only. Updated AGENTS.md with the frontier‑high rule for OMP.
    • Set Codex timeout to 26s and handler budget to 28s (<30s harness). Opt‑in smokes now assert frontier‑high completes under CODEX_TIMEOUT_MS/HANDLER_BUDGET_MS.
    • Strengthened the live handler smoke to require a valid verdict header and a non‑empty review body.
  • Dependencies

    • Bumped codex-reflector-omp to 1.3.12, Claude plugin to 1.2.16, Cursor plugin to 1.2.6.

Written for commit 2c32762. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Improvements

    • Updated automated review presets for more appropriate analysis across review and lifecycle checks.
    • Increased available review time for complex and security-sensitive changes.
    • Improved command-line compatibility while preserving read-only execution and repository-check behavior.
  • Bug Fixes

    • Added validation to ensure generated command arguments remain compatible with the installed CLI.
  • Chores

    • Updated package and plugin versions and refreshed marketplace metadata.
    • Expanded automated coverage for reviewer routing, effort selection, timeout behavior, and secure command execution.

a744dac retiered every preset in the OMP surface, moving the Stop review,
precompact metacognition, and both risk-escalated code reviews off the
frontier role and pushing base review and bash-failure diagnostics onto
fast. FRONTIER_MODEL was left declared but unreachable, collapsing the
three-role partition AGENTS.md mandates, and the sibling Python surface
still routed those presets to frontier. Seven tests pinning the exact
(model, effort) pairs went red and shipped that way.

Revert the preset block to the documented role->preset map. The commit
carried no rationale and nothing argued against the doc, so the code was
the side that drifted.

Add ROUTED_MODELS, a derived array of every preset's model, and assert its
distinct-role count is three. The per-preset tests own role identity but
each pins one preset, so none of them catches a sweep that retiers
everything and updates its own expectation in the same edit. Cardinality
rather than literal slugs, because AGENTS.md expects the role constants to
be re-pinned on a lineup rename; asserting against the constants instead
would dedupe alongside an aliased role and pass on the very collapse it
guards. Verified both ways: the guard fails on the collapse and survives a
rename of all three slugs.
codex-cli 0.147.0 rejects --full-auto outright: `codex exec ... --full-auto`
exits with "unexpected argument '--full-auto' found" before doing any work.
invokeCodex treats a non-zero exit as a fail-open and returns "", so every
caller hit its `if (!raw) return undefined` path. The bash pre-guard let
every command through, the Stop gate settled without ever blocking, and
code-change review was dropped. The reflector was a complete no-op on both
surfaces, not a degraded one.

--sandbox read-only is the read-only guarantee, as AGENTS.md already said,
so the flag bought nothing even on a codex that accepted it.

The suite could not see this: it stubs codex with a fake that ignores argv,
so all 141 tests passed against an argv the real CLI refuses. Move the OMP
argv into an exported codexExecArgs and check every long flag against the
installed `codex exec --help`, which is local and needs no auth. That
catches any rejected flag, not just this one, and skips when codex is
absent.

Verified against the real binary: the old argv fails at parse, the new argv
launches Codex v0.147.0 and reaches the API. A full round trip is
unconfirmed - the account is over its usage limit until Aug 8 - so the
proof covers argument acceptance, which is the layer this fixes.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change updates reviewer routing, centralizes read-only Codex arguments, removes --full-auto, adds CLI and timeout validation, updates safety guidance, and increments package and plugin metadata.

Changes

Codex routing and release updates

Layer / File(s) Summary
Reviewer model routing
omp/codex-reflector.ts, omp/codex-reflector.test.ts, AGENTS.md
Reviewer presets now use updated model and effort assignments. Tests verify complete routing presets, frontier-high escalation, and distinct routed models.
Codex argument safety
omp/codex-reflector.ts, omp/codex-reflector.test.ts, scripts/codex-reflector.py, AGENTS.md
Codex arguments now use codexExecArgs without --full-auto. Tests validate read-only execution, repository-check bypassing, installed CLI flags, and opt-in timeout-bounded execution.
Release metadata
.claude-plugin/*, .cursor-plugin/*, package.json
Package and plugin versions were updated. Claude marketplace metadata now records 2026-08-10 as the last update date.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OMPTests
  participant codexExecArgs
  participant codexReflector
  participant CodexCLI
  OMPTests->>codexExecArgs: Generate Codex flags
  codexReflector->>codexExecArgs: Build invocation arguments
  codexReflector->>CodexCLI: Execute read-only command
  OMPTests->>CodexCLI: Validate flags against --help
  CodexCLI-->>OMPTests: Return validation and smoke-test results
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two primary changes: repairing Codex invocation and restoring model role routing.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reflector-routing-and-codex-argv

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@omp/codex-reflector.test.ts`:
- Around line 250-259: Update the `codex exec --help` validation in the test so
it skips only when `spawnSync` reports an `ENOENT` error, indicating Codex is
not installed. Fail the test for other spawn errors and for non-zero exit
statuses, while retaining the existing flag checks when help succeeds.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 53980b88-94b2-4acd-8cf0-8ec285c71fe4

📥 Commits

Reviewing files that changed from the base of the PR and between a744dac and 22755b7.

📒 Files selected for processing (9)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • .cursor-plugin/marketplace.json
  • .cursor-plugin/plugin.json
  • AGENTS.md
  • omp/codex-reflector.test.ts
  • omp/codex-reflector.ts
  • package.json
  • scripts/codex-reflector.py
💤 Files with no reviewable changes (1)
  • scripts/codex-reflector.py

Comment thread omp/codex-reflector.test.ts

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 9 files

Architecture diagram
sequenceDiagram
    participant Client as Agent (Claude/Cursor)
    participant OMP as OMP Hook (invokeCodex)
    participant Python as Python Hook (invoke_codex)
    participant Args as codexExecArgs Builder
    participant CLI as codex exec CLI
    participant TempFile as Temp Output File
    participant Gate as Review Gate (bash/stop)
    
    Note over Client,Gate: NEW: Codex invocation flow with validated flags
    
    alt OMP Surface
        Client->>OMP: review request (category, content)
        OMP->>Args: codexExecArgs(effort, model, outPath)
        Note over Args: NEW: Centralized argv builder, exported for testing
        Args-->>OMP: [exec, --sandbox, read-only, --skip-git-repo-check, --ephemeral, -c, -m, -o, -]
    else Python Surface
        Client->>Python: review request
        Python->>Python: Build inline argv
        Note over Python: --full-auto removed
    end
    
    Note over OMP,Python: Both surfaces now use same flag set (no --full-auto)
    
    OMP->>CLI: spawn("codex", args) with stdin prompt
    Python->>CLI: subprocess(["codex", ...]) with stdin prompt
    
    alt CLI accepts flags
        CLI->>CLI: Parse accepted flags
        CLI->>CLI: Run model with sandbox read-only
        CLI->>TempFile: Write review output
        CLI-->>OMP: Exit 0
        OMP->>TempFile: Read output
        TempFile-->>OMP: Review text
        OMP-->>Client: Verdict (PASS/FAIL)
    else CLI rejects flag
        Note over CLI: --full-auto would cause this
        CLI-->>OMP: Exit non-zero
        OMP->>OMP: invokeCodex returns ""
        OMP-->>Client: undefined (fail-open)
        Note over Client,Gate: Gate settles, never blocks (silent no-op)
    end
    
    Note over Client,Gate: Model routing flow (restored)
    
    Client->>OMP: stopReview() / precompact()
    OMP->>OMP: Lookup preset in ROUTED_MODELS
    Note over OMP: NEW: stopReview → FRONTIER_MODEL, precompact → FRONTIER_MODEL
    
    alt Stop Review
        OMP->>OMP: STOP_REVIEW: model=FRONTIER_MODEL, effort=medium
        Note over OMP: Previously was DEFAULT_MODEL
    else Precompact metacognition
        OMP->>OMP: PRECOMPACT: model=FRONTIER_MODEL, effort=low
        Note over OMP: Previously was DEFAULT_MODEL
    end
    
    Note over OMP: Guards (test-time only)
    
    Test->>Args: codexExecArgs(medium, gpt-5.6-sol, /tmp/out)
    Args-->>Test: flags array
    
    Test->>Test: Assert --sandbox read-only present
    Test->>Test: Assert --skip-git-repo-check present
    Test->>Test: Assert --full-auto absent
    
    alt codex CLI available locally
        Test->>CLI: spawnSync("codex", ["exec", "--help"])
        CLI-->>Test: help text
        Test->>Test: Verify every --flag is in help text
    else codex not installed
        Test->>Test: Skip flag validation
    end
    
    Test->>Test: Check ROUTED_MODELS cardinality
    Note over Test: Assert exactly 3 distinct models reachable
    Note over Test: Catches role collapse (e.g. FRONTIER_MODEL = DEFAULT_MODEL)
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread omp/codex-reflector.ts Outdated
Comment thread omp/codex-reflector.ts Outdated
Comment thread omp/codex-reflector.test.ts Outdated
@metaphorics

Copy link
Copy Markdown
Collaborator Author

@coderabbitai ultrareview

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@metaphorics I will perform a complete review of PR #7. I will check the Codex invocation, OMP model routing, regression guards, and release metadata.

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 31 minutes.

@metaphorics

Copy link
Copy Markdown
Collaborator Author

@coderabbitai ultrareview

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

@metaphorics I will perform a complete review of PR #7. I will inspect the Codex invocation changes, OMP model routing, regression tests, and release metadata.

✅ Action performed

Full review finished.

@metaphorics

Copy link
Copy Markdown
Collaborator Author

@codex review

@metaphorics

Copy link
Copy Markdown
Collaborator Author

@coderabbitai ultrareview

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

@metaphorics I will perform a complete review of PR #7. I will recheck the Codex invocation changes, OMP model routing, regression guards, and release metadata.

✅ Action performed

Full review finished.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 22755b7767

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- BASH_FAILURE: default@medium -> default@low to match Python surface
  and reduce post-hoc diagnostic cost (thread PRRT_kwDORKAmpc6XQIdu).

- Flag test: skip only on ENOENT (codex not installed), fail on any
  other spawn error or non-zero exit; preserves validation in CI while
  catching broken installs (threads PRRT_kwDORKAmpc6XQId6, CodeRabbit body).
@metaphorics
metaphorics force-pushed the fix/reflector-routing-and-codex-argv branch from d2601db to 61373b9 Compare August 8, 2026 17:21
@metaphorics

Copy link
Copy Markdown
Collaborator Author

Update the codex exec --help validation in the test so it skips only when spawnSync reports an ENOENT error, indicating Codex is not installed. Fail the test for other spawn errors and for non-zero exit statuses, while retaining the existing flag checks when help succeeds.

Addressed in 61373b9: omp/codex-reflector.test.ts:250-260 now skips only on ENOENT, throws on any other spawn error, and asserts help.status === 0 before checking flags. Thread PRRT_kwDORKAmpc6XQId6 resolved.

3 issues found across 9 files — (cubic summary) retiering hard/complex to frontier@medium/high vs Python high/xhigh; BASH_FAILURE default@medium vs low; flag-acceptance early-return

All three covered inline: BASH_FAILURE fixed (thread PRRT_kwDORKAmpc6XQIdu), flag guard fixed (PRRT_kwDORKAmpc6XQId6), hard/complex declined with handler-budget harm cited (PRRT_kwDORKAmpc6XQIdz).

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
omp/codex-reflector.test.ts (1)

220-235: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Assert the complete model-routing contract.

The distinct-role check can pass with an incorrect model or effort assignment. Assert the exact model/effort pair for every preset, including Stop as frontier@medium. Add a test that preserves an explicit effort override. Clear and restore CODEX_REFLECTOR_MODEL around preset assertions so ambient state cannot mask the defaults.

As per coding guidelines, model-routing tests must assert exact model/effort pairs, cover Stop frontier@medium and override effort preservation, and isolate ambient CODEX_REFLECTOR_MODEL during preset assertions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@omp/codex-reflector.test.ts` around lines 220 - 235, Extend the ROUTED_MODELS
tests to assert each preset’s exact model/effort pair, including Stop using
frontier@medium, rather than only checking distinct-role cardinality. Add
coverage proving an explicit effort override is preserved, and clear
CODEX_REFLECTOR_MODEL before preset assertions, restoring the original ambient
value afterward so defaults are tested reliably.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@omp/codex-reflector.test.ts`:
- Around line 220-235: Extend the ROUTED_MODELS tests to assert each preset’s
exact model/effort pair, including Stop using frontier@medium, rather than only
checking distinct-role cardinality. Add coverage proving an explicit effort
override is preserved, and clear CODEX_REFLECTOR_MODEL before preset assertions,
restoring the original ambient value afterward so defaults are tested reliably.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42f5ac67-e3aa-40c8-bf0a-a5c32ba1264e

📥 Commits

Reviewing files that changed from the base of the PR and between 22755b7 and d2601db.

📒 Files selected for processing (2)
  • omp/codex-reflector.test.ts
  • omp/codex-reflector.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • omp/codex-reflector.ts

Restore OMP hard/complex presets to match Python surface
_ME_CODE_REVIEW_HARD=frontier@high and _ME_CODE_REVIEW_COMPLEX=frontier@xhigh
per AGENTS parity; update gateModelEffort tests accordingly.
Revisits thread PRRT_kwDORKAmpc6XQIdz (previously declined on handler-budget
grounds — aligning per explicit parity requirement; follow-up will verify
handler budget in live review). OMP 1.3.10 / Claude 1.2.14.
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Aug 8, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Fixes a broken CLI flag that disabled the entire reflector; restores documented model routing presets that had silently drifted. All changes revert to previously agreed-upon and tested behavior, with new guards that confirm the fix. No new product or operational tradeoffs introduced.

Re-trigger cubic

Verifies CODE_REVIEW_COMPLEX=xhigh stays within HANDLER_BUDGET_MS=25s:
measured 2026-08-09 xhigh with 5.5k payload ~18.3s direct, ~20.1s via
codexExecArgs smoke test, both <25s. Test is opt-in (CODEX_SMOKE=1) to
avoid 6-18s cost on every run; spawn timeout 60s > budget so assertion
can fail on overrun, bun timeout 65s > spawn so full round-trip is
observed. Documents that xhigh is viable within OMP 25s budget vs
Python ~100s guard.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 14e5f0fa2e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread omp/codex-reflector.test.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread omp/codex-reflector.test.ts Outdated
@cubic-dev-ai
cubic-dev-ai Bot dismissed their stale review August 8, 2026 18:04

Dismissed because Cubic found issues in a newer review.

…dget

Rename prior live smoke to 'xhigh direct Codex invocation latency'
— it measures codexExecArgs->codex only, not handlerDeadline,
compaction, prompt construction, invokeCodex, or cleanup at
tool_result:1140-1160. Add complementary handler integration smoke
that drives the registered tool_result handler with a 5.5k
CODE_REVIEW_COMPLEX payload through the full path and asserts
settlement < HANDLER_BUDGET_MS=25s. Live: direct ~10.6s,
handler ~18.2s, both <25s (CODEX_SMOKE=1).

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@omp/codex-reflector.test.ts`:
- Around line 267-269: Correct the date in the measurement comment associated
with the live Codex latency smoke test, replacing the future August 9, 2026 date
with the verified measurement date; if no verified date exists, remove the
measurement-date claim while preserving the latency context.
- Around line 1158-1171: Update the xhigh handler integration test around
codexReflector and its tool_result event to use a path with an xhigh file
heuristic, such as .env.local, instead of src/complex.ts. Add an assertion that
the selected model and effort pair matches the xhigh route, while preserving the
existing opt-in smoke-test behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ac759597-5561-42a9-9d35-df199e7145d2

📥 Commits

Reviewing files that changed from the base of the PR and between d2601db and 0883972.

📒 Files selected for processing (5)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • omp/codex-reflector.test.ts
  • omp/codex-reflector.ts
  • package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • omp/codex-reflector.ts

Comment thread omp/codex-reflector.test.ts Outdated
Comment thread omp/codex-reflector.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 088397286c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread omp/codex-reflector.ts
Comment thread omp/codex-reflector.test.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread omp/codex-reflector.test.ts Outdated
Codex timeout 25s killed xhigh handler reviews at budget (measured
19-25s via handler, direct ~10s). Handler budget 25s equaled codex
timeout, so deadline and child SIGKILL raced and smoke hid the
expiry as undefined. Raise to coherent hierarchy: codex 26s <
handler 28s < harness 30s (2s margins each). Keeps 2s under
oh-my-pi's hard 30s cap while giving xhigh headroom.
…andler

Direct smoke comment still said 25s after handler budget moved to
28s; update to 26s codex / 28s handler. Handler smoke previously
skipped on any undefined (hiding deadline expiry at 25s codex
timeout); now asserts elapsed < HANDLER_BUDGET_MS before skip and
only skips fast unavailability (<5s), failing on deadline/budget
expiry. Also fix missing 65s test closing and use xhigh-triggering
path src/auth/credentials.test.ts for true xhigh coverage.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7eb9cde7e3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread omp/codex-reflector.test.ts

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread omp/codex-reflector.test.ts Outdated
Assert exact category/model/effort triples for positive classify routes, including bash-failure default@low. Match generated long flags against complete codex exec --help option tokens rather than substrings. Exercise CODEX_REFLECTOR_MODEL effort preservation on the distinctive frontier@high route.
Retier OMP complex reviews from frontier@xhigh to frontier@high after a live xhigh call took 37.588s and the full handler failed open at the 26s child timeout under the host's fixed 30s cap. Frontier@high returned a defined review in 11.025s under the same load. Keep Python xhigh under its ~100s guard, pin both complex gate disjuncts, and retain direct plus full-handler live smokes. Release as OMP 1.3.12 / Claude 1.2.16.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude-plugin/plugin.json:
- Line 3: Update the paired marketplace manifest’s metadata.lastUpdated to a
non-future release date matching the plugin version 1.2.16: use 2026-08-09 for a
release shipping today, or defer the metadata update until 2026-08-10 if
shipping tomorrow.

In `@omp/codex-reflector.test.ts`:
- Around line 1196-1199: Strengthen the assertion after the undefined check in
the handler integration test to require a non-empty reviewer response. Validate
that result.content contains reviewer text, while preserving the existing
elapsed-time budget assertion and undefined-result rejection.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c8942f3-9c66-4181-ba0f-c2524b6c22df

📥 Commits

Reviewing files that changed from the base of the PR and between 0883972 and f6949f0.

📒 Files selected for processing (6)
  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • AGENTS.md
  • omp/codex-reflector.test.ts
  • omp/codex-reflector.ts
  • package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • package.json
  • .claude-plugin/marketplace.json
  • omp/codex-reflector.ts

Comment thread .claude-plugin/plugin.json
Comment thread omp/codex-reflector.test.ts
Strengthen the live tool_result smoke to match the Codex verdict header and require a non-empty opinion body before checking latency. This rejects defined-but-empty content overrides; mutation with an empty codeReviewResponse body fails at the intended assertion.
@metaphorics

Copy link
Copy Markdown
Collaborator Author

Assert the complete model-routing contract.

Addressed: positive classify routes now pin exact category/model/effort triples, including bash-failure at gpt-5.6-terra@low. Gate tests pin both complex disjuncts. Existing argv captures pin Stop at frontier@medium, precompact at frontier@low, and bash guard at fast@low. The model-override test now uses a distinctive frontier@high route, clears/restores ambient CODEX_REFLECTOR_MODEL, and proves the effort survives an explicit model override.

Update the codex exec --help validation so it skips only on ENOENT and fails other errors and non-zero statuses.

Addressed: the help check skips only missing Codex, throws other spawn failures, requires exit 0, and matches generated long flags against complete option-name tokens. The live direct smoke also throws on every installed-Codex non-zero exit.

Strengthen the handler integration test to require a non-empty reviewer response.

Addressed in 2c32762: the full handler smoke matches the Codex Review verdict header and target path, then requires a non-empty trimmed opinion body before checking latency. An empty-body mutation fails at the new assertion.

The paired marketplace date remains 2026-08-10 because that is the authoritative session and release date. The inline date thread has the full disposition.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 6 files (changes from recent commits).

Confidence score: 5/5

  • In omp/codex-reflector.test.ts, the if (!handler) return; branch is unreachable after expect(handler).toBeDefined(), which can hide test intent and create misleading dead-path logic without affecting runtime behavior—remove the redundant guard (or replace the assertion/flow) so the test has a single, clear failure path.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="omp/codex-reflector.test.ts">

<violation number="1" location="omp/codex-reflector.test.ts:1183">
P3: The `if (!handler) return;` guard is unreachable: `expect(handler).toBeDefined()` on the line above already throws when the handler is undefined, so `!handler` is always false when execution reaches that branch. If the contract being defended is that `tool_result` must be registered, the `expect` already enforces it; consider dropping the dead guard so a missing registration fails the smoke test loudly instead of silently skipping.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

codexReflector(pi);
const handler = handlers.get("tool_result");
expect(handler).toBeDefined();
if (!handler) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The if (!handler) return; guard is unreachable: expect(handler).toBeDefined() on the line above already throws when the handler is undefined, so !handler is always false when execution reaches that branch. If the contract being defended is that tool_result must be registered, the expect already enforces it; consider dropping the dead guard so a missing registration fails the smoke test loudly instead of silently skipping.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At omp/codex-reflector.test.ts, line 1183:

<comment>The `if (!handler) return;` guard is unreachable: `expect(handler).toBeDefined()` on the line above already throws when the handler is undefined, so `!handler` is always false when execution reaches that branch. If the contract being defended is that `tool_result` must be registered, the `expect` already enforces it; consider dropping the dead guard so a missing registration fails the smoke test loudly instead of silently skipping.</comment>

<file context>
@@ -1155,34 +1156,57 @@ exit 0
+			codexReflector(pi);
+			const handler = handlers.get("tool_result");
+			expect(handler).toBeDefined();
+			if (!handler) return;
+			const event: Record<string, unknown> = {
+				type: "tool_result",
</file context>

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.

1 participant