Skip to content

fix: add Codex provider complete fields#959

Open
CoderLuii wants to merge 1 commit into
siteboon:mainfrom
CoderLuii:codex/codex-provider-complete-fields
Open

fix: add Codex provider complete fields#959
CoderLuii wants to merge 1 commit into
siteboon:mainfrom
CoderLuii:codex/codex-provider-complete-fields

Conversation

@CoderLuii

@CoderLuii CoderLuii commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add explicit exitCode: 0, success: true, and aborted: false fields to Codex turn_complete normalization.
  • Keep provider-normalized Codex completions aligned with the existing complete-message contract.
  • Add focused node:test coverage for the turn_complete path.

Why

server/openai-codex.js already emits final Codex completion messages with exit codes. The provider normalization path still mapped raw.type === 'turn_complete' to a bare kind: 'complete' event.

That can make downstream completion handling see a terminal Codex complete event without the success fields it expects. This PR keeps that terminal shape explicit on the provider path too.

Downstream context: HolyClaude v1.4.3 carries this as a Docker-build guard while waiting for the upstream fix.

Validation

  • npm ci
  • npx tsx --tsconfig server/tsconfig.json --test server/modules/providers/tests/codex-sessions.test.ts
  • npm run typecheck
  • npm run build
  • npm run lint passes with existing warnings

Not tested: live Codex chat run.

Summary by CodeRabbit

  • Bug Fixes

    • Completion messages now consistently include success-related details, such as exit status and whether the run was aborted.
    • Improved message normalization so finished sessions return clearer, more complete results.
  • Tests

    • Added coverage to verify completed session messages are mapped with the expected final status fields.

Codex live completions already include explicit exitCode fields.

Provider turn_complete normalization still returned a bare complete event.

Add the same success fields there for one terminal shape.

Tested: targeted Codex provider node:test

Tested: npm run typecheck

Tested: npm run build

Tested: npm run lint

Not-tested: live Codex chat run
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a6d7413c-cb17-495e-ac32-db38e4f6d0f8

📥 Commits

Reviewing files that changed from the base of the PR and between e93c83a and f8eee29.

📒 Files selected for processing (2)
  • server/modules/providers/list/codex/codex-sessions.provider.ts
  • server/modules/providers/tests/codex-sessions.test.ts

📝 Walkthrough

Walkthrough

The normalizeMessage function in CodexSessionsProvider now sets exitCode: 0, success: true, and aborted: false when normalizing turn_complete messages into complete kind output. A corresponding test verifies these fields are correctly populated.

Changes

Turn Complete Normalization

Layer / File(s) Summary
Completion metadata population and test
server/modules/providers/list/codex/codex-sessions.provider.ts, server/modules/providers/tests/codex-sessions.test.ts
normalizeMessage now includes exitCode: 0, success: true, and aborted: false in the normalized complete payload for turn_complete messages; a new test verifies these fields along with kind, provider, and sessionId.

Suggested reviewers: viper151

Poem

A rabbit hops through session logs so neat,
Adding flags to mark each turn complete. 🐰
Exit code zero, success shining true,
Aborted false, a test to prove it through.
Hop, hop, hooray for code review!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: adding missing completion fields to the Codex provider.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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