Skip to content

add optional system prompt environment injection #1894

Description

@Jacubeit

Agents can have their custom system prompt. Environment system prompt gets added regardless.
Making this optional would reduce tokens and increase prompt adherence if this info is not needed for the agent to fulfill its task.

if (process.env.OPENCODE_NO_ENV_PROMPT !== 'true') {
  system.push(...(await SystemPrompt.environment()))
}

Or even better: per agent in config, as system prompts can be defined there anyways:

 "agent": {
    "build": {
      "mode": "primary",
      "model": "anthropic/claude-sonnet-4-20250514",
      "prompt": "{file:./prompts/build.txt}",
      "envinfo": false
      ...
   }
}

Activity

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