Skip to content

opencode2: Cursor model picker stays stale after the 24-hour cache expires #194

Closed

Description

@adonm

Environment: OpenCode 2.3.0 on Linux, using cursor-opencode-provider/plugin/opencode2 at 2ea6994.

Reproduction: In an isolated host, seed cursor-models.json with gemini-4-argon four seconds before its 24-hour expiry. Stub AvailableModels to return Argon and Carbon. Start OpenCode, wait until expiry, create a session without sending a prompt, and query model.list again.

Actual: The picker still lists only Argon. The stub received zero discovery requests. The provider log showed opencode2 models: ready count=1 at startup, with no second publication after expiry. ensureModels() returns early once the catalog is loaded and the credential is unchanged.

Expected: Host activity after expiry refreshes the inventory without reloading the Location. With the reference fix, the same test made one discovery request, logged opencode2 models: ready count=2, emitted provider.updated and model.updated, and showed Carbon. A failed refresh should keep the last good catalog. This expiry check used a stub, not a live 24-hour wait.

Activity

  1. added a commit that references this issue on Nov 24, 2026
    3dc9202
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions