Skip to content

fix(opencode-go): fetch models unconditionally — the /models endpoint is public#437

Merged
navedmerchant merged 4 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:fix/172-opencode-go-models-no-auth
Jun 19, 2026
Merged

fix(opencode-go): fetch models unconditionally — the /models endpoint is public#437
navedmerchant merged 4 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:fix/172-opencode-go-models-no-auth

Conversation

@proyectoauraorg

@proyectoauraorg proyectoauraorg commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Bug

Reported for the Opencode Go provider (added in #172): the model list never loads — the picker is empty, a custom model name can't be entered, and the provider falls back to the hardcoded default glm-5.1.

Root cause

In requestRouterModels (webviewMessageHandler.ts), the Opencode Go fetch was gated behind if (opencodeGoApiKey), with the comment "its /models endpoint requires auth." That premise is wrong. When opencodeGoApiKey isn't in apiConfiguration at fetch time (key just typed, stored in Secret Storage and not yet hydrated, or absent), Opencode Go is never added to the fetch candidates, so routerModels["opencode-go"] stays {} (the seeded default). The ModelPicker then renders an empty list and falls back to opencodeGoDefaultModelId (glm-5.1); since it only offers fetched router models, no custom model can be selected either.

openrouter and vercel-ai-gateway — also public endpoints — are fetched unconditionally in the same handler. Opencode Go should be too.

Reproduction (deterministic)

Running the shipped getOpencodeGoModels() against the live endpoint:

[NO API KEY]   models loaded: 17
               sample ids: minimax-m3, minimax-m2.7, minimax-m2.5, kimi-k2.6, kimi-k2.5, glm-5.1
[DUMMY KEY]    models loaded: 17
$ curl -s -o /dev/null -w "%{http_code}" https://opencode.ai/zen/go/v1/models
200

The endpoint returns the full 17-model list with no Authorization header, and the existing fetcher parses it correctly. So the fetcher was never the problem — the gate was.

Fix

Fetch Opencode Go unconditionally, like the other public routers, forwarding the API key when present and still flushing the cache when a new key is supplied (Refresh Models button). One-line behavioral change in the handler + the misleading comment corrected.

Tests

  • Updated the three requestRouterModels tests that assumed "opencode-go": {} (it's now fetched like the other public routers).
  • Added a regression test: Opencode Go is fetched with apiKey: undefined and populates routerModels even when no key is configured.
  • ✅ 29/29 in webviewMessageHandler.spec.ts, tsc --noEmit clean, eslint --max-warnings=0 clean.

Note: this fixes the empty picker for all users by loading models without a key. If a region/network blocks opencode.ai for a specific user, the fetcher still swallows that error and returns {} (logged only) — surfacing that to the UI is a separate, optional follow-up.

Summary by CodeRabbit

  • New Features
    • Added an Opencode-Go “refresh models” action in provider settings, including loading, success, and error feedback.
  • Bug Fixes
    • Opencode-Go router models are now returned for public (no-auth) model fetches even when no API key is configured; the cache refresh happens only when a new key is explicitly provided.
  • Tests
    • Expanded message-handling and UI test coverage to verify Opencode-Go behavior across missing-key, refresh, and mixed provider outcomes.

… is public

The Opencode Go model fetch in `requestRouterModels` was gated behind
`if (opencodeGoApiKey)` on the assumption that its `/models` endpoint requires
auth. It does not: the endpoint returns the full model list (HTTP 200) with no
Authorization header. Gating meant `routerModels["opencode-go"]` stayed `{}`
whenever the key wasn't present in `apiConfiguration` at fetch time, so the
model picker showed an empty list, fell back to the hardcoded default
(`glm-5.1`), and offered no model to select.

Fetch Opencode Go unconditionally like the other public routers
(`openrouter`, `vercel-ai-gateway`), forwarding the API key when present and
still flushing the cache when a new key is supplied. Updates the affected
`requestRouterModels` tests and adds a regression test for the keyless path.
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Opencode Go model fetching is changed to always include opencode-go in router model candidates with optional API key. Backend tests validate this behavior across success, no-key, LiteLLM-skip, and provider-failure scenarios. OpenCodeGo component adds a refresh button with state management (idle/loading/success/error) and message listeners to handle model fetch responses.

Changes

Opencode Go public models endpoint with refresh UI

Layer / File(s) Summary
Backend: Opencode Go candidate always included
src/core/webview/webviewMessageHandler.ts
The requestRouterModels handler now unconditionally adds the opencode-go candidate to the fetch list, passing API key when available, and only flushes cache when a new key is explicitly provided in message.values.
Backend: Test updates for opencode-go public provider
src/core/webview/__tests__/webviewMessageHandler.spec.ts, src/core/webview/__tests__/ClineProvider.spec.ts
Tests now assert getModels is called for opencode-go, add a regression test verifying models are fetched without an API key (apiKey: undefined), and update LiteLLM-skip and provider-failure scenarios to expect opencode-go: mockModels across both test files.
Frontend: OpenCodeGo refresh UI with state and messaging
webview-ui/src/components/settings/providers/OpenCodeGo.tsx
Component adds refresh button, internal state for refresh status (idle/loading/success/error) and optional error message, message listener for routerModels and singleRouterModelFetchResponse events, and handleRefreshModels callback that posts requestRouterModels with refresh: true.
Frontend: OpenCodeGo refresh button test coverage
webview-ui/src/components/settings/providers/__tests__/OpenCodeGo.spec.tsx
Test setup mocks postMessage and Button; refresh models test suite validates idle render, click posting correct message, loading UI with disabled button, success/error transitions from message events, provider filtering, and error precedence (success does not override prior error).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • hannesrudolph
  • edelauna
  • taltas
  • navedmerchant

Poem

🐰 A rabbit crafts a public path so free,
Opencode models fetched with or without a key.
A button gleams to refresh with care,
Loading, success, and errors—all aware.
Tests hop boldly, guarding every state. ✨🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the bug, root cause, reproduction steps, fix, and tests. However, it lacks the required template sections: no explicit 'Related GitHub Issue' link, no 'Test Procedure' section, and no completed 'Pre-Submission Checklist'. Add the required template sections: include the GitHub issue number in the 'Related GitHub Issue' section, provide a 'Test Procedure' section with testing steps, and complete the 'Pre-Submission Checklist' with checkmarks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: unconditional fetching of Opencode Go models because the /models endpoint is public. It directly addresses the root cause and fix.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/webview/webviewMessageHandler.ts`:
- Line 1021: The const declaration for opencodeGoApiKey inside the switch case
has function-level scoping risk; wrap that switch case's body in a block (add {
} around the case's statements) so opencodeGoApiKey is block-scoped and cannot
be accessed by other switch clauses—locate the switch in
webviewMessageHandler.ts where opencodeGoApiKey is assigned and enclose the
case's statements in a local block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 15b8cd41-b80a-4fd5-9a1c-283fa3c6b2c7

📥 Commits

Reviewing files that changed from the base of the PR and between f1f7cb4 and 95d0fca.

📒 Files selected for processing (2)
  • src/core/webview/__tests__/webviewMessageHandler.spec.ts
  • src/core/webview/webviewMessageHandler.ts

// above. Gating it behind a key meant the picker stayed empty (and fell back to the default
// model) whenever the key wasn't yet in apiConfiguration at fetch time. The key is still
// forwarded when present.
const opencodeGoApiKey = message?.values?.opencodeGoApiKey ?? apiConfiguration.opencodeGoApiKey

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Wrap the variable declaration in a block to fix scoping issue.

The const opencodeGoApiKey declaration inside the switch case should be wrapped in curly braces to prevent potential scoping conflicts with other switch clauses.

🔧 Proposed fix
-			const opencodeGoApiKey = message?.values?.opencodeGoApiKey ?? apiConfiguration.opencodeGoApiKey
-
-			// Refresh the cache when a new key is explicitly provided (e.g. the Refresh Models button).
-			if (message?.values?.opencodeGoApiKey) {
-				await flushModels({ provider: "opencode-go", apiKey: opencodeGoApiKey }, true)
-			}
-
-			candidates.push({
-				key: "opencode-go",
-				options: { provider: "opencode-go", apiKey: opencodeGoApiKey },
-			})
+			{
+				const opencodeGoApiKey = message?.values?.opencodeGoApiKey ?? apiConfiguration.opencodeGoApiKey
+
+				// Refresh the cache when a new key is explicitly provided (e.g. the Refresh Models button).
+				if (message?.values?.opencodeGoApiKey) {
+					await flushModels({ provider: "opencode-go", apiKey: opencodeGoApiKey }, true)
+				}
+
+				candidates.push({
+					key: "opencode-go",
+					options: { provider: "opencode-go", apiKey: opencodeGoApiKey },
+				})
+			}

As per coding guidelines, Biome flagged: "Other switch clauses can erroneously access this declaration. Wrap the declaration in a block to restrict its access to the switch clause."

🧰 Tools
🪛 Biome (2.4.16)

[error] 1021-1021: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

(lint/correctness/noSwitchDeclarations)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/webview/webviewMessageHandler.ts` at line 1021, The const
declaration for opencodeGoApiKey inside the switch case has function-level
scoping risk; wrap that switch case's body in a block (add { } around the case's
statements) so opencodeGoApiKey is block-scoped and cannot be accessed by other
switch clauses—locate the switch in webviewMessageHandler.ts where
opencodeGoApiKey is assigned and enclose the case's statements in a local block.

…ode-go fetch

Mirror changes already made in webviewMessageHandler.spec.ts:
- successful responses: expect opencode-go call, assert mockModels
- individual provider failures: add mockResolvedValueOnce for opencode-go
- skips LiteLLM: assert mockModels instead of empty object

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/core/webview/__tests__/ClineProvider.spec.ts (1)

2469-2469: ⚡ Quick win

Use exact match assertion for consistency.

Line 2469 uses expect.objectContaining({ provider: "opencode-go" }) while other provider assertions in the same test use exact object matches (lines 2459-2467). Since the implementation always passes apiKey even when undefined, and this test has no opencodeGoApiKey configured, the assertion should be exact:

-		// Opencode Go's /models endpoint is public, so it is fetched like the other no-auth routers.
-		expect(getModels).toHaveBeenCalledWith(expect.objectContaining({ provider: "opencode-go" }))
+		expect(getModels).toHaveBeenCalledWith({ provider: "opencode-go", apiKey: undefined })

This matches the pattern used for other public providers like openrouter (line 2459) and aligns with the regression test assertion in webviewMessageHandler.spec.ts (context snippet 3).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/webview/__tests__/ClineProvider.spec.ts` at line 2469, Update the
assertion for getModels in ClineProvider.spec.ts to use an exact object match
instead of expect.objectContaining so it mirrors other provider assertions;
specifically change the call to expect(getModels).toHaveBeenCalledWith(...) to
assert the full object including provider: "opencode-go" and apiKey: undefined
(since the implementation always passes apiKey even when undefined).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/core/webview/__tests__/ClineProvider.spec.ts`:
- Line 2469: Update the assertion for getModels in ClineProvider.spec.ts to use
an exact object match instead of expect.objectContaining so it mirrors other
provider assertions; specifically change the call to
expect(getModels).toHaveBeenCalledWith(...) to assert the full object including
provider: "opencode-go" and apiKey: undefined (since the implementation always
passes apiKey even when undefined).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d94be830-5074-4c9c-9c97-d0e81b52692f

📥 Commits

Reviewing files that changed from the base of the PR and between 95d0fca and e06e845.

📒 Files selected for processing (1)
  • src/core/webview/__tests__/ClineProvider.spec.ts

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/webview/webviewMessageHandler.ts 33.33% 1 Missing and 1 partial ⚠️
...i/src/components/settings/providers/OpenCodeGo.tsx 96.55% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@proyectoauraorg proyectoauraorg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code Review: PR #437 — fix(opencode-go): fetch models unconditionally

Summary

This PR fixes a real and reproducible bug where the Opencode Go model picker stayed empty because the /models fetch was gated behind an API key that wasn't always present in apiConfiguration at fetch time. The fix is well-scoped, the root cause analysis in the PR description is thorough, and the approach of aligning Opencode Go with the other public routers (openrouter, vercel-ai-gateway) is the correct one.

What works well

  • Correct root cause identification. The PR description clearly demonstrates with curl and test output that the /models endpoint is public, making the gate unnecessary.
  • Minimal, focused change. Only 3 files modified, +54/-16 lines. The behavioral change is a single logical operation (removing the if (opencodeGoApiKey) gate), which reduces blast radius.
  • Good comment update. The misleading comment ("its /models endpoint requires auth") is replaced with a detailed explanation of why the unconditional fetch is correct and what the previous behavior caused.
  • Cache flush logic preserved. The flushModels call is correctly kept conditional on message?.values?.opencodeGoApiKey, so the cache is only invalidated when the user explicitly provides a new key (Refresh Models button). This avoids unnecessary re-fetches.
  • Test coverage is solid. The regression test in webviewMessageHandler.spec.ts explicitly verifies the keyless path (apiKey: undefined), and all three existing test suites are updated consistently.

Issues found

Minor — Block-scoping for const opencodeGoApiKey in switch case

File: src/core/webview/webviewMessageHandler.ts line 1021

CodeRabbit already flagged this in review #4404026771 but it has not been addressed in the second commit. The const opencodeGoApiKey declaration inside the switch case is function-scoped per JavaScript semantics. While it won't cause a runtime error (no other case declares a variable with the same name), it violates the noSwitchDeclarations lint rule and is inconsistent with the defensive pattern the other providers use.

The existing providers (litellm, poe, deepseek) avoid this by wrapping their logic in if blocks, which implicitly create block scope. Since Opencode Go's unconditional fetch removes the if gate, the declaration now sits directly in the switch case body.

Suggested fix: Wrap the Opencode Go block in curly braces to create explicit block scope:

{
    const opencodeGoApiKey = message?.values?.opencodeGoApiKey ?? apiConfiguration.opencodeGoApiKey

    // Refresh the cache when a new key is explicitly provided (e.g. the Refresh Models button).
    if (message?.values?.opencodeGoApiKey) {
        await flushModels({ provider: "opencode-go", apiKey: opencodeGoApiKey }, true)
    }

    candidates.push({
        key: "opencode-go",
        options: { provider: "opencode-go", apiKey: opencodeGoApiKey },
    })
}

Suggestion — Use exact assertion in ClineProvider.spec.ts line 2469

File: src/core/webview/__tests__/ClineProvider.spec.ts line 2469

The assertion uses expect.objectContaining({ provider: "opencode-go" }) while the equivalent assertions for other providers in the same test block use exact object matches. Since the implementation always passes apiKey (even when undefined), the assertion should be exact for consistency and to catch potential regressions where extra unexpected properties are introduced:

// Instead of:
expect(getModels).toHaveBeenCalledWith(expect.objectContaining({ provider: "opencode-go" }))

// Use:
expect(getModels).toHaveBeenCalledWith({ provider: "opencode-go", apiKey: undefined })

This also matches the pattern used in the regression test at webviewMessageHandler.spec.ts.

CI Status

All checks pass except codecov/patch, which reports a coverage delta. This is expected for a behavioral change that shifts code from "not reached" to "reached" — the new regression test should cover the keyless path. Worth verifying the uncovered lines are the flushModels conditional (which is covered by the existing "Refresh Models" test path).

Edge cases verified

  • No key configured: Fetch proceeds with apiKey: undefined — correct for a public endpoint.
  • Empty string key: The ?? operator only catches null/undefined, so an empty string would be passed as-is. This is harmless since the endpoint ignores the header.
  • Network failure: The safeGetModels wrapper catches errors and returns {}, so the UI gracefully falls back to the default model. Documented in the PR description as a separate follow-up concern.
  • Performance: The additional fetch runs in parallel via Promise.allSettled with all other providers — no sequential bottleneck introduced.

Verdict

Approve with minor comments. The core fix is correct, well-tested, and low-risk. The two issues above are non-blocking but should be addressed before merge for lint compliance and test consistency.


Reviewed by: DevOps Orquestador Maestro — zSys

@edelauna

edelauna commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Need to bump up coverage.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
webview-ui/src/components/settings/providers/__tests__/OpenCodeGo.spec.tsx (1)

147-154: ⚡ Quick win

Add a loading-state regression for non-Opencode-Go routerModels.

Please add a test where refresh is loading, then dispatch routerModels with values.provider set to another provider (for example "openrouter"), and assert success is not shown. This closes the cross-provider message-bus gap.

As per coding guidelines, “Use webview-ui tests for React rendering, hooks, component state, forms, validation, and webview UI wiring.”

Also applies to: 223-231

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/settings/providers/__tests__/OpenCodeGo.spec.tsx`
around lines 147 - 154, Add a new regression test after the existing "shows
success state when routerModels arrives while loading" test that verifies
success is not shown when routerModels is dispatched with a different provider.
Create a test that calls renderComponent with opencodeGoApiKey set, clicks the
refresh-button to start loading, then dispatches a routerModels message with
values.provider set to a different provider like "openrouter" (instead of the
current provider), and assert that the success message does not appear in the
document. This ensures that routerModels messages from other providers don't
incorrectly trigger success state for the OpenCodeGo provider.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@webview-ui/src/components/settings/providers/OpenCodeGo.tsx`:
- Around line 54-59: The code sets refreshStatus to "success" whenever a
"routerModels" message is received while loading, but since this listener is on
a shared window bus, other providers' messages can incorrectly trigger success
for Opencode-Go. Add an additional condition to check that
message.values?.provider === "opencode-go" in the else if block where
message.type === "routerModels" before calling setRefreshStatus("success") to
ensure only actual Opencode-Go responses mark the refresh as successful.

---

Nitpick comments:
In `@webview-ui/src/components/settings/providers/__tests__/OpenCodeGo.spec.tsx`:
- Around line 147-154: Add a new regression test after the existing "shows
success state when routerModels arrives while loading" test that verifies
success is not shown when routerModels is dispatched with a different provider.
Create a test that calls renderComponent with opencodeGoApiKey set, clicks the
refresh-button to start loading, then dispatches a routerModels message with
values.provider set to a different provider like "openrouter" (instead of the
current provider), and assert that the success message does not appear in the
document. This ensures that routerModels messages from other providers don't
incorrectly trigger success state for the OpenCodeGo provider.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fd58a22e-2cd6-4324-be0c-664df55acf7f

📥 Commits

Reviewing files that changed from the base of the PR and between a3683a5 and 4a5684a.

📒 Files selected for processing (2)
  • webview-ui/src/components/settings/providers/OpenCodeGo.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenCodeGo.spec.tsx

Comment on lines +54 to +59
} else if (message.type === "routerModels") {
if (refreshStatus === "loading") {
if (!errorJustReceived.current) {
setRefreshStatus("success")
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Gate success state to Opencode-Go responses only.

While loading, any routerModels message sets success. Since this listener is on the shared window bus, unrelated provider responses can incorrectly mark the Opencode-Go refresh as successful. Check message.values?.provider === "opencode-go" before setting "success".

Suggested fix
-			} else if (message.type === "routerModels") {
+			} else if (message.type === "routerModels") {
+				const providerName = message.values?.provider
 				if (refreshStatus === "loading") {
-					if (!errorJustReceived.current) {
+					if (providerName === "opencode-go" && !errorJustReceived.current) {
 						setRefreshStatus("success")
 					}
 				}
 			}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} else if (message.type === "routerModels") {
if (refreshStatus === "loading") {
if (!errorJustReceived.current) {
setRefreshStatus("success")
}
}
} else if (message.type === "routerModels") {
const providerName = message.values?.provider
if (refreshStatus === "loading") {
if (providerName === "opencode-go" && !errorJustReceived.current) {
setRefreshStatus("success")
}
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@webview-ui/src/components/settings/providers/OpenCodeGo.tsx` around lines 54
- 59, The code sets refreshStatus to "success" whenever a "routerModels" message
is received while loading, but since this listener is on a shared window bus,
other providers' messages can incorrectly trigger success for Opencode-Go. Add
an additional condition to check that message.values?.provider === "opencode-go"
in the else if block where message.type === "routerModels" before calling
setRefreshStatus("success") to ensure only actual Opencode-Go responses mark the
refresh as successful.

@navedmerchant

Copy link
Copy Markdown
Contributor

Skipping minor coderabbit comments and approving

@navedmerchant navedmerchant added this pull request to the merge queue Jun 19, 2026
Merged via the queue into Zoo-Code-Org:main with commit 0306f2b Jun 19, 2026
10 checks passed
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.

3 participants