Skip to content

[Done] chore: apply changes for Issue #630 - #631

Merged
YiweiShen merged 2 commits into
mainfrom
codez-chore-630-apply-changes-for-issue-630
Mar 1, 2026
Merged

[Done] chore: apply changes for Issue #630#631
YiweiShen merged 2 commits into
mainfrom
codez-chore-630-apply-changes-for-issue-630

Conversation

@github-actions

@github-actions github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown

Closes #630

Applied changes based on Issue #630.

Implemented a fix for the fallback behavior and traced the likely cause.

What was happening
generateCommitMessageOpenAI (via generateCommitMessage) had a single path through chat.completions.create, and any API error immediately returned getFallbackMessage. If that endpoint/model combo fails, it will always fallback.

Changes made

  1. Added a resilient generation flow in src/api/openai.ts:
  • Try openai.responses.create(...) first.
  • If that fails, try openai.chat.completions.create(...).
  • Only fallback if both fail.
  • Relevant logic: src/api/openai.ts
  1. Aligned commit-message default model with the main default model:
  • defaultCommitMessageModel now equals defaultModel (gpt-5.3-codex) in src/api/openai.ts
  1. Updated metadata/docs default text:
  1. Updated tests to cover the new behavior (responses-first, chat fallback):

Validation

  • npm run build passed.
  • Running npm test -- __tests__/src/api/openai.test.ts in this repo fails due existing Jest ESM/top-level-await config mismatch, not from this patch.

Comment thread src/api/openai.ts
*/

export const defaultModel = 'gpt-5.3-codex';
export const defaultCommitMessageModel = 'gpt-5.2-codex';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

/codex For commit messages, please continue using a different model, as GPT-5.3-Codex is not available via the API.

@github-actions github-actions Bot Mar 1, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated as requested: commit-message generation now keeps a separate default model from the main Codex model.

Changed:

Validation note:

  • Could not run build/tests in this environment because dependencies are not installed (esbuild and jest not found).

@github-actions github-actions Bot changed the title chore: apply changes for Issue #630 [WIP] chore: apply changes for Issue #630 Mar 1, 2026
@github-actions github-actions Bot changed the title [WIP] chore: apply changes for Issue #630 [Done] chore: apply changes for Issue #630 Mar 1, 2026
@YiweiShen
YiweiShen merged commit 3cc6a8f into main Mar 1, 2026
3 checks passed
@YiweiShen
YiweiShen deleted the codez-chore-630-apply-changes-for-issue-630 branch March 1, 2026 23:07
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.

[Done] Investigate why generateCommitMessageOpenAI always falls back to getFallbackMessage and fix it.

1 participant