Skip to content

fix(look-at): respect configured multimodal-looker model instead of overriding via dynamic fallback#2686

Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
sjawhar:fix/look-at-respect-configured-model
Mar 25, 2026
Merged

fix(look-at): respect configured multimodal-looker model instead of overriding via dynamic fallback#2686
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
sjawhar:fix/look-at-respect-configured-model

Conversation

@sjawhar
Copy link
Copy Markdown
Contributor

@sjawhar sjawhar commented Mar 19, 2026

Summary

The look_at tool's model resolution (resolveMultimodalLookerAgentMetadata) was silently overriding the user's configured multimodal-looker model with a dynamically resolved one from the vision-capable models cache. This caused failures when the dynamically selected model (e.g., an Antigravity-prefixed Gemini model) was incompatible with the provider's API.

Problem

When a user configures multimodal-looker with a specific model (e.g., openai/gpt-5.4), the resolution function:

  1. Checks if the configured model is in the vision-capable cache (populated from provider.*.models with modalities.input: ["image"])
  2. If NOT in the cache (e.g., OpenAI models without explicit modality declarations), falls through to dynamic resolution
  3. Dynamic resolution picks the first available vision-capable model from the cache, which may be an incompatible model
  4. The configured model is silently replaced

This was confirmed via logs: the tool resolved to google/antigravity-gemini-3-pro instead of the configured openai/gpt-5.4, causing prompt failures.

Fix

  • If the user explicitly configured a model for multimodal-looker, use it regardless of the vision-capable cache. The cache is incomplete (only includes models with explicit modalities.input declarations in the provider config).
  • Dynamic fallback is only used when no model is registered at all.
  • Removed the redundant isVisionCapableResolvedModel gate in tools.ts that would block the configured model for the same reason.

Testing

  • Updated 3 existing tests to match new behavior
  • All 52 look-at tests pass
  • Typecheck clean
  • Verified via real OpenCode session: configured GPT-5.4 is now used and returns successful responses

Summary by cubic

Ensures look_at uses the configured multimodal-looker model and variant, only falling back to dynamic resolution when none is set. Prevents silent overrides to incompatible vision models and the resulting prompt failures.

  • Bug Fixes
    • Always return the registered model and variant as-is; no merging from dynamic resolution.
    • Only run dynamic resolution when no model is configured; add clear logs with the chosen path and model.
    • Remove the vision-capable gate and blocking error in tools.ts.
    • Update tests for the new behavior; all look-at tests pass.

Written for commit db32bad. Summary will update on new commits.

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

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

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

Auto-approved: Fixes a bug where valid vision models were incorrectly overridden or blocked due to an incomplete metadata cache. Simplifies logic to correctly prioritize user-configured models.

@sjawhar sjawhar force-pushed the fix/look-at-respect-configured-model branch from 22dd884 to db32bad Compare March 23, 2026 01:13
@code-yeongyu code-yeongyu added the triage:bug-fix PR: Bug fix label Mar 24, 2026
@code-yeongyu code-yeongyu merged commit 6f213a0 into code-yeongyu:dev Mar 25, 2026
2 checks passed
@sjawhar sjawhar deleted the fix/look-at-respect-configured-model branch March 26, 2026 13:48
sjawhar added a commit to sjawhar/oh-my-opencode that referenced this pull request Mar 26, 2026
Rebased onto dev@upstream (v3.13.1). Dropped fix/look-at-respect-configured-model and fix/atlas-subagent-agent-guard (merged upstream as PRs code-yeongyu#2686 and code-yeongyu#2751).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:bug-fix PR: Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants