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(cli): await plugin activation before caching ACP catalog by kitlangton · Pull Request #46682 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Sep 1, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Why

ACP loads its per-directory catalog on the first request and caches the promise indefinitely. Location plugins activate asynchronously, so an early request could observe only built-in models and agents, accept the first available default, and pin that partial catalog for the life of the connection. The existing 5-second poll only retried while no model or primary agent was present; it did not distinguish "still activating" from "activated, but the configured provider is genuinely absent". A probe with the server default set to test/test-model still selected an ambient built-in model.

The server's provider list/get tests had the same assumption in reverse: they required cold plugin activation to finish inside a two-second read timeout, which failed on Windows CI.

What Changes

A public wait for plugin activation, and ACP uses it before its first catalog read.

Surface Before After
POST /api/plugin/await-activation?directory=… — Waits for configured activation at that Location to settle; returns 204
client.plugin.awaitActivation({ location }) — Generated Effect and Promise clients
ACP loadCatalog Polls model/agent lists for up to 5 s Awaits activation once, then keeps the existing background-discovery poll
ACP catalog cache Caches a partial catalog forever Caches only after activation; a failed load is evicted so the next request retries
sequenceDiagram
    participant Editor as ACP client
    participant ACP as acp/service.ts
    participant Server
    participant Supervisor as PluginSupervisor
    Editor->>ACP: first request for cwd
    ACP->>Server: POST /api/plugin/await-activation
    Server->>Supervisor: awaitActivation
    Supervisor-->>Server: configured plugins settled
    Server-->>ACP: 204
    ACP->>Server: model.list / model.default / agent.list / …
    ACP-->>Editor: catalog with configured defaults
Loading

Activation Wait Contract

Completion means configured activation and missing-package installs have settled at that Location. It does not mean every plugin succeeded or that background resource discovery has finished, which is why ACP retains its short discovery poll after the barrier. Cancelling the wait does not cancel activation; the handler delegates to the existing PluginSupervisor.awaitActivation and both plugin contexts still expose only Pick<PluginApi, "list">, so plugin setup cannot acquire a self-wait.

The provider endpoint tests now hold activation explicitly, assert that list/get stay responsive while it is pending, and check configured results after release. Request guards and test deadlines are unchanged.

Scope

Public protocol addition plus generated client surfaces, one ACP call site, and server tests. Model and plugin list endpoints remain nonblocking. Stacked on #46610; the State materialization change in #46725 is stacked on this PR because its fresh reads made the ACP partial-catalog window observable in CI.

Verification

# packages/protocol, server, cli, client
bun typecheck
# packages/client — generated surfaces are in sync
bun run generate
# packages/server
bun run test test/plugin-activation.test.ts test/provider.test.ts
# packages/cli
bun run test test/acp
  • Typechecks pass for protocol, server, cli, and client; bun run generate produces no diff.
  • Server activation and provider tests: 4 passed, 0 failed, covering blocked activation, nonblocking reads, Location independence, failed-setup settlement, and waiter cancellation (a 499 response, with activation surviving and a later wait returning 204).
  • CLI ACP suites including the isolated real-subprocess fixtures: 94 passed, 0 failed. The new regression does not cache an available model before plugin activation settles fails before the change: the first request was /api/skill rather than /api/plugin/await-activation.

Stack

  1. test(core): make Windows-flaky shell and npm tests deterministic #46610
  2. fix(cli): await plugin activation before caching ACP catalog #46682 👈 current
  3. fix(core): rebuild registry state on read #46725

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions github-actions Bot added the contributor label Sep 1, 2026
This was referenced Sep 1, 2026
fix(core): rebuild registry state on read #46631
Closed
test(core): make Windows-flaky shell and npm tests deterministic #46610
Merged
@kitlangton
kitlangton force-pushed the acp-activation branch from f61dc5c to 3560d7d Compare September 1, 2026 21:48
@kitlangton
kitlangton changed the base branch from shell-retention-test to v2 September 2, 2026 00:45
@kitlangton kitlangton mentioned this pull request Sep 2, 2026
fix(core): copy models.dev snapshot without structuredClone #46710
Merged
@kitlangton
kitlangton force-pushed the acp-activation branch from 3560d7d to 3f68aa4 Compare September 2, 2026 01:58
kitlangton added 2 commits September 1, 2026 22:08
@kitlangton
fix(cli): await plugin activation before caching ACP catalog
f8c56f7
@kitlangton
test(server): separate provider reads from activation
fa66cb8
Gate configured-provider activation instead of requiring cold startup to finish inside a read timeout. Assert that list and get return while activation is held, then verify the configured provider after activation settles.
@kitlangton
kitlangton force-pushed the acp-activation branch from 3f68aa4 to fa66cb8 Compare September 2, 2026 02:09
@kitlangton
chore(client): regenerate await-activation status order
dc5a90a
@kitlangton kitlangton mentioned this pull request Sep 2, 2026
fix(core): rebuild registry state on read #46725
Closed
@kitlangton
kitlangton marked this pull request as ready for review September 2, 2026 14:43
@kitlangton
kitlangton merged commit 74fbe19 into v2 Sep 2, 2026
10 checks passed

Uh oh!

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

@kitlangton
kitlangton deleted the acp-activation branch September 2, 2026 14:44
This was referenced Sep 2, 2026
fix(core): rebuild registry state on read #46825
Merged
fix(core): wait for plugin activation before session entry points #46878
Merged
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
@kitlangton
fix(cli): await plugin activation before caching ACP catalog (anomaly…
4b44cf0
…co#46682)
@BambinoSK BambinoSK mentioned this pull request Oct 19, 2026
session/resume fails right after initialize with "Location plugins did not finish activating" #57204
Closed
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.