refactor(ai): streamline codex prompt handling

This commit is contained in:
Mario Zechner
2026-01-06 10:27:51 +01:00
parent b04ce9fe95
commit 858c6bae8a
6 changed files with 99 additions and 104 deletions
@@ -0,0 +1,26 @@
export interface CodexSystemPrompt {
instructions: string;
developerMessages: string[];
}
export function buildCodexSystemPrompt(args: {
codexInstructions: string;
bridgeText: string;
userSystemPrompt?: string;
}): CodexSystemPrompt {
const { codexInstructions, bridgeText, userSystemPrompt } = args;
const developerMessages: string[] = [];
if (bridgeText.trim().length > 0) {
developerMessages.push(bridgeText.trim());
}
if (userSystemPrompt && userSystemPrompt.trim().length > 0) {
developerMessages.push(userSystemPrompt.trim());
}
return {
instructions: codexInstructions.trim(),
developerMessages,
};
}