Fix default conversation system prompt recompilation routing [LET-7976] (#1373)

This commit is contained in:
Devansh Jain
2026-03-12 19:34:35 -07:00
committed by GitHub
parent 182c65b77e
commit 94ff9f6796
4 changed files with 85 additions and 80 deletions

View File

@@ -1,13 +1,11 @@
import {
type RecompileAgentSystemPromptOptions,
recompileAgentSystemPrompt,
} from "../../agent/modify";
import { recompileAgentSystemPrompt } from "../../agent/modify";
export type MemorySubagentType = "init" | "reflection";
type RecompileAgentSystemPromptFn = (
conversationId: string,
options?: RecompileAgentSystemPromptOptions,
agentId: string,
dryRun?: boolean,
) => Promise<string>;
export interface MemorySubagentCompletionArgs {
@@ -46,9 +44,7 @@ export async function handleMemorySubagentCompletion(
inFlight = (async () => {
do {
deps.recompileQueuedByConversation.delete(conversationId);
await recompileAgentSystemPromptFn(conversationId, {
...(conversationId === "default" ? { agentId } : {}),
});
await recompileAgentSystemPromptFn(conversationId, agentId);
} while (deps.recompileQueuedByConversation.has(conversationId));
})().finally(() => {
// Cleanup runs only after the shared promise settles, so every