Carry forward the arbiter verdict too, not just the owner final
When a paired task ends on an arbiter ESCALATE (asking the user to choose), the user's next reply was carried into the fresh task with the owner's earlier final as context — not the arbiter message they were actually responding to. Generalize the carry-forward to the latest user-facing final (owner final OR arbiter verdict, whichever the task ended on), so the user can choose based on the last arbiter message without the new turn re-reading the whole prior conversation. The carried-forward guidance marker is now matched by a shared prefix so it triggers for both. Adds tests for the arbiter-escalation carry and the prefix guidance. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,28 @@ describe('message-runtime-prompts carry-forward guidance', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('prepends the carry-forward warning for a carried arbiter verdict too', () => {
|
||||
const prompt = buildPairedTurnPrompt({
|
||||
taskId: 'task-1',
|
||||
chatJid: 'group@test',
|
||||
timezone: 'UTC',
|
||||
missedMessages: [makeHumanMessage('1번 선택할게')],
|
||||
labeledFallbackMessages: [makeHumanMessage('1번 선택할게')],
|
||||
turnOutputs: [
|
||||
makeTurnOutput(
|
||||
'[Carried forward context from the previous task: latest arbiter verdict]\nESCALATE\n1) A 2) B',
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
expect(
|
||||
prompt.startsWith('System note:\nIf you see a message beginning with'),
|
||||
).toBe(true);
|
||||
expect(prompt).toContain(
|
||||
'Respond only to the latest human request and the current task.',
|
||||
);
|
||||
});
|
||||
|
||||
it('prepends a carry-forward warning to reviewer pending prompts', () => {
|
||||
const prompt = buildReviewerPendingPrompt({
|
||||
chatJid: 'group@test',
|
||||
|
||||
Reference in New Issue
Block a user