Skip to content

feat(providers): re-query effort options after model switch - #225

Merged
j35dev merged 5 commits into
mainfrom
feat/acp-effort-requery
Sep 15, 2026
Merged

j35dev merged 5 commits into
mainfrom
feat/acp-effort-requery

Conversation

@j35dev

@j35dev j35dev commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

OpenCode advertises its effort selector per-model over ACP (reasoning-capable models only), so the default-model catalog probe hides the chip even with a reasoning model selected. This adds a model-aware lookup plus turn-time refresh, all through ACP. pnpm verify green.


Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

@j35dev

j35dev commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Review — request changes

The ACP adapter half is sound: applyModel returns post-switch configOptions, and the new driver test covers a thinker model advertising low/medium/high and applying saved high.

The renderer EffortChip does not finish the job.

1. Unsupported models keep a stale chip (SessionView.tsx ~1083)
Empty providers.efforts is ignored, so a plain model keeps the previous reasoning model's options. Empty is overloaded (no selector vs probe failed). A successful empty lookup should setOptions([]) and hide the chip. setDynamicEfforts from a model-specific probe also poisons the kind-global catalog.

2. Startup / model switch can wipe a valid saved effort (SessionView.tsx ~1061)
apply() from providers.models sets loaded=true with empty kind-catalog options before the model-specific RPC returns. The validate effect then session.updates effort: null. For OpenCode with persisted effort=high, that value is gone by the time the chip appears.

loaded is never reset on modelId change, so the same hole fires on every switch.

The one new renderer test is happy-path only (empty catalog, non-empty model probe, chip shows). It never passes a saved effort.

Do not merge until 1 and 2 are fixed and tested. #224 (composer picker collapse) is a subset of this branch and is landing separately.

Skip list: #223 stays open as requested.

@j35dev

j35dev commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Update: #224 landed on main (rebased through #222). This branch still contains that commit plus the effort-requery work, so it will need a rebase. The two EffortChip bugs in the review above still block merge.

petros-double-test1 and others added 2 commits September 15, 2026 21:45
Main reworked `applyModel` to report a `ModelApplyOutcome` (for the
model-unavailable notice and the drift watch) while this branch used its
return value to carry the selectors the agent sends back with a switch.
Kept both: the outcome's `applied` variant now carries `refreshed`, so the
effort re-query reads it without losing the notice or the drift watch.
The adapter advertises both efforts and models, and publishes both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The effort chip released `loaded` as soon as the kind's catalog resolved,
but that catalog is probed against the default model. For a model whose
levels only the per-model query knows, the reset effect saw a saved effort
missing from the generic list and cleared it before the model's own answer
arrived — losing the setting this control exists to keep.

Withhold `loaded` until the per-model probe settles when there is a model
to probe. An effort no list advertises is still cleared, just later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@j35dev
j35dev merged commit 996025e into main Sep 15, 2026
7 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.

2 participants