Skip to content

fix: align credential model and message routing - #54

Merged
orangeboyChen merged 1 commit into
mainfrom
codex/fix-credential-model-comments
Jul 28, 2026
Merged

fix: align credential model and message routing#54
orangeboyChen merged 1 commit into
mainfrom
codex/fix-credential-model-comments

Conversation

@orangeboyChen

Copy link
Copy Markdown
Owner

Summary

  • select eligible credentials that support the requested model across chat and Responses paths
  • derive API Test model availability from saved credential settings and avoid stale async refresh results
  • normalize developer messages as user messages to avoid upstream content filtering

Root cause

The upstream content filter rejects the recorded system/developer envelope, while the same message body succeeds as user content. Credential selection also ignored the requested model in several proxy paths.

Validation

  • bun run lint
  • bun run format:check
  • bun run typecheck
  • bun run test:coverage
  • bun run test:ci
  • bun run build

@orangeboyChen
orangeboyChen marked this pull request as ready for review July 24, 2026 17:17
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.18919% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.98%. Comparing base (b624efa) to head (48d02e1).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   92.03%   91.98%   -0.05%     
==========================================
  Files          20       20              
  Lines        8131     8175      +44     
  Branches     1624     1637      +13     
==========================================
+ Hits         7483     7520      +37     
- Misses        635      642       +7     
  Partials       13       13              
Flag Coverage Δ
unittests 91.98% <89.18%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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: d9a1080aed

ℹ️ 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 lib/server/domain/config.ts
@orangeboyChen
orangeboyChen force-pushed the codex/fix-credential-model-comments branch from d9a1080 to cd27f12 Compare July 24, 2026 17:26

@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: cd27f124bf

ℹ️ 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 lib/server/proxy/responses.ts
@orangeboyChen
orangeboyChen enabled auto-merge (squash) July 24, 2026 17:38
@orangeboyChen
orangeboyChen disabled auto-merge July 24, 2026 17:38
@orangeboyChen
orangeboyChen enabled auto-merge (squash) July 24, 2026 17:38

@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: 66368b44e3

ℹ️ 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 lib/server/domain/config.ts
@orangeboyChen
orangeboyChen disabled auto-merge July 24, 2026 17:43
@orangeboyChen
orangeboyChen enabled auto-merge (squash) July 24, 2026 18:09

@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: cfe52bf3d3

ℹ️ 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 app/page-loader.ts
Comment on lines +154 to +156
eligibleCredentials.map((credential) => [
credential.filename,
getCredentialSupportedModels(credential.data),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fall back when saved credential models are empty

When an existing credential has not yet persisted supported_models, this now still materializes a per-credential entry with []. The API-test shell reads initialData.credentialModels[filename] ?? initialData.models, so that empty array is treated as authoritative and hides the models discovered by getModelsForCredentials(eligibleCredentials) on the same load; legacy credentials or credentials whose startup refresh has not completed can therefore show an empty model selector even though discovery succeeded. Omit empty entries or populate them from per-credential discovery so the global fallback remains usable.

Useful? React with 👍 / 👎.

@orangeboyChen
orangeboyChen force-pushed the codex/fix-credential-model-comments branch from cfe52bf to 48d02e1 Compare July 28, 2026 14:23
@orangeboyChen
orangeboyChen merged commit 48eef0a into main Jul 28, 2026
5 checks passed
@orangeboyChen
orangeboyChen deleted the codex/fix-credential-model-comments branch July 28, 2026 14:27

@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: 48d02e1f8f

ℹ️ 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 on lines +708 to +710
const supportedModels = getCredentialSupportedModels(record.data);
return (
supportedModels.length === 0 || supportedModels.includes(requestedModel)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fall back when cached model metadata has no match

When every eligible credential has a nonempty but stale supported_models value that omits a newly enabled upstream model, this filter removes all credentials and the proxy returns No valid CodeBuddy credentials found without contacting upstream. Nonempty model metadata is only refreshed manually or when initially absent, so valid explicit-model requests can remain blocked indefinitely after upstream availability changes; if no cached list matches, fall back to the otherwise eligible credentials or refresh the metadata before rejecting the request.

Useful? React with 👍 / 👎.

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.

2 participants