mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
fix(cli): stop re-prompting on wmill refresh prompts (#9357)
referencesIncludeLine required the include token to be the entire trimmed line. The wmill-default CLAUDE.md template is `Instructions are in @AGENTS.md` — include mid-sentence — so the migration prompt fired every run on files wmill itself wrote. Accept the include as a whitespace-separated token on any non-comment line. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -207,13 +207,19 @@ async function reconcileIncludingFile(options: {
|
||||
}
|
||||
|
||||
function referencesIncludeLine(content: string, includeLine: string): boolean {
|
||||
// Match only when the include sits on a line by itself (allowing leading
|
||||
// and trailing whitespace). Earlier we split on `\s+`, but that
|
||||
// false-positives on commented-out includes like `<!-- @AGENTS.cli.md -->`
|
||||
// where the middle token equals the include. CRLF is handled by the
|
||||
// `\r?\n` split.
|
||||
// Match when the include appears as a whitespace-separated token on any
|
||||
// line that isn't an HTML comment. We can't require the include to be on a
|
||||
// line by itself: our own CLAUDE.md default is `Instructions are in
|
||||
// @AGENTS.md` (one sentence), and a strict equality check made `wmill
|
||||
// refresh prompts` re-prompt every run on files wmill itself wrote.
|
||||
// Skipping comment-bearing lines keeps `<!-- @AGENTS.cli.md -->` from
|
||||
// false-positiving.
|
||||
for (const line of content.split(/\r?\n/)) {
|
||||
if (line.trim() === includeLine) {
|
||||
const trimmed = line.trim();
|
||||
if (trimmed.startsWith("<!--") || trimmed.endsWith("-->")) {
|
||||
continue;
|
||||
}
|
||||
if (trimmed.split(/\s+/).includes(includeLine)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user