Atlas: opening message, isInit flag, strip trigger from history

- Add opening message instruction to atlas prompt
- Handle isInit flag in atlasChat() to not store the greeting trigger
  as a user turn in conversation history
- Update server.ts to pass is_init through to atlasChat()

Made-with: Cursor
This commit is contained in:
2026-03-02 16:55:16 -08:00
parent ecd207108c
commit e8fdbff9f4
3 changed files with 25 additions and 3 deletions

View File

@@ -73,6 +73,8 @@ export async function atlasChat(
ctx: ToolContext,
opts?: {
preloadedHistory?: LLMMessage[];
/** When true, the user message is an internal init trigger and should not be stored in history */
isInit?: boolean;
}
): Promise<AtlasChatResult> {
const llm = createLLM(process.env.ATLAS_MODEL ?? 'A', { temperature: 0.5 });
@@ -86,7 +88,10 @@ export async function atlasChat(
const oaiTools = toOAITools(ATLAS_TOOLS);
const systemPrompt = resolvePrompt('atlas');
session.history.push({ role: 'user', content: userMessage });
// For init triggers, don't add the synthetic prompt as a user turn
if (!opts?.isInit) {
session.history.push({ role: 'user', content: userMessage });
}
const buildMessages = (): LLMMessage[] => [
{ role: 'system', content: systemPrompt },