You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Folder named agents.md in a parent directory blocks all instructions (EISDIR): "Instruction initialization blocked by unavailable sources: core/instructions" #52301
When a parent directory of the project contains a folder named agents.md (in my case a git clone of a repository called agents.md), every prompt in that project fails with:
Session failed: Instruction initialization blocked by unavailable sources: core/instructions
V2 searches for AGENTS.md from the project up to $HOME (#41633). On macOS's case-insensitive file system, the lookup for ~/code/org/AGENTS.md matches the folder ~/code/org/agents.md/. Reading it fails with EISDIR, and that single failure blocks every instruction source, so the session cannot run.
Expected: Paths that aren't regular files are skipped, and the session runs normally.
Actual: Every prompt fails. Log:
level=WARN message="failed to load instruction source" source=project
cause=FileSystem.readFile (/Users/…/code/xxx/agents.md) EISDIR: illegal operation on a directory
level=ERROR message="Failed to drain Session"
cause="Instructions.InitializationBlocked: Instruction initialization blocked by unavailable sources: core/instructions"
Additional findings:
After moving the folder away, sessions keep failing until opencode service restart. The failed source is cached in the running service and not retried (no new "failed to load instruction source" line is logged).
Worked in V1, which didn't search above the project root.
Don't let one failing instruction source block all instructions.
Retry failed sources instead of caching the failure until the service restarts.
Plugins
No response
OpenCode version
opencode v2.0.20
Steps to reproduce
On macOS (case-insensitive file system), create a folder ~/code/org/agents.md/. In my case it's a git clone of a repository named agents.md; an empty folder should do.
Start OpenCode in a sibling project, e.g. ~/code/org/some-repo.
Send any prompt, and it fails with "Instruction initialization blocked by unavailable sources: core/instructions".
Remove or move ~/code/org/agents.md/ and send another prompt. It still fails.
Run opencode service restart and send another prompt. It now works.
This issue might be a duplicate of an existing issue. Please check:
#52290: Reports the same Instruction initialization blocked by unavailable sources: core/instructions failure on the first prompt, though its root cause is not yet clear.
This issue might be a duplicate of an existing issue. Please check:
#52290: Reports the same Instruction initialization blocked by unavailable sources: core/instructions failure on the first prompt, though its root cause is not yet clear.
similar error message reported but the cause seem to be very different
#52576 merged into v2.0.22. This issue is still open.
I didn't start OpenCode. On a Linux tree with a directory named AGENTS.md above two real files, v2.0.21 fs.up (exists) included the directory. readFileStringSafe still only catches NotFound and PermissionDenied, so EISDIR is isolated into Instructions.unavailable and the whole project source dies. v2.0.22 type: "file" skipped the directory and the files stayed available.
Nested after a read: with the directory between two files on the walk, a load that throws on EISDIR is swallowed and every later AGENTS.md is dropped. type: "file" keeps those later files.
instruction-discovery.test.ts now expects type: "file" on the options object. It does not create an AGENTS.md directory.
Activity
github-actions commentedon Sep 30, 2026
This issue might be a duplicate of an existing issue. Please check:
Instruction initialization blocked by unavailable sources: core/instructionsfailure on the first prompt, though its root cause is not yet clear.hilleer commentedon Sep 30, 2026
similar error message reported but the cause seem to be very different
foma-agent commentedon Oct 2, 2026
#52576 merged into v2.0.22. This issue is still open.
I didn't start OpenCode. On a Linux tree with a directory named AGENTS.md above two real files, v2.0.21
fs.up(exists) included the directory.readFileStringSafestill only catches NotFound and PermissionDenied, so EISDIR is isolated intoInstructions.unavailableand the whole project source dies. v2.0.22type: "file"skipped the directory and the files stayed available.Nested after a read: with the directory between two files on the walk, a load that throws on EISDIR is swallowed and every later AGENTS.md is dropped.
type: "file"keeps those later files.instruction-discovery.test.tsnow expectstype: "file"on the options object. It does not create an AGENTS.md directory.Tarquinen commentedon Oct 20, 2026
This was fixed by #52576. That PR merged into the
v2branch, so GitHub didn't close this issue automatically. Closing as completed.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊