Explorar el Código

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

Michael Henke hace 3 semanas
padre
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:
    `console.warn` is emitted at agent construction:
    ```
    ```
    [oh-my-opencode] Agent '<name>': inline prompt overrides prompt file
    [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
    This is informational — the inline prompt takes effect as expected. The
    warning surfaces the conflict so you know the file is being ignored.
    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 =
   const prompt =
     resolvePrompt(
     resolvePrompt(
       'council',
       'council',
-      undefined,
       customPrompt,
       customPrompt,
+      undefined,
       COUNCIL_AGENT_PROMPT,
       COUNCIL_AGENT_PROMPT,
       customAppendPrompt,
       customAppendPrompt,
     ) + COUNCIL_SYNTHESIS_REINFORCEMENT;
     ) + COUNCIL_SYNTHESIS_REINFORCEMENT;

+ 1 - 1
src/agents/councillor.ts

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

+ 2 - 2
src/agents/orchestrator.ts

@@ -14,7 +14,7 @@ export interface AgentDefinition {
  * Resolve agent prompt from inline/file/append inputs.
  * Resolve agent prompt from inline/file/append inputs.
  *
  *
  * Precedence: inline prompt > file prompt > fallback. An explicit inline
  * 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
  * shared default. `customAppendPrompt` always appends after whichever base
  * won. Deterministic per session (construction-time only) — cache-safe.
  * won. Deterministic per session (construction-time only) — cache-safe.
  */
  */
@@ -27,7 +27,7 @@ export function resolvePrompt(
 ): string {
 ): string {
   if (inlinePrompt !== undefined && filePrompt !== undefined) {
   if (inlinePrompt !== undefined && filePrompt !== undefined) {
     console.warn(
     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;
   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);
     expect(warn).toHaveBeenCalledTimes(1);
     const msg = warn.mock.calls[0][0] as string;
     const msg = warn.mock.calls[0][0] as string;
     expect(msg).toContain("'skeptic'");
     expect(msg).toContain("'skeptic'");
-    expect(msg).toContain('prompts/skeptic.md');
+    expect(msg).toContain('skeptic.md');
     expect(msg).toContain('overrides');
     expect(msg).toContain('overrides');
   });
   });