paseo icon indicating copy to clipboard operation
paseo copied to clipboard

Respect OpenCode Model/Mode defaults in workspace creation

Open thisisryanswift opened this issue 7 months ago • 9 comments

Paseo currently tends to resolve and send explicit model/mode values even when the user did not choose them. For OpenCode, that can override OpenCode’s own config/default behavior.

Distinguish user-selected values from inferred defaults, only send OpenCode model/mode overrides when the user explicitly selected them, and improve model selection so OpenCode runtime/config models are represented clearly.

Acceptance criteria:

  • OpenCode sessions use OpenCode config defaults when no explicit Paseo selection was made.
  • User-selected model/mode values are still sent correctly.
  • Suggested/default models are visible in the selector.
  • Runtime-discovered OpenCode models and configured/profile models can coexist.
  • Tests cover explicit vs implicit selection behavior.

I have a commit for this if you want me to open a PR.

Not sure which of these issues you'll see first, so putting the same apology for opening multiple here!

thisisryanswift avatar Apr 29 '26 16:04 thisisryanswift

same as the other issue, feel free to send a PR!

thanks

boudra avatar Apr 30 '26 04:04 boudra

Keeping this open as a current OpenCode bug.

The report was filed on April 29 after #291 added server-side default model and mode resolution on April 12. Current main still replaces omitted model and mode values before provider launch, and the workspace composer also submits its resolved model and displayed mode. OpenCode therefore receives concrete overrides even when the user made no explicit selection.

#645 proposed tracking explicit selections and preserving omitted OpenCode values, but it was closed without merge. #1167 later scoped provider discovery by workspace, which improves which models are discovered but does not change the override behavior. This remains valid provider-specific work; p2 reflects the limited scope and the workaround of selecting the intended model and mode explicitly.

paseo-bot avatar Jul 30 '26 19:07 paseo-bot

Confirming this is still present on current main (checked today):

  • AgentManager.normalizeConfig still fills in a concrete model whenever none was supplied (resolveDefaultModel defaults to true; resolveDefaultModelId picks the catalog's isDefault model, else the first) — agent-manager.ts.
  • The OpenCode provider then passes that model along per prompt (this.config.model ? { model: ... }), so OpenCode's own config default never applies when the user didn't explicitly pick a model.

For context: I recently opened the equivalent preference on the OpenCode side (anomalyco/opencode#55372, session.new_model: last_used | default). There the TUI's /new and /clear carried the previous session's model into every new session — the same "last-used leaks into new sessions" family, with the same cost rationale: a pinned default model is cost control, and silent drift is silent overspend.

#645 proposed tracking explicit selections and preserving omitted values before it was closed during the old-PR cleanup. I'm happy to open a fresh PR reviving that approach against the latest release (updating this issue first, as suggested): only send model/mode overrides when the user explicitly selected them, and let OpenCode's configured defaults apply otherwise. Is that still the preferred direction, or has the design thinking moved on since #645?

benjaminfrombe avatar Oct 14 '26 11:10 benjaminfrombe

Thanks @benjaminfrombe, your check on current main is counted on this issue. Priority stays p2: choosing the model and mode explicitly in Paseo still gets OpenCode the intended values.

On the direction: the maintainer invited a PR here, and #645 was closed in a cleanup of old PRs that had not been accepted, with a note to update this issue against the latest release first. Nothing on this issue or on #645 records a different direction since. The pull request section of CONTRIBUTING.md covers what a new PR needs, including that PRs are closed by default.

paseo-bot[bot] avatar Oct 14 '26 20:10 paseo-bot[bot]

Re-verified against current main (today): the bug is still present.

  • AgentManager.normalizeConfig still fills in a concrete model whenever none was supplied (resolveDefaultModel defaults to true; resolveDefaultModelId picks the catalog's isDefault model, else the first) — agent-manager.ts around line 5243.
  • The OpenCode provider then forwards that resolved model per prompt, so OpenCode's own config default never applies when the user made no explicit selection.

I've rebased my PR (#7319) onto current main — it applies cleanly and typechecks. It distinguishes user-selected values from inferred defaults (selectionSource) and only sends OpenCode model/mode overrides when the user explicitly chose them, which covers the acceptance criteria listed here. Happy to adjust direction if you'd prefer a different approach.

benjaminfrombe avatar Oct 19 '26 17:10 benjaminfrombe

I reproduced the model-default override in this issue with real OpenCode on Linux. With the same project configuration and no model supplied, a direct OpenCode session selected the configured model, while daemon creation selected the first catalog model instead. Both turns stopped before a reply; completed replies and the desktop mode/selector behavior remain unverified.

Choosing the intended model and mode explicitly remains the workaround. The proposed fix also drops saved Paseo selections from untouched composers across providers: my regression test displayed remembered Codex gpt-5.4 and full-access, then submitted neither, while the baseline preserved both.

I am leaving this open with needs-maintainer for the decision about how OpenCode defaults should coexist with saved Paseo selections. No replacement PR was opened; updates stay here, and nothing is needed from the reporter or contributor.

paseo-bot[bot] avatar Oct 19 '26 18:10 paseo-bot[bot]

@boudra — Updated PR #7319 after the review feedback: rebased onto current main and fixed the regression the bot flagged (saved per-provider selections are no longer dropped; they now submit explicitly). Implicit selections now record only a model the provider explicitly flags as isDefault in its catalog — providers without one (like OpenCode) keep the model unset so their own configured default applies, and the first-model fallback is gone. CI is green apart from one pre-existing flake that also fails on the unmodified branch. Could you weigh in on the needs-maintainer policy question when you get a chance?

benjaminfrombe avatar Oct 29 '26 12:10 benjaminfrombe

Correction to my comment above: the CI workflow run on the updated head is stuck at "action_required" — GitHub requires a maintainer to approve Actions for first-time contributor branches before anything executes. So nothing has actually run remotely; the results I mentioned (server 222 tests, app unit 424 tests, e2e 21/22 with the one failure also failing on the unmodified branch) were all verified locally. Could you click "Approve and run workflows" on the PR when reviewing?

benjaminfrombe avatar Oct 29 '26 12:10 benjaminfrombe

I checked #9507 against this issue. Review.

  • Model: the app leaves the model out of the request when a composer is untouched, and the daemon then sets no model unless the catalog marks a default. The model the OpenCode config names applies.
  • Mode: the first untouched workspace sends no mode. The second sends modeId: "build", because the first submit saves the mode the composer displayed as a preference, and the PR counts every saved preference as an explicit choice.
  • The CLI, MCP create_agent, and schedules still resolve the first catalog model for OpenCode.

The PR adds a pinned-default model setting and a selectionSource field to the agent config protocol. Whether to take those on is still the maintainer's decision about how OpenCode defaults should coexist with saved Paseo selections, so this stays open. I didn't open a replacement PR, and nothing is needed from the reporter or the contributor.

paseo-bot[bot] avatar Nov 17 '26 08:11 paseo-bot[bot]