Explorar o código

load `OPENCODE_CONFIG_DIR` AGENTS.md into the system prompt (#7115)

Thomas Gormley hai 1 mes
pai
achega
630476afc0
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      packages/opencode/src/session/system.ts

+ 5 - 0
packages/opencode/src/session/system.ts

@@ -15,6 +15,7 @@ import PROMPT_ANTHROPIC_SPOOF from "./prompt/anthropic_spoof.txt"
 
 import PROMPT_CODEX from "./prompt/codex.txt"
 import type { Provider } from "@/provider/provider"
+import { Flag } from "@/flag/flag"
 
 export namespace SystemPrompt {
   export function header(providerID: string) {
@@ -66,6 +67,10 @@ export namespace SystemPrompt {
     path.join(os.homedir(), ".claude", "CLAUDE.md"),
   ]
 
+  if (Flag.OPENCODE_CONFIG_DIR) {
+    GLOBAL_RULE_FILES.push(path.join(Flag.OPENCODE_CONFIG_DIR, "AGENTS.md"))
+  }
+
   export async function custom() {
     const config = await Config.get()
     const paths = new Set<string>()