Skip to content

Changes inside config directories do not trigger config-backed reloads #37429

Closed

Description

@kitlangton

Parent

Related to #8751 and #10899.

What to build

Publish config.updated when a watched file inside an already discovered OpenCode config directory changes, even if the parsed opencode.json(c) document entries are unchanged.

On V2 commit 4a7f760d25, Config receives the directory watcher update and rediscovers the same Config entry list. Config.reload returns early after its deep equality check, so config-backed plugins never rescan changed command, agent, or auto-discovered plugin files.

This reproduces with a real Vim :saveas creating .opencode/commands/release-check.md, and with a deterministic mocked-watcher test. It contradicts the V2 command documentation that says Markdown command changes reload automatically.

Acceptance criteria

  • Creating, editing, deleting, or renaming a command Markdown file updates the live command registry.
  • Equivalent agent and auto-discovered plugin file changes trigger their existing reload paths.
  • A watched directory event does not require a semantically different opencode.json(c) snapshot.
  • Event coalescing still avoids redundant reload storms for one editor save.
  • A native watcher integration test and the focused Config regression test pass.

Blocked by

None - can start immediately.

Activity

  1. added
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Jul 17, 2026
  2. kitlangton commented on Jul 17, 2026

    @kitlangton
    ContributorAuthor

    Draft red-test coverage is in #37427. The focused Config test publishes a watcher update for a file inside a discovered config directory and currently times out waiting for config.updated.

  3. kitlangton commented on Jul 28, 2026

    @kitlangton
    ContributorAuthor

    All acceptance criteria are now covered on v2: command source reloads landed in #39160 and #39171, agent and auto-discovered plugin equivalents in the same series and #39174, coalescing is covered by the debounce tests, and #39216 adds the end-to-end native watcher integration test (real file writes through parcel, Config watch topology, the source filter, and the debounced reload into the live registry). Configured local plugin source watching is intentionally out of scope and tracked separately.

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

    2.0bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions