fix: Custom instructions ignored by some models (GPT-5.2) - base rules take precedence #7629

Open
opened 2026-02-16 18:07:47 -05:00 by yindo · 5 comments
Owner

Originally created by @MuhammedAlkhudiry on GitHub (Jan 26, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Custom user instructions defined in .opencode/agents/*.md or custom plan instructions are being ignored by some models (e.g., GPT-5.2), while other models (e.g., Claude Opus) correctly follow them.

Example: My custom plan instructions specify creating session files in docs/ai/sessions/<YYYY-MM-DD>-<slug>/plan.md, but GPT-5.2 refuses to create files, citing OpenCode's base rules. Opus follows my instructions correctly.

The issue appears to be that OpenCode's built-in base rules are taking precedence over user-defined custom instructions for certain models, rather than the expected behavior where custom instructions should override/extend base rules.

Steps to reproduce

  1. Create custom agent instructions that include file creation (e.g., session files)
  2. Use a model like GPT-5.2
  3. Ask the agent to perform an action that triggers the custom instruction
  4. Observe that the model follows OpenCode base rules instead of custom instructions

Expected behavior

Custom user instructions should take precedence over (or properly extend) OpenCode's base rules across all models.

Actual behavior

  • Opus: Follows custom instructions correctly
  • GPT-5.2: Ignores custom instructions, follows base rules only

Environment

  • OpenCode version: Latest
  • OS: macOS
  • Terminal: Various
Originally created by @MuhammedAlkhudiry on GitHub (Jan 26, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description Custom user instructions defined in `.opencode/agents/*.md` or custom plan instructions are being ignored by some models (e.g., GPT-5.2), while other models (e.g., Claude Opus) correctly follow them. **Example:** My custom plan instructions specify creating session files in `docs/ai/sessions/<YYYY-MM-DD>-<slug>/plan.md`, but GPT-5.2 refuses to create files, citing OpenCode's base rules. Opus follows my instructions correctly. The issue appears to be that OpenCode's built-in base rules are taking precedence over user-defined custom instructions for certain models, rather than the expected behavior where custom instructions should override/extend base rules. ## Steps to reproduce 1. Create custom agent instructions that include file creation (e.g., session files) 2. Use a model like GPT-5.2 3. Ask the agent to perform an action that triggers the custom instruction 4. Observe that the model follows OpenCode base rules instead of custom instructions ## Expected behavior Custom user instructions should take precedence over (or properly extend) OpenCode's base rules across all models. ## Actual behavior - **Opus**: Follows custom instructions correctly ✅ - **GPT-5.2**: Ignores custom instructions, follows base rules only ❌ ## Environment - **OpenCode version**: Latest - **OS**: macOS - **Terminal**: Various
Author
Owner

@github-actions[bot] commented on GitHub (Jan 26, 2026):

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

  • #10431: Bug: subtask: false configuration in custom commands is ignored - This shows a similar pattern where user configuration is being ignored in favor of built-in system instructions.
  • #10438: gemini-3-pro-preview in opencode tends to avoid grep/glob (possible system prompt issue) - This indicates that model-specific system prompts may have inconsistencies.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 26, 2026): This issue might be a duplicate of existing issues. Please check: - #10431: Bug: subtask: false configuration in custom commands is ignored - This shows a similar pattern where user configuration is being ignored in favor of built-in system instructions. - #10438: gemini-3-pro-preview in opencode tends to avoid grep/glob (possible system prompt issue) - This indicates that model-specific system prompts may have inconsistencies. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 26, 2026):

what is the name of ur agent, im assuming ur overriding the built in plan agent but it has some other details injected in that could be causing this

@rekram1-node commented on GitHub (Jan 26, 2026): what is the name of ur agent, im assuming ur overriding the built in plan agent but it has some other details injected in that could be causing this
Author
Owner

@MuhammedAlkhudiry commented on GitHub (Jan 26, 2026):

  • it's plan.md ~/.config/opencode/agent/plan.md
    this is "part" of my instructions (i can provide full file if needed)
## On Approval (User says "go", "build", "approved", etc.)

When user approves the plan, **persist it to a session file before building**—don't rely on memory:

1. Create session folder: `docs/ai/sessions/<YYYY-MM-DD>-<slug>/`
2. Write the plan to `plan.md` in that session
3. Output: `**Session created:** docs/ai/sessions/YYYY-MM-DD-slug/`
4. Proceed to build mode with session path

i have given it the permissions

    "plan": {
      "tools": {
        "write": true
      }
    }

(opus 4.5 does create files, but gpt5.2 reject even after insisting!)

@MuhammedAlkhudiry commented on GitHub (Jan 26, 2026): - it's plan.md `~/.config/opencode/agent/plan.md` this is "part" of my instructions (i can provide full file if needed) ``` ## On Approval (User says "go", "build", "approved", etc.) When user approves the plan, **persist it to a session file before building**—don't rely on memory: 1. Create session folder: `docs/ai/sessions/<YYYY-MM-DD>-<slug>/` 2. Write the plan to `plan.md` in that session 3. Output: `**Session created:** docs/ai/sessions/YYYY-MM-DD-slug/` 4. Proceed to build mode with session path ``` i have given it the permissions ``` "plan": { "tools": { "write": true } } ``` (opus 4.5 does create files, but gpt5.2 reject even after insisting!)
Author
Owner

@MuhammedAlkhudiry commented on GitHub (Jan 26, 2026):

i feel this is part of bigger problem, is that plan mode / todo in opencode is not persistent.

this also means we can't do "clear context then build" (i think for most people after planning, you already at 40-60% context)

this leads to bad user flow (and it happens many many times daily):
AGENT plan → USER switch to build → AGENT write plan → USER start new + mention plan in build mode

good ux would be:
AGENT plan + persist → USER trigger clear context + build

all of this are in claude code

@MuhammedAlkhudiry commented on GitHub (Jan 26, 2026): i feel this is part of bigger problem, is that `plan mode / todo` in opencode is not persistent. this also means we can't do "clear context then build" (i think for most people after planning, you already at 40-60% context) this leads to bad user flow (and it happens many many times daily): AGENT plan → USER switch to build → AGENT write plan → USER start new + mention plan in build mode good ux would be: AGENT plan + persist → USER trigger clear context + build all of this are in claude code
Author
Owner

@MuhammedAlkhudiry commented on GitHub (Jan 28, 2026):

@rekram1-node , are there any plan to support that? i heard about experimental plan mode, does it fix it?

@MuhammedAlkhudiry commented on GitHub (Jan 28, 2026): @rekram1-node , are there any plan to support that? i heard about experimental plan mode, does it fix it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7629