Skip to content

Commit 94aebf3

Browse files
committed
Revert "Warn when an agent plugin prompt file is missing (#928)"
This reverts commit 9ff51db.
1 parent 509c1d2 commit 94aebf3

2 files changed

Lines changed: 6 additions & 28 deletions

File tree

src/plugins/agent-plugins.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,4 @@ describe("resolveAgentPluginProfiles", () => {
176176
),
177177
).toBe(true);
178178
});
179-
180-
test("warns once when a prompt file is missing and still loads the profile", async () => {
181-
const { mod, config } = agentModule("p1", [
182-
{ id: "scout", systemPromptPath: "prompts/does-not-exist.md" },
183-
]);
184-
mod.dir = "/tmp/wt-cl-6724-missing-prompt-dir";
185-
const warnings: string[] = [];
186-
const profiles = await resolveAgentPluginProfiles([mod], config, (msg) =>
187-
warnings.push(msg),
188-
);
189-
expect(profiles.length).toBe(1);
190-
expect(defined(profiles[0]).systemPromptRole).toBeUndefined();
191-
expect(warnings.length).toBe(1);
192-
expect(warnings[0]).toContain('"p1"');
193-
expect(warnings[0]).toContain('"scout"');
194-
expect(warnings[0]).toContain("prompts/does-not-exist.md");
195-
expect(defined(warnings[0])).toMatch(/unreadable|missing/i);
196-
});
197179
});

src/plugins/agent-plugins.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,14 @@ export async function resolveAgentPluginProfiles(
9090
profile.systemPromptRole === undefined &&
9191
mod.dir !== undefined
9292
) {
93-
const promptPath = join(mod.dir, profile.systemPromptPath);
9493
try {
95-
const promptRaw = await readFile(promptPath, "utf8");
96-
profile.systemPromptRole = promptRaw.trim();
97-
} catch (err) {
98-
const reason =
99-
(err instanceof Error ? err.message : String(err))
100-
.split("\n")[0]
101-
?.trim() || "unknown error";
102-
onWarning(
103-
`plugin "${mod.manifest.id}" agent "${profile.id}" systemPromptPath "${profile.systemPromptPath}" unreadable (${promptPath}): ${reason}`,
94+
const promptRaw = await readFile(
95+
join(mod.dir, profile.systemPromptPath),
96+
"utf8",
10497
);
98+
profile.systemPromptRole = promptRaw.trim();
99+
} catch {
100+
// Missing prompt file is non-fatal — the profile loads without a role.
105101
}
106102
}
107103
// Provenance for search_agents: Claude marketplace installs stamp

0 commit comments

Comments
 (0)