For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Preserve a background subagent provider failure message through task notification, user-visible Agent result, existing failure hover, and snapshot restore.
Architecture: The child turn already throws a structured error whose cause retains the provider message. The background finalizer will select that existing primary message once, place it in both the failed summary and <error>, and the shared notification parser will carry it into desktop-continuous and replayable projections. Existing Agent/ToolLayout UI consumes toolCall.error; no component, copy, or i18n change is required.
Tech Stack: TypeScript, Vitest, WDIO Electron E2E, case-local DeepSeek replay fixtures.
执行失败 and the existing hover/copy interaction unchanged.Agent <type> task "<description>" failed.; do not translate it or synthesize HTTP/code labels.finishReason=stop subagent and main-model 429 queue/retry semantics.desktop-continuous and mobile/service web-remote-replayable projection boundaries.ToolLayout.tsx, Agent renderer styling, or locale files.Files:
apps/zcode-cli/docs/design/v2/tool/07-subagent.mddocs/conversation-session-case-catalog.mddocs/testing/conversation-session-background-e2e-coverage-matrix.mddocs/testing/conversation-session-e2e-coverage-matrix.mdInterfaces:
Produces: accepted BG26 setup/action/assertion and BGE automation mapping.
[x] Record the exact failed summary, <error>, hover, idle, and restore assertions.
[x] Record that 429 is a representative child failure only; main-model 429 and empty stop remain out of scope.
Files:
packages/desktop/test/e2e/conversation-session/background/conversation-session-background-subagent-rate-limit.test.tspackages/desktop/test/e2e/fixtures/upstream/conversation-session/conversation-session-background-subagent-rate-limit.jsonpackages/desktop/test/e2e/fixtures/cases/conversation-session/conversation-session-background-subagent-rate-limit.jsonInterfaces:
Produces: a case-local fixture that launches one background Agent, returns repeatable child-only 429 responses with retry-after: 0, and consumes the failed task notification in the parent.
[x] Create a main fixture that emits Agent(run_in_background=true) with stable parent/child markers.
[x] Create an unlimited child-only 429 fixture using lastUserMessageIncludes so parent requests cannot match it.
[x] Assert the provider-visible notification contains <status>failed</status>, the provider message in <error>, and the same message immediately after failed. in <summary>.
[x] Assert renderer store and DOM show failed, expanded output contains the exact summary, and hovering 执行失败 exposes the provider message.
[x] Switch to a new draft and back; repeat status/output/hover assertions from restored snapshot.
[x] Run fixture check and explicit-fixture WDIO. Expected RED: current output remains generic or restored status is completed/error is missing.
Files:
apps/zcode-cli/packages/core/tests/subagent-background.test.tspackages/shared/test/backgroundTaskNotifications.test.tspackages/ui/test/zcodeSessionProjection.test.tspackages/services/test/zcodeLegacyTaskCompatTaskIndex.test.tsInterfaces:
Produces: focused contracts for structured cause selection, failed summary formatting, XML parsing, live event error, and snapshot terminal overlay.
[x] Make a background child reject with a wrapper Turn execution failed whose cause message is the provider rate-limit text; assert notification/registry/SubagentStopped use the cause message.
[x] Assert <error> XML entities decode exactly once.
[x] Assert both live projection functions emit status: "failed" and error: providerMessage.
[x] Assert completed launch ACK plus failed notification restores as a failed persisted tool with the same error.
[x] Run the four focused test files and confirm failures are caused by the missing behavior.
Files:
apps/zcode-cli/packages/core/src/subagent/runner.tsapps/zcode-cli/packages/core/src/subagent/completion-notification.tspackages/shared/src/background-task-notifications.tspackages/ui/src/lib/zcodeSessionProjection.tspackages/services/src/zcode-agent/zcodeTaskServiceAdapter.tsInterfaces:
selectExecutionErrorMessage(error) and existing notification/status helpers.Produces: one provider-message string propagated as summary suffix and tool error across live/restore paths.
[x] In finalizeBackgroundFailure, select the wrapper cause's original message without whitespace normalization or truncation for Error objects, and preserve String(error) for non-Error values.
[x] Use trim only to reject empty failed errors, but append the unmodified value; leave completed/stopped byte-for-byte unchanged.
[x] Parse <error> in the shared notification parser.
[x] Map failed live notifications to tool_call_update.error in UI and service projections.
[x] When a completed launch ACK has a matching failed notification, overlay failed/error in both snapshot mappers; preserve stopped/killed and native state.status === "error" behavior.
[x] Run focused tests until GREEN without changing their expected product behavior.
Files:
Interfaces:
Produces: replay artifacts and verification output.
[x] Re-run explicit-fixture WDIO and default replay for conversation-session-background-subagent-rate-limit.test.ts.
[x] Run pnpm --filter @zcode/desktop typecheck:e2e.
[x] Run the conversation coverage audit.
[x] Run pnpm typecheck, pnpm lint, and git diff --check.
Files:
Interfaces:
Produces: concrete import/reference inventory and an independent merge-readiness verdict.
[x] Use pnpm dep:refs --list-exports on the changed shared/core files, then unscoped pnpm dep:refs <file>:<export> for every changed exported symbol.
[x] Use rg for non-exported duplicate implementations and string-based <task-notification> consumers that static symbol tracing cannot detect.
[x] Dispatch independent read-only reviewers with the requirements, base SHA, full working-tree diff, and fresh verification evidence.
[x] Fix every Critical/Important issue, rerun affected tests, and repeat review if production code changed.
[x] Re-run the complete final verification set immediately before reporting completion.