[PR #11581] fix: prevent duplicate AGENTS.md injection when reading instruction files #13849

Closed
opened 2026-02-16 18:18:40 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11581

State: closed
Merged: Yes


Summary

  • When reading an AGENTS.md file directly, the same file was being re-injected as a system-reminder, causing duplicate "Read/Loaded" log entries
  • Skip instruction files that match the file being read to prevent this duplication

Changes

  • Modified InstructionPrompt.resolve() in packages/opencode/src/session/instruction.ts
  • Added check to skip when found instruction file equals the target file being read
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11581 **State:** closed **Merged:** Yes --- ## Summary - When reading an AGENTS.md file directly, the same file was being re-injected as a system-reminder, causing duplicate "Read/Loaded" log entries - Skip instruction files that match the file being read to prevent this duplication ## Changes - Modified `InstructionPrompt.resolve()` in `packages/opencode/src/session/instruction.ts` - Added check to skip when found instruction file equals the target file being read
yindo added the pull-request label 2026-02-16 18:18:40 -05:00
yindo closed this issue 2026-02-16 18:18:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13849