Skip to content

instructions array in opencode.json not injected in v2.0.28 — worked in v1.19.0 #55345

Closed as duplicate

Description

@yg-codes

OpenCode version

v2.0.28 (v2 line, installed via mise latest). Comparison below is against v1.19.0, the latest release on the GitHub releases page -- noting that the releases page only tracks v1.x tags while v2.x is distributed via the website/other channels.

Minimal repro

/tmp/pluto-token.md:

The magic word is PLUTO-3. When asked for the magic word, reply with only: PLUTO-3

Global ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["/tmp/pluto-token.md"]
}
$ cd /tmp
$ opencode run --standalone --model <model> \
    "Reply with exactly one line: MAGIC=<magic word>. If no magic word appears in your instruction context, reply exactly: NONE"
NONE                     # v2.0.28

$ mise x opencode@1.19.0 -- opencode run --model <model> "...same prompt..."
MAGIC=PLUTO-3            # v1.19.0

Also checked on v2.0.28

  • Absolute path (above) fails too -- so this is not the relative-path resolution problem discussed in Issue Report: Custom instruction files in opencode.jsonc not being loaded #4758; the "use absolute paths" workaround suggested there does not hold on v2.0.28.
  • Project-level opencode.json with instructions -- not injected either (tried a path inside the project, and an absolute path). opencode debug config parses and displays the array in both the global and project documents, so config resolution sees it; session injection ignores it.
  • A multi-entry global array with ~/ paths and globs -- not injected.

What does work in the same v2.0.28 session

AGENTS.md discovery is fine: global ~/.config/opencode/AGENTS.md loads, and AGENTS.md/CLAUDE.md files are picked up per level from cwd up to the git root (verified with a two-token sandbox: repo-root and cwd CLAUDE.md both injected; a CLAUDE.md above the git root does not load; non-git directories only get the global file).

Related

Activity

  1. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the clean repro! I think this is a duplicate of #51341, which reports the same thing: in v2 the instructions array in opencode.json passes validation and shows up in opencode debug config, but nothing loads it into the session. AGENTS.md discovery still works.

    Possible duplicates and related items, ordered by likelihood:

    To follow progress, you can subscribe to #51341 or #51422. Until then, putting the content in AGENTS.md, or referencing it from there, is the way to get it loaded.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for confirming, and for the clear v1 vs v2 comparison. Your matrix matches what #51341 tracks: v2 reads the instructions field from both global and project config but never loads the files into the session, while AGENTS.md discovery keeps working.

    Your comment looks like it was written for #51341. If you haven't already, it's worth posting it there too, so the data point sits with the main issue and PR #51422.

    As agreed, this issue will close as a duplicate of #51341.

  3. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #51341. As you confirmed, it's the same problem: v2 reads the instructions field from both global and project config but never loads the files into the session. Thanks again for the clear repro and the v1.19.0 vs v2.0.28 comparison.

    To follow progress, subscribe to #51341 and PR #51422. If you find a case that #51341 doesn't cover, reply here and we'll take another look.

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