Skip to content

v2: config instructions entries are never loaded (only AGENTS.md scanned) #51262

Closed

Description

@pkuqiuning

Bug

In opencode v2 (tested on 2.0.14 and 2.0.16), the instructions array in opencode.json is accepted by the config schema but its entries never reach the session context. Only AGENTS.md files are discovered and loaded.

Evidence

  • ConfigInstructionPlugin.projectSource scans up({ targets: ["AGENTS.md"], ... }) and globalSource reads only <config>/AGENTS.md. Nothing iterates config.instructions (the v1 session/instruction.ts globUp loop that handles glob patterns, ~ expansion, absolute paths, and remote URLs is not wired in v2).
  • Empirical: three canary tests all fail — absolute path outside project, project-root relative path, config-dir relative path, and project-level .opencode/opencode.json instructions. The serialized instruction blob in instruction_blob table contains only the two AGENTS.md files.
  • Debug watcher log shows watcher subscribe only for AGENTS.md files; instruction entries get no subscription.
  • Docs (https://opencode.ai/docs/rules/ + config page) still document instructions as working: paths, glob patterns, ~, and remote URLs.

Impact

Migration from v1 silently loses all custom instruction files referenced via instructions — including shared team rules files (CONTRIBUTING.md, .cursor/rules/*.md) and remote URL instructions.

Expected

config.instructions entries resolve (local globs relative to config dir, ~-expansion, absolute paths, remote URLs) and are included in the discovered instruction file list, or the schema/docs should mark the key unsupported in v2.

Activity

  1. pkuqiuning commented on Sep 25, 2026

    @pkuqiuning
    Author

    Withdrawn — the injection need is covered by the maintained opencode-rules plugin (2.0.0-beta line, session.synthetic delivery verified working on 2.0.16). Leaving the config.instructions schema/docs mismatch noted for others hitting it.

  2. added 2 commits that reference this issue on Oct 6, 2026
    a276e6f
    8227111
  3. added a commit that references this issue on Oct 14, 2026
    3e6f389
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions