fix: /compact masked by room role header in both runners
prependRoomRoleHeader was called BEFORE /compact detection, turning "/compact" into "[PAIRED ROOM: owner]\n/compact" which failed the exact match check. Now session commands are detected first.
This commit is contained in:
@@ -504,7 +504,8 @@ async function main(): Promise<void> {
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
let prompt = containerInput.prompt;
|
||||
const rawPrompt = containerInput.prompt;
|
||||
let prompt = rawPrompt;
|
||||
if (containerInput.isScheduledTask) {
|
||||
prompt = `[SCHEDULED TASK]\n\n${prompt}`;
|
||||
}
|
||||
@@ -512,7 +513,12 @@ async function main(): Promise<void> {
|
||||
if (pending.length > 0) {
|
||||
prompt += '\n' + pending.join('\n');
|
||||
}
|
||||
prompt = prependRoomRoleHeader(prompt, containerInput.roomRoleContext);
|
||||
// Prepend room role header AFTER checking for session commands,
|
||||
// so /compact is not masked by the header prefix.
|
||||
const isSessionCommand = rawPrompt.trim() === '/compact';
|
||||
if (!isSessionCommand) {
|
||||
prompt = prependRoomRoleHeader(prompt, containerInput.roomRoleContext);
|
||||
}
|
||||
|
||||
try {
|
||||
log('Runtime selected: app-server');
|
||||
|
||||
Reference in New Issue
Block a user