Refuse run ids that could leave the runs folder and stop replacements being read as patterns

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-05 11:38:58 -08:00
1 parent b17213322c
commit 0b6a376915
8 files changed
+37 -13

No files matched your search

+3 -3
View File
@@ -5,11 +5,11 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import type { AggregatedMetrics } from './types.js';
import { invokeLLM, type AgentType } from './invoke-llm.js';
const ANALYZE_PROMPT_PATH = new URL('../src/prompts/analyze.md', import.meta.url).pathname
.replace(/^\/([A-Za-z]:)/, '$1'); // Fix Windows path
const ANALYZE_PROMPT_PATH = fileURLToPath(new URL('../src/prompts/analyze.md', import.meta.url));
// ── Helpers ───────────────────────────────────────────────────────────────────
@@ -40,7 +40,7 @@ function readPromptFiles(plan2codeRoot: string): Record<string, string> {
function interpolate(template: string, vars: Record<string, string>): string {
let result = template;
for (const [key, value] of Object.entries(vars)) {
result = result.replaceAll(`{{${key}}}`, value);
result = result.replaceAll(`{{${key}}}`, () => value);
}
return result;
}