Skip to content

Render Agent request failures in the TUI#14044

Merged
moirahuang merged 1 commit into
masterfrom
moira/error-state
Jul 21, 2026
Merged

Render Agent request failures in the TUI#14044
moirahuang merged 1 commit into
masterfrom
moira/error-state

Conversation

@moirahuang

@moirahuang moirahuang commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Surface Agent Mode request failures in the headless TUI using presentation logic shared with the GUI. Out-of-credits failures match the supplied TUI design with exact copy, semantic styling, and clickable plan/BYOK actions inside the transcript while keeping the persistent footer metadata-only.

Implementation plan: https://staging.warp.dev/drive/notebook/Q4amHEjF0oDbPPvwB5t9Y2

Shared GUI/TUI surfaces

flowchart LR
    Error["RenderableAIError"] --> Presentation["Shared presentation layer<br/>failed_output_presentation<br/>FailedOutputPresentation"]
    Policy["Shared policy and state<br/>UserWorkspaces<br/>AIRequestUsageModel"] --> Presentation
    Usage["Shared usage-notice predicate<br/>should_show_failed_output_usage_notice"] --> GUI
    Usage --> TUI
    Presentation --> GUI["GUI renderer<br/>render_failed_output"]
    Presentation --> TUI["TUI renderer<br/>TuiAIBlock::sections"]
    GUI --> GUIControls["GUI-specific controls<br/>upgrade and settings actions"]
    TUI --> TUIRows["TUI-specific composition<br/>cell rows and TuiHoverable links"]
Loading

Linked Issue

N/A

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

Screenshot 2026-07-20 at 3.57.48 PM.png

  • cargo nextest run -p warp_tui (429 passed)
  • cargo check -p warp -p warp_tui --lib
  • cargo clippy -p warp -p warp_tui --all-targets -- -D warnings
  • ./script/format
  • git diff --check
  • Row-exact cell-buffer tests cover Figma copy, spacing, semantic styles, underlines, both link targets, conditional BYOK rendering, partial output ordering, and footer absence.
  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-IMPROVEMENT: Show actionable Agent Mode request failures in the headless TUI.

Co-Authored-By: Oz oz-agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Jul 20, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@moirahuang moirahuang changed the title feat(tui): render agent request failures Render Agent request failures in the TUI Jul 20, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR factors failed Agent Mode request presentation into a shared helper and adds TUI rendering for failed agent requests, including quota, invalid API key, context-window, AWS Bedrock credential, and usage-notice states. No approved spec context was provided, and I did not find security issues in the changed code paths.

Concerns

  • This is user-facing TUI behavior, but the PR description does not include the required TUI visual evidence. Please attach a terminal transcript, render_to_lines / TuiBuffer::to_lines snapshot output, or a ./script/run-tui capture demonstrating the failure states end to end.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Co-Authored-By: Oz <oz-agent@warp.dev>

@harryalbert harryalbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

(message.clone(), body_style),
])
.finish(),
FailedOutputPresentation::InvalidApiKey { title, detail } => TuiText::from_spans([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing the TUI ui framework come together such that we can add this without new elements is very satisfying

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure, this PR stands on the shoulder of giants

@moirahuang
moirahuang merged commit 074e595 into master Jul 21, 2026
38 checks passed
@moirahuang
moirahuang deleted the moira/error-state branch July 21, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants