Files
makelore/tests/fixtures/pi-0.84.2-projector-fixtures.ts

166 lines
4.2 KiB
TypeScript

// Captured against @earendil-works/pi-coding-agent@0.84.2 RPC/session shapes.
export const PI_084_TEXT_TURN = {
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
events: [
{
type: 'message_start',
message: { role: 'user', content: 'Implement the change', timestamp: 1 },
},
{
type: 'message_start',
message: {
role: 'assistant',
content: [],
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
stopReason: 'stop',
timestamp: 2,
},
},
{
type: 'message_update',
assistantMessageEvent: { type: 'text_start', contentIndex: 0 },
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
},
{
type: 'message_update',
assistantMessageEvent: { type: 'text_delta', contentIndex: 0, delta: 'Implemented' },
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
},
{
type: 'message_update',
assistantMessageEvent: { type: 'text_end', contentIndex: 0, content: 'Implemented' },
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
},
{
type: 'message_end',
message: {
role: 'assistant',
content: [{ type: 'text', text: 'Implemented' }],
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
stopReason: 'stop',
timestamp: 2,
},
},
],
entries: {
leafId: 'entry-assistant-a',
entries: [
{
type: 'message',
id: 'entry-user-a',
parentId: null,
timestamp: '2026-08-23T00:00:00.000Z',
message: { role: 'user', content: 'Implement the change', timestamp: 1 },
},
{
type: 'message',
id: 'entry-assistant-a',
parentId: 'entry-user-a',
timestamp: '2026-08-23T00:00:01.000Z',
message: {
role: 'assistant',
content: [{ type: 'text', text: 'Implemented' }],
usage: {
input: 12,
output: 4,
cacheRead: 2,
cacheWrite: 0,
totalTokens: 18,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
stopReason: 'stop',
timestamp: 2,
},
},
],
},
stats: {
contextUsage: { tokens: 18, contextWindow: 100_000, percent: 0.018 },
tokens: { input: 12, output: 4, cacheRead: 2, cacheWrite: 0, total: 18 },
},
} as const;
export const PI_084_AUTO_RETRY_FAILURE_EVENTS = [
{
type: 'auto_retry_start',
attempt: 3,
maxAttempts: 3,
delayMs: 1000,
errorMessage: 'sensitive provider retry detail',
},
{
type: 'auto_retry_end',
success: false,
attempt: 3,
finalError: 'sensitive final provider detail',
},
{ type: 'agent_settled' },
] as const;
export const PI_084_SUMMARIZATION_RETRY_FAILURE_EVENTS = [
{ type: 'compaction_start', reason: 'threshold' },
{
type: 'summarization_retry_scheduled',
attempt: 1,
maxAttempts: 2,
delayMs: 500,
errorMessage: 'sensitive summary provider detail',
},
{
type: 'summarization_retry_attempt_start',
source: 'compaction',
reason: 'threshold',
},
{ type: 'summarization_retry_finished' },
{
type: 'compaction_end',
reason: 'threshold',
aborted: false,
willRetry: false,
errorMessage: 'sensitive exhausted summary detail',
},
{ type: 'agent_settled' },
] as const;