Skip to content

tui: onboarding/connected provider state incorrect with config overrides #60590

Open

Description

@dimassfeb-09

Description:
In the TUI, a provider configured only via a setting override (e.g. a timeout) could be treated as "connected" because overlayProvider set activation="enabled" for any config item. This caused the onboarding prompt / connected-provider indicator to be wrong. Also connected-provider detection only checked integration connections, so providers available through models were missed.

Steps to reproduce:

  1. Set a provider config override that only changes settings (no endpoint/models).
  2. Observe TUI onboarding shows as dismissed/connected (or vice versa) incorrectly.
    EOF

Activity

  1. opencodejr commented on Oct 30, 2026

    @opencodejr
    Contributor

    Thanks for the report. I reproduced both parts on v2.2.3, and both still happen on the latest dev (95fc3c87).

    Setting-only override: with no credentials, opencode models lists no openai/* models. Adding only {"provider":{"openai":{"settings":{"timeout":60000}}}} makes all 79 OpenAI models show as available, though there is still no key. The script below reproduces this. Open PR #59440 addresses this part.

    Onboarding: in the TUI, a provider defined only in config (no saved connection) answers prompts normally, but the sidebar keeps showing "Getting started / Connect provider". The onboarding check only counts integration connections. The recording and screenshot below show it.

    Related:

    recording.mp4

    Screenshot

    Reproduction script (models.sh)
    #!/usr/bin/env bash
    # #60590 part 1: a provider config entry that only changes a setting (here openai settings.timeout)
    # makes the whole openai catalog "available" with no credentials.
    # Usage: ./models.sh                       # uses `opencode` from PATH (tested with 2.2.3)
    #        OC_DEV=/path/to/opencode ./models.sh   # runs the CLI/server from a source checkout
    set -u
    PORT=4931
    run() { # $1 = label, $2 = global config json
      local root; root=$(mktemp -d); mkdir -p "$root/home" "$root/cfg" "$root/proj"
      echo "$2" > "$root/cfg/opencode.json"
      local envs=(env -i PATH="$PATH" HOME="$root/home" OPENCODE_CONFIG_DIR="$root/cfg" OPENCODE_PASSWORD=pw)
      if [ -n "${OC_DEV:-}" ]; then
        ( cd "$OC_DEV/packages/cli" && exec "${envs[@]}" bun --conditions=browser src/index.ts serve --port $PORT ) > "$root/serve.log" 2>&1 &
        local pid=$!; sleep 12
        ( cd "$OC_DEV/packages/cli" && "${envs[@]}" bun --conditions=browser src/index.ts models --server http://127.0.0.1:$PORT ) > "$root/out.txt" 2>&1
        kill $pid 2>/dev/null; sleep 1
      else
        ( cd "$root/proj" && "${envs[@]}" opencode models --standalone ) > "$root/out.txt" 2>&1
      fi
      echo "== $1: $(grep -c '^openai/' "$root/out.txt") openai/* models listed ($(wc -l < "$root/out.txt") total)"
      grep '^openai/' "$root/out.txt" | head -3
    }
    run "no config" '{}'
    run "openai settings.timeout override only" '{"provider":{"openai":{"settings":{"timeout":60000}}}}'

    Run it: bash models.sh

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions