Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Feb 6, 2026

Summary

When tool outputs are stripped for sharing (output-redacted), failure information was lost — every redacted tool showed the same muted "redacted" status. This adds an optional failed boolean to the redacted schema so failed tools still render as failed (red X) even when their output content is redacted.

Background

Follow-up to the output-redacted feature (PR #2202). stripToolPartOutput drops the entire output object (which contains { success: false } or { error: "..." }), and sets state: "output-redacted". Downstream, the aggregator mapped that to a single "redacted" display status — no way to distinguish failed-then-redacted from succeeded-then-redacted.

Implementation

Adds an optional failed?: boolean field to the redacted state, populated at strip time by inspecting the output before dropping it:

File Change
src/common/orpc/schemas/message.ts failed: z.boolean().optional() on NestedToolCallSchema + DynamicToolPartRedactedSchema
src/common/utils/messages/transcriptShare.ts isFailedOutput() helper; wired into stripNestedToolCallOutput and stripToolPartOutput
src/browser/utils/messages/StreamingMessageAggregator.ts "output-redacted" branch checks part.failed → picks "failed" vs "redacted"
src/browser/components/tools/shared/toolUtils.tsx getNestedToolStatus accepts optional failed param
src/browser/components/tools/shared/NestedToolsContainer.tsx Passes call.failed through
src/browser/components/tools/shared/codeExecutionTypes.ts failed?: boolean on NestedToolCall interface
src/common/types/message.ts failed?: boolean on inline nested call type
src/common/utils/messages/transcriptShare.test.ts 4 new test cases for failed/success × tool/nested-call

No rendering changes needed — GenericToolCall, BashToolCall, ToolPrimitives, and getStatusDisplay already handle the "failed" status with the correct red X icon.

Risks

Low. The failed field is optional, so existing persisted data without it parses fine (defaults to undefined → treated as not-failed). No migration needed.


Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: high • Cost: $2.93

…ranscripts

Add `failed?: boolean` to redacted schemas and wire it through stripping,
aggregation, and nested tool status resolution so failed tools show as
failed (red X) even when output is redacted.

Changes:
- NestedToolCallSchema and DynamicToolPartRedactedSchema: add failed field
- MuxToolPart inline nested call type and codeExecutionTypes.ts: add failed field
- transcriptShare.ts: add isFailedOutput helper, wire into stripNestedToolCallOutput
  and stripToolPartOutput to preserve failure status during redaction
- StreamingMessageAggregator: check part.failed on output-redacted parts
- toolUtils.tsx getNestedToolStatus: accept optional failed param
- NestedToolsContainer.tsx: pass call.failed through
- Tests: 4 new cases covering failed/successful tool parts and nested calls
@ibetitsmike ibetitsmike merged commit 60da1df into main Feb 10, 2026
23 checks passed
@ibetitsmike ibetitsmike deleted the mike/preserve-failure-status-redacted branch February 10, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant