Browse Source

fix: correct council/councillor prompt param order and warn path (#899)

Michael Henke 2 weeks ago
parent
commit
5455657d18

+ 1 - 1
docs/project-local-customization.md

@@ -89,7 +89,7 @@ is **inline > file > built-in default**:
    `console.warn` is emitted at agent construction:
    ```
    [oh-my-opencode] Agent '<name>': inline prompt overrides prompt file
-   (prompts/<name>.md). Remove the inline prompt to use the file.
+   (<name>.md). Remove the inline prompt to use the file.
    ```
    This is informational — the inline prompt takes effect as expected. The
    warning surfaces the conflict so you know the file is being ignored.

+ 1 - 1
src/agents/council.ts

@@ -65,8 +65,8 @@ export function createCouncilAgent(
   const prompt =
     resolvePrompt(
       'council',
-      undefined,
       customPrompt,
+      undefined,
       COUNCIL_AGENT_PROMPT,
       customAppendPrompt,
     ) + COUNCIL_SYNTHESIS_REINFORCEMENT;

+ 1 - 1
src/agents/councillor.ts

@@ -59,8 +59,8 @@ export function createCouncillorAgent(
 ): AgentDefinition {
   const prompt = resolvePrompt(
     'councillor',
-    undefined,
     customPrompt,
+    undefined,
     COUNCILLOR_PROMPT,
     customAppendPrompt,
   );

+ 2 - 2
src/agents/orchestrator.ts

@@ -14,7 +14,7 @@ export interface AgentDefinition {
  * Resolve agent prompt from inline/file/append inputs.
  *
  * Precedence: inline prompt > file prompt > fallback. An explicit inline
- * `override.prompt` wins over a `prompts/<agent>.md` file; the file is the
+ * `override.prompt` wins over a `<agent>.md` file; the file is the
  * shared default. `customAppendPrompt` always appends after whichever base
  * won. Deterministic per session (construction-time only) — cache-safe.
  */
@@ -27,7 +27,7 @@ export function resolvePrompt(
 ): string {
   if (inlinePrompt !== undefined && filePrompt !== undefined) {
     console.warn(
-      `[oh-my-opencode] Agent '${agentName}': inline prompt overrides prompt file (prompts/${agentName}.md). Remove the inline prompt to use the file.`,
+      `[oh-my-opencode] Agent '${agentName}': inline prompt overrides prompt file (${agentName}.md). Remove the inline prompt to use the file.`,
     );
   }
   const effectiveBase = inlinePrompt ?? filePrompt ?? fallback;

+ 1 - 1
src/agents/resolve-prompt-warn.test.ts

@@ -43,7 +43,7 @@ describe('resolvePrompt conflict warning', () => {
     expect(warn).toHaveBeenCalledTimes(1);
     const msg = warn.mock.calls[0][0] as string;
     expect(msg).toContain("'skeptic'");
-    expect(msg).toContain('prompts/skeptic.md');
+    expect(msg).toContain('skeptic.md');
     expect(msg).toContain('overrides');
   });