Skip to content

The instructions config field is loaded, documented and recommended, but never read #52417

Closed as duplicate

Description

@feiiiiii5

Description

instructions in opencode.json is accepted, validated, migrated from v1 and stored on the config document — but nothing ever reads it. The docs recommend it, and /init points users at it.

  • packages/schema/src/config.ts:90 declares it: "Additional paths or URLs supplying ambient instructions".
  • packages/core/src/config/normalize.ts:222 decodes it onto the document; v1/config/migrate.ts:59 carries it across from v1.
  • packages/core/test/config/config.test.ts:1277 pins the loaded value.
  • The only producer of instruction files is config/plugin/instruction.ts, whose sources are two hard-coded AGENTS.md lookups (:62 global, :68 ancestor walk). It does not take a Config dependency.
  • git grep 'info.instructions' over packages/*/src returns nothing.

docs/rules.mdx:134 calls this field "the recommended approach", and documents glob patterns, remote URLs and a 5 second fetch timeout. None of that exists today. A team that follows the docs gets no instruction files, and no diagnostic that the field was ignored.

This is not a regression from #41629: instruction-discovery.ts had no Config reference before that refactor either.

Three ways to close it, with different costs:

  1. Honour it as documented. Add a third source in instruction.ts that expands each document's instructions (~/, globs via fs.scan, http(s) with the documented timeout), mirroring config/plugin/skill.ts:83. Needs decisions on the base directory for relative paths, ordering against AGENTS.md, and whether glob matches are watched.
  2. Warn and move on. Emit a diagnostic when instructions is present but unsupported. Small, and stops misleading users, but leaves a documented feature dead.
  3. Remove the field and the docs. Correct, but breaks anyone who set it and keeps the config.test.ts:1277 assertion meaningful only as a schema test.

I'd lean towards 1, with 2 as a stopgap if wiring it up needs design time. Happy to take whichever you prefer — option 1 is mostly mechanical once the three questions above are settled.

Steps to reproduce

  1. In a repository root, add to opencode.json:
    { "instructions": ["docs/development-standards.md", "packages/*/AGENTS.md"] }
  2. Start opencode in that directory and ask the model something the file answers.
  3. The file is never loaded, and the config emits no diagnostic or warning.

OpenCode version

v2, 5556ad563

Operating System

macOS

Activity

  1. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #51341: Reports that the V2 config.instructions field is not loaded into session context, with the same behavior described here.
    • #51262: Reports that V2 config.instructions entries are never loaded; the report notes the same schema/docs mismatch.
  2. feiiiiii5 commented on Oct 1, 2026

    @feiiiiii5
    Author

    Duplicate of #51341, which already has a fix in flight: #51422.

    I had independently traced the same root cause (the field is decoded onto the config document but no producer reads it) and missed that #51341 was open. Withdrawing this one so the thread stays in one place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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