Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

switch-provider.ts does not change models #158

Open

Description

@ktneely

Scenario

This PAI-OpenCode is a manual upgrade from a previous installation by performing a new installation and then manually copying over various updated files in the USER and skills directories. Notably, I did not copy over files from the old profiles or agents subdirectories. This was because I had a pretty modified version of 2.x and the migration script didn't work for me.

Steps to reproduce

  1. symlink ~/.opencode to a subdir under $HOME, e.g. ~/dev/pai/.opencode
  2. Perform a fresh 3.0 installation
  3. from ~, execute bun run .opencode/tools/switch-provider.ts zen-paid (or other profiles)
  4. look at ~/.opencode/opencode.json (which is actually in the symlinked dir) and every model is still big-pickle.

Solution

It looks like the script is trying to write to ~/opencode.json instead of ~/.opencode/opencode.json though it doesn't actually do so. Still, changing line 31 from:
const OPENCODE_JSON_PATH = join(PROJECT_ROOT, "opencode.json");
to:
const OPENCODE_JSON_PATH = join(OPENCODE_DIR, "opencode.json");

seems to have done the trick and now ~/.opencode/opencode.json is being updated correctly.

Happy to submit a pull request, but wanted to highlight this first and see if there's something else strange going on.

Activity

  1. coderabbitai commented on Apr 18, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #76 - PR-09: New Skills + Migration Tools (3 files) [merged]
    #93 - refactor(installer): align with current pai-opencode structure [merged]
    #94 - fix(installer): prevent broken pai alias and missing opencode [merged]
    #104 - feat(pai): separate pai command from opencode [closed]
    #138 - fix(core): OpenCode-native architecture — zero bootstrap, Zen free default [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. jurgenhaas commented on May 2, 2026

    @jurgenhaas

    I'm having the same issue and can confirm that the proposed change in the switch provider script actually works. However, I can imagine that the script does it without the change such that it updated the provider for the current project only, and not globally. But when executed from the home directory, it doesn't seem to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions