Skip to content

attach client should not refresh models.dev on every connection #10781

Closed

Description

@nxxxsooo

Problem

When using opencode attach to connect to an already running opencode serve server, the client still performs a models.dev refresh on every connection, causing ~1 second delay.

Expected Behavior

The attach client should:

  1. Skip models.dev network request
  2. Reuse model information from the server
  3. Connect instantly (< 100ms)

Current Behavior

$ time opencode attach http://localhost:4096 --version
INFO  2026-01-27T06:27:37 +20ms service=models.dev file={} refreshing
1.1.36
real    1.236s

The models.dev refreshing log appears even though the server already has this information cached.

Environment

  • opencode version: 1.1.36
  • macOS (Apple Silicon)
  • Server running: opencode serve --port 4096
  • Client: opencode attach http://localhost:4096

Impact

Every new terminal session has ~1 second startup delay, which defeats the purpose of the server/client architecture (fast reconnection).

Suggested Fix

  • Move models.dev refresh to server-side only
  • Client should fetch model list from server via the existing connection
  • Or add --skip-model-refresh flag / OPENCODE_SKIP_MODEL_REFRESH env var

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    on Jan 27, 2026
  2. github-actions commented on Jan 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. added a commit that references this issue on Jan 27, 2026
    e70a018
  4. github-actions commented on Mar 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

perfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions