Files
hapi/shared/fixtures/chat/event-api-error-folding.json
T
weishu c1ecb4798e feat(fixtures): batch 2 — events, permissions, sidechains, flavors, catalogs (K6)
34 new golden chat fixtures generated from the web pipeline, plus a
machine-generated modes catalog:

- Claude output: away_summary/microcompact_boundary/compact_boundary system
  subtypes, <task-notification> summary extraction, multi-block assistant
  message with an array-of-parts (text+image) tool_result
- AgentEvent union completed: switch/message/error/title-changed(+dedupe)/
  limit-warning(pipe text)/api-error folding/turn-duration/compact-summary/
  abort-restore/unknown-type passthrough; thread-goal updated+cleared (silent)
- Permission lifecycle via agentState.completedRequests: approved_for_session
  (mode+allowTools), denied with reason, canceled, AskUserQuestion flat
  answers, request_user_input nested answers (all with explicit createdAt)
- Sidechain: Task tool_use with parentToolUseId-grouped subagent children
- codex family: error, context_compacted, generated-image, review JSON,
  thread-goal messages, CodexBash call/result pair, exploration tool group
- cli-output: cli-origin command block + stdout merge
- agy flavor (output envelope): agy_message, agy_tool_action run_command
  mapping; cursor ACP plan snapshot (copilot skipped: identical codex shapes)
- generator now also emits shared/fixtures/catalogs/modes.json from
  shared/src/modes.ts (per-flavor permission modes with labels/tones);
  self-conformance test covers it; README documents the catalogs contract
2026-08-17 12:04:22 +08:00

187 lines
6.4 KiB
JSON

{
"description": "foldApiErrorEvents: three consecutive api_error system entries (retry 1, 2, 3) fold into a single agent-event carrying the LATEST api-error state; a following assistant text ends the run.",
"expected": {
"blocks": [
{
"createdAt": 1755000000000,
"id": "msg-user-351",
"kind": "user-text",
"localId": null,
"text": "Summarize the diff."
},
{
"createdAt": 1755000008900,
"event": {
"error": {
"message": "Overloaded",
"status": 529
},
"maxRetries": 10,
"retryAttempt": 3,
"type": "api-error"
},
"id": "msg-agent-354",
"kind": "agent-event"
},
{
"createdAt": 1755000015000,
"id": "msg-agent-355:0",
"kind": "agent-text",
"localId": null,
"text": "The diff renames the retry flag and threads it through the upload path."
}
],
"hasReadyEvent": false,
"latestUsage": null,
"visibleBlocks": [
{
"createdAt": 1755000000000,
"id": "msg-user-351",
"kind": "user-text",
"localId": null,
"text": "Summarize the diff."
},
{
"createdAt": 1755000008900,
"event": {
"error": {
"message": "Overloaded",
"status": 529
},
"maxRetries": 10,
"retryAttempt": 3,
"type": "api-error"
},
"id": "msg-agent-354",
"kind": "agent-event"
},
{
"createdAt": 1755000015000,
"id": "msg-agent-355:0",
"kind": "agent-text",
"localId": null,
"text": "The diff renames the retry flag and threads it through the upload path."
}
]
},
"fixtureVersion": 1,
"input": {
"agentState": null,
"messages": [
{
"content": {
"content": {
"text": "Summarize the diff.",
"type": "text"
},
"role": "user"
},
"createdAt": 1755000000000,
"id": "msg-user-351",
"localId": null,
"seq": 1
},
{
"content": {
"content": {
"data": {
"error": {
"message": "Overloaded",
"status": 529
},
"maxRetries": 10,
"retryAttempt": 1,
"subtype": "api_error",
"type": "system",
"uuid": "92d3f3a5-8a0b-4c1a-9e4d-f5a6b7c8d352"
},
"type": "output"
},
"role": "agent"
},
"createdAt": 1755000002000,
"id": "msg-agent-352",
"localId": null,
"seq": 2
},
{
"content": {
"content": {
"data": {
"error": {
"message": "Overloaded",
"status": 529
},
"maxRetries": 10,
"retryAttempt": 2,
"subtype": "api_error",
"type": "system",
"uuid": "a3e4a4b6-9b1c-4d2b-8f5e-a6b7c8d9e353"
},
"type": "output"
},
"role": "agent"
},
"createdAt": 1755000004500,
"id": "msg-agent-353",
"localId": null,
"seq": 3
},
{
"content": {
"content": {
"data": {
"error": {
"message": "Overloaded",
"status": 529
},
"maxRetries": 10,
"retryAttempt": 3,
"subtype": "api_error",
"type": "system",
"uuid": "b4f5b5c7-0c2d-4e3c-9a6f-b7c8d9e0f354"
},
"type": "output"
},
"role": "agent"
},
"createdAt": 1755000008900,
"id": "msg-agent-354",
"localId": null,
"seq": 4
},
{
"content": {
"content": {
"data": {
"message": {
"content": [
{
"text": "The diff renames the retry flag and threads it through the upload path.",
"type": "text"
}
],
"model": "claude-opus-4-1-20250805",
"role": "assistant"
},
"parentUuid": null,
"type": "assistant",
"uuid": "c5a6c6d8-1d3e-4f4d-8b7a-c8d9e0f1a355"
},
"type": "output"
},
"role": "agent"
},
"createdAt": 1755000015000,
"id": "msg-agent-355",
"localId": null,
"seq": 5
}
],
"options": {
"hasMoreMessages": false
}
},
"name": "event-api-error-folding"
}