GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: integrate hosted image tool preferences by Ingwannu · Pull Request #837 · lidge-jun/opencodex

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • integrate the hosted image-tool preference work from fix: preserve hosted image tool preferences #616 onto current dev
  • preserve the original contributor commit and authorship from @Eleven-is-cool
  • resolve the two documentation conflicts by retaining the newer DeepSeek wire-default wording alongside modelPreferHostedTools
  • update one expected schema to account for the function-schema normalization already on dev

The original PR branch does not allow maintainer edits and is now conflicting, so this integration branch carries the reviewed change without rewriting or squashing the contributor commit.

Test plan

  • bun test tests/openai-responses-passthrough.test.ts tests/management-provider-validation.test.ts tests/openai-api-virtual-models.test.ts tests/config.test.ts — 228 passed
  • bun run typecheck

Decision Log

  • Purpose: land the validated hosted-tool behavior while preserving contributor attribution.
  • Constraint: fix: preserve hosted image tool preferences #616 is conflicting and maintainerCanModify is disabled.
  • Chosen approach: replay the original authored commit onto current dev, resolve only current-dev integration conflicts, and retain the original commit as the first commit in this PR.
  • Tradeoff: a small integration PR replaces direct merging of fix: preserve hosted image tool preferences #616, but avoids force-pushing a contributor branch and keeps history/auditability intact.

Supersedes #616 after merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Eleven-is-cool and others added 2 commits August 1, 2026 04:57
@Eleven-is-cool @Ingwannu
fix: preserve hosted image tool preferences
89d51db
@Ingwannu
test: align hosted-tool fixture with schema normalization
29e98c6
@Ingwannu
Ingwannu requested review from Wibias and lidge-jun as code owners August 1, 2026 04:59
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Ingwannu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2ed87f3e-c5ca-4545-838d-b7bad11465af

📥 Commits

Reviewing files that changed from the base of the PR and between 2491f13 and 29e98c6.

📒 Files selected for processing (16)
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • src/adapters/openai-responses.ts
  • src/config.ts
  • src/providers/openai-virtual-models.ts
  • src/responses/hosted-tool-policy.ts
  • src/server/auth-cors.ts
  • src/types.ts
  • structure/04_transports-and-sidecars.md
  • tests/config.test.ts
  • tests/management-provider-validation.test.ts
  • tests/openai-api-virtual-models.test.ts
  • tests/openai-responses-passthrough.test.ts

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the bug Something isn't working label Aug 1, 2026
@Ingwannu Ingwannu mentioned this pull request Aug 1, 2026
fix: preserve hosted image tool preferences #616
Closed
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Aug 1, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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: 29e98c6706

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/config.ts
return `${field}.${key} cannot prefer ${tool}: the model does not support it`;
}
}
let effectiveWire = resolveEffectiveWire(key, registry?.adapter ?? provider.adapter);

@chatgpt-codex-connector chatgpt-codex-connector Bot Aug 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Honor registry model-wire defaults during validation

For deepseek/deepseek-v4-flash on a Responses inbound request, the canonical registry declares an openai-responses model-wire default and resolveWireProtocolOverride selects it at runtime, but this validator initializes effectiveWire from the provider-wide registry.adapter (openai-chat) and never consults providerModelWireDefault. Consequently, both config loading and the management API reject a hosted-tool preference that would actually execute through the required Responses adapter; derive the effective wire through the same inbound-aware registry path used by the runtime.

AGENTS.md reference: src/AGENTS.md:L18-L18

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/adapters/openai-responses.ts
Comment on lines +640 to +642
const preferredTools = (selectedModelId ? provider.modelPreferHostedTools?.[selectedModelId] : undefined)
?? provider.modelPreferHostedTools?.[modelId];
if (!preferredTools?.includes(HOSTED_IMAGE_GENERATION_TOOL) || !isPlainObject(body)) return body;

@chatgpt-codex-connector chatgpt-codex-connector Bot Aug 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Restrict preference lookup to own array entries

When modelPreferHostedTools is present and a request routes to a valid model ID matching an inherited Object.prototype property, such as constructor or toString, this lookup returns the inherited function rather than an array and the subsequent .includes(...) call throws a TypeError before upstream dispatch. Model IDs with these values are accepted by routing, so use an own-property lookup and verify that the selected entry is an array before reading it.

AGENTS.md reference: src/AGENTS.md:L17-L17

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Ingwannu

Ingwannu commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Integration is now green on Ubuntu, macOS, Windows, all three npm-global jobs, React Doctor, and the target gate. The original contributor commit remains intact as the first commit. @lidge-jun @Wibias, ready for the independent maintainer approval required before merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lidge-jun

lidge-jun commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Maintainer triage update: this PR now carries the accepted behavior from #616. We have marked #616 as superseded by this PR and will close it once this lands.

The remaining blockers are:

  • The branch now conflicts with dev and needs a rebase.
  • The two open findings need to be resolved: honoring the registry model-wire default during validation, and making the hosted-tool preference lookup correct for inherited properties.

Once this lands, we will close #616. Happy to help with the rebase if useful.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olddonkey pushed a commit to olddonkey/opencodex that referenced this pull request Aug 2, 2026
@lidge-jun
docs(plan): allocate 12 must-fix bugs across 5 bugfix worktrees
ef71180
Campaign preparation (docs-only): five units under devlog/_plan/260802_wtN_*
with 000 research + 010 implementation roadmaps, claim ledgers verified by a
lunasearch fan-out (Anthropic 1M windows, Copilot mixed-wire, DeepSeek
service_tier, WHATWG extension origins, POSIX rename-over-symlink).

wt1 update-path: PR lidge-jun#871, issue lidge-jun#879 (star-prompt deferral leakage), lidge-jun#557 optional
wt2 zero-leak: PRs lidge-jun#840 lidge-jun#841 lidge-jun#843 lidge-jun#844 lidge-jun#845 lidge-jun#847 (tracker lidge-jun#820)
wt3 provider-wire: PRs lidge-jun#746 lidge-jun#860 lidge-jun#839/lidge-jun#854, issue lidge-jun#875 triage, lidge-jun#616/lidge-jun#837 optional
wt4 server-config: PRs lidge-jun#850 (CORS origin confusion), lidge-jun#869 (symlink destruction)
wt5 windows-service: PRs lidge-jun#868, lidge-jun#861 (issue lidge-jun#848)
@lidge-jun lidge-jun mentioned this pull request Aug 3, 2026
fix: preserve hosted image tool preferences (#837 rebased, two defects fixed) #924
Merged
@lidge-jun

lidge-jun commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Rebased onto current dev (fa51fce54 at the time) as #924, with two defects fixed on top. I opened a separate branch rather than force-pushing yours.

The rebase hit six conflicts, all from dev splitting configuration.md into configuration/providers.md after this branch was written — the doc row went to its new home in all five locales, and src/config.ts was a parallel import addition. Your fixture commit came through unchanged, and 89d51dbc still carries @Eleven-is-cool as author, which was the point of your integration in the first place.

Two defects a plan audit found, both reproduced red before fixing:

src/config.ts:641 — validation resolved the effective wire from registry.adapter and an explicit modelAdapters entry, but resolveModelAdapter() consults the registry's per-model modelWireDefaults first at request time. Configuring modelPreferHostedTools for deepseek/deepseek-v4-flash was rejected with requires the openai-responses wire even though the runtime routes exactly that model over native Responses for a Responses inbound.

src/adapters/openai-responses.ts:641-643 — the preference lookup walked the prototype chain, so a routed model id of constructor or toString returned a function and threw TypeError: ... .includes is not a function before dispatch.

Full suite is green on the rebased branch: 7574 pass, 0 fail, plus typecheck and privacy scan. I will close this one and #616 when #924 lands. Thanks for doing the integration work — the authorship preservation made this straightforward to carry forward.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lidge-jun added a commit that referenced this pull request Aug 3, 2026
@lidge-jun
Merge pull request #924 from lidge-jun/codex/837-hosted-tool-preferences
df82431
fix: preserve hosted image tool preferences (#837 rebased, four defects fixed)

Supersedes #837 and #616, which were the same implementation submitted twice.
The substantive commit keeps @Eleven-is-cool as author; @Ingwannu did the first
integration and this is the second rebase of the same work.

Adds a per-model opt-in for non-forward Responses gateways that reserve the
image_gen namespace server-side, where the empty client namespace ocx preserves
today gets rejected and the user has no way to ask for the hosted tool instead.

Four defects fixed on top, each driven red before the fix:

- config validation resolved the effective wire without consulting the
  registry's per-model modelWireDefaults, rejecting a DeepSeek preference the
  runtime would have honored;
- the same validation trusted registry.adapter even when a
  preserveCustomDestination row pointed at a different endpoint, accepting a
  preference the Responses adapter never sees;
- the preference lookup walked Object.prototype, throwing on a routed model id
  of constructor or toString before dispatch;
- restoration of the hosted tool targeted only the first stripped
  additional_tools container, leaving later ones with no image capability.

The last two were found by the automated reviewers.

Verification: 7575 pass / 8 skip / 0 fail across 504 files, typecheck clean,
privacy scan clean, sharded CI green.
@lidge-jun

lidge-jun commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Merged to dev as #924 (df8243154). Your integration branch is what made this landable — preserving @Eleven-is-cool as author on 89d51dbc meant the credit chain survived a second rebase without any manual reconstruction.

Fixed on top before merging: the two defects named in my earlier comment (registry modelWireDefaults not consulted during validation; prototype-chain lookup throwing on constructor/toString), plus two the automated reviewers found — validation trusting registry.adapter for a preserveCustomDestination row pointing elsewhere, and hosted-tool restoration reaching only the first stripped additional_tools container.

Closing this and #616. Thanks for the integration work.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lidge-jun lidge-jun closed this Aug 3, 2026
@lidge-jun lidge-jun mentioned this pull request Aug 3, 2026
fix(hosted-tools): one effective-transport decision, one hosted declaration #925
Merged
@Wibias
Wibias deleted the agent/integrate-hosted-image-tools-616 branch August 8, 2026 01:51
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
docs(plan): allocate 12 must-fix bugs across 5 bugfix worktrees
1ffabf5
Campaign preparation (docs-only): five units under devlog/_plan/260802_wtN_*
with 000 research + 010 implementation roadmaps, claim ledgers verified by a
lunasearch fan-out (Anthropic 1M windows, Copilot mixed-wire, DeepSeek
service_tier, WHATWG extension origins, POSIX rename-over-symlink).

wt1 update-path: PR lidge-jun#871, issue lidge-jun#879 (star-prompt deferral leakage), lidge-jun#557 optional
wt2 zero-leak: PRs lidge-jun#840 lidge-jun#841 lidge-jun#843 lidge-jun#844 lidge-jun#845 lidge-jun#847 (tracker lidge-jun#820)
wt3 provider-wire: PRs lidge-jun#746 lidge-jun#860 lidge-jun#839/lidge-jun#854, issue lidge-jun#875 triage, lidge-jun#616/lidge-jun#837 optional
wt4 server-config: PRs lidge-jun#850 (CORS origin confusion), lidge-jun#869 (symlink destruction)
wt5 windows-service: PRs lidge-jun#868, lidge-jun#861 (issue lidge-jun#848)
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
Merge pull request lidge-jun#924 from lidge-jun/codex/837-hosted-tool…
d4fa286
…-preferences

fix: preserve hosted image tool preferences (lidge-jun#837 rebased, four defects fixed)

Supersedes lidge-jun#837 and lidge-jun#616, which were the same implementation submitted twice.
The substantive commit keeps @Eleven-is-cool as author; @Ingwannu did the first
integration and this is the second rebase of the same work.

Adds a per-model opt-in for non-forward Responses gateways that reserve the
image_gen namespace server-side, where the empty client namespace ocx preserves
today gets rejected and the user has no way to ask for the hosted tool instead.

Four defects fixed on top, each driven red before the fix:

- config validation resolved the effective wire without consulting the
  registry's per-model modelWireDefaults, rejecting a DeepSeek preference the
  runtime would have honored;
- the same validation trusted registry.adapter even when a
  preserveCustomDestination row pointed at a different endpoint, accepting a
  preference the Responses adapter never sees;
- the preference lookup walked Object.prototype, throwing on a routed model id
  of constructor or toString before dispatch;
- restoration of the hosted tool targeted only the first stripped
  additional_tools container, leaving later ones with no image capability.

The last two were found by the automated reviewers.

Verification: 7575 pass / 8 skip / 0 fail across 504 files, typecheck clean,
privacy scan clean, sharded CI green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner
@Wibias Wibias Awaiting requested review from Wibias

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Ingwannu @lidge-jun @Eleven-is-cool
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.