GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): await models before listing by kitlangton · Pull Request #41783 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

Make the first model.list request against a newly started server wait for model-providing plugins to finish initializing. This restores opencode models --standalone output on cold start instead of silently returning no models.

Closes #41071

Before / After

Before: A standalone server became HTTP-ready while PluginSupervisor was still activating the initial plugin generation. An immediate model.list request read the empty Catalog, returned HTTP 200 with data: [], and the CLI printed nothing before exiting 0.

After: model.list waits for PluginSupervisor.flush before reading the catalog, matching the existing model.default readiness boundary. If initialization does not settle within five seconds, the endpoint returns the existing model-catalog service-unavailable error rather than a successful empty response.

How

  • packages/server/src/handlers/model.ts applies the existing bounded model-catalog initialization wait to model.list.
  • packages/server/test/model.test.ts starts a fresh server with a configured custom model and immediately requests /api/model, asserting that the cold-start response includes that model.

Scope

  • No CLI output or exit-code behavior changes are needed; the fix is at the server model-list consistency boundary.
  • No protocol or generated-client surfaces change.
  • Provider loading and plugin supervision behavior are unchanged.

Testing

  • bun run test test/model.test.ts --rerun-each 3 from packages/server (3 passes)
  • bun run test from packages/server (18 passes, 11 skips)
  • bun typecheck from packages/server
  • Push hook: bun turbo typecheck --concurrency=3 (33 successful tasks)
  • bunx prettier --check src/handlers/model.ts test/model.test.ts from packages/server

The regression test was also run before the handler change and reproduced the bug as HTTP 200 with { "data": [] }.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton
fix(server): await models before listing
7d85538
@github-actions github-actions Bot added the contributor label Aug 11, 2026
@kitlangton
kitlangton marked this pull request as ready for review August 11, 2026 16:17
@kitlangton
kitlangton merged commit 23b0688 into v2 Aug 11, 2026
9 of 10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the model-list-ready branch August 11, 2026 16:18
@opencode-agent opencode-agent Bot mentioned this pull request Aug 11, 2026
The models command with the --standalone flag shows no models and exits with the code 0 #41071
Closed
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
@kitlangton
fix(server): await models before listing (anomalyco#41783)
aafb8d0
@argszero argszero mentioned this pull request Oct 12, 2026
cli: opencode plugin list prints "No plugins found" on the first call per cold location #54654
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.