per-turn reminder: turn-composition protocol as its own system chunk after every GM turn, one live copy elided like the papers; handbook cut follows (short turns)
This commit is contained in:
+5
-1
@@ -10,7 +10,7 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { clerkJson } from './clerk.mjs';
|
||||
import { toolList, runTool, readSettings, runDir, expandVars } from './bundle.mjs';
|
||||
import { toolList, runTool, readSettings, runDir, expandVars, assembleReminder } from './bundle.mjs';
|
||||
import { renderView } from './session.mjs';
|
||||
|
||||
export class HttpError extends Error {
|
||||
@@ -36,6 +36,10 @@ export async function gmTurn(ctx, runId, line, user) {
|
||||
const agendaWire = agenda.map((d, i) => `${i}. ${d}`).join('; ');
|
||||
const content = `${line.trim()}\n\n<status>${paper.join(', ')}</status>\n<agenda>${agendaWire}</agenda>`;
|
||||
s.append({ t: 'msg', m: { role: 'user', content } });
|
||||
// the reminder follows the GM's prose as its own system chunk —
|
||||
// every turn, one live copy (older ones elide in the view)
|
||||
const reminder = assembleReminder(runId);
|
||||
if (reminder) s.append({ t: 'msg', m: { role: 'system', content: reminder }, reminder: true });
|
||||
return runLoop(ctx, runId, user);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user