Skip to content

[APP-2267] Show credit footer for cancelled long-running commands#9695

Open
vkodithala wants to merge 4 commits intomasterfrom
varoon/fix-credit-footer
Open

[APP-2267] Show credit footer for cancelled long-running commands#9695
vkodithala wants to merge 4 commits intomasterfrom
varoon/fix-credit-footer

Conversation

@vkodithala
Copy link
Copy Markdown
Contributor

@vkodithala vkodithala commented May 1, 2026

Description

Fixes APP-2267.

When a user cancels or takes over an agent-initiated long-running command after the CLI subagent starts, Warp creates an internal CLI-subagent bootstrap exchange. That exchange is removed from the visible blocklist UI, but it still exists in the conversation and was incorrectly becoming the latest footer-owning exchange. As a result, the visible requested-command output did not render the stopped-task footer or response toolbelt after the command completed.

There was an adjacent issue where we removed the bottom padding for requested command views (LRCs and MCP tool calls). This was added back on the next exchange, but kept removed for cancelled conversations with LRCs as their last visible exchange; see demo below for an example. We fix this here, too.

This PR:

  • marks removed CLI-subagent bootstrap exchanges as hidden and skips hidden exchanges during blocklist rendering/restoration
  • introduces latest-visible-exchange ownership for response footer/suggestions and imported-comment controls
  • suppresses response controls only while the last output message is an expanded requested command detail, instead of using broad active-LRC state
  • keeps requested-command spacing tied to physical adjacency with the expanded command block

No server API dependencies.

Testing

Manually verified. Demo here.

  • cargo fmt --all --manifest-path /Users/vkodithala/Desktop/warp/warp.varoon-fix-credit-footer/Cargo.toml
  • cargo check --manifest-path /Users/vkodithala/Desktop/warp/warp.varoon-fix-credit-footer/Cargo.toml -p warp --lib
  • git --no-pager -C /Users/vkodithala/Desktop/warp/warp.varoon-fix-credit-footer diff --check

No automated tests were added; the core change is UI ownership/rendering behavior around hidden exchanges and requested-command expansion state, and the targeted manual repro covers the regression.

Server API dependencies

No server dependencies.

Agent Mode

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

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Fixed response controls and stopped-task footer visibility after cancelling agent-initiated long-running commands and MCP tool calls.

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

@cla-bot cla-bot Bot added the cla-signed label May 1, 2026
Copy link
Copy Markdown
Contributor Author

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

@vkodithala vkodithala changed the title feat: Initial implementation A{{ May 1, 2026
@vkodithala vkodithala changed the title A{{ [APP-2 May 1, 2026
@vkodithala vkodithala changed the title [APP-2 [APP-2267] May 1, 2026
@vkodithala vkodithala changed the title [APP-2267] [APP-2267] Show credit footer, fix padding for cancelled long-running commands May 1, 2026
@vkodithala vkodithala force-pushed the varoon/fix-credit-footer branch from 0f63fe9 to e548cb4 Compare May 1, 2026 18:17
@vkodithala vkodithala changed the title [APP-2267] Show credit footer, fix padding for cancelled long-running commands [APP-2267] Show credit footer for cancelled long-running commands May 1, 2026
Comment on lines +215 to +232
let has_expanded_last_requested_command = status.output_to_render().is_some_and(|output| {
let output = output.get();
output.messages.last().is_some_and(|message| {
let AIAgentOutputMessageType::Action(action) = &message.message else {
return false;
};

matches!(
&action.action,
AIAgentActionType::RequestCommandOutput { .. }
) && props
.requested_commands
.get(&action.id)
.is_some_and(|requested_command| {
requested_command.view.as_ref(app).is_header_expanded()
})
})
});
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.

context: We track (and use) this to fix an issue where the credit footer rendered while a cancelled LRC was expanded/in user control.

@vkodithala vkodithala force-pushed the varoon/fix-credit-footer branch from a65fdbf to b9ca67f Compare May 1, 2026 18:57
@vkodithala vkodithala requested a review from MaggieShan May 1, 2026 18:57
@vkodithala vkodithala marked this pull request as ready for review May 1, 2026 18:58
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@vkodithala

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

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

Choose a reason for hiding this comment

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

Overview

This PR hides CLI-subagent bootstrap exchanges from blocklist ownership/rendering and updates response footer/suggestion visibility around requested command detail views.

Concerns

  • Expanded MCP tool-call details are not considered by the new last-expanded-requested-action check, so completed MCP tool calls can still show response controls under the expanded tool details.
  • Requested-command margin removal still consults hidden root-task exchanges; hidden bootstrap exchanges can therefore keep affecting spacing even though they are no longer rendered.

Verdict

Found: 0 critical, 2 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

Comment on lines +222 to +230
matches!(
&action.action,
AIAgentActionType::RequestCommandOutput { .. }
) && props
.requested_commands
.get(&action.id)
.is_some_and(|requested_command| {
requested_command.view.as_ref(app).is_header_expanded()
})
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.

⚠️ [IMPORTANT] Include expanded MCP tool views here; otherwise a completed expanded CallMCPTool at the end of the output will still render response controls under the tool details.

Suggested change
matches!(
&action.action,
AIAgentActionType::RequestCommandOutput { .. }
) && props
.requested_commands
.get(&action.id)
.is_some_and(|requested_command| {
requested_command.view.as_ref(app).is_header_expanded()
})
match &action.action {
AIAgentActionType::RequestCommandOutput { .. } => props
.requested_commands
.get(&action.id)
.is_some_and(|requested_command| {
requested_command.view.as_ref(app).is_header_expanded()
}),
AIAgentActionType::CallMCPTool { .. } => props
.requested_mcp_tools
.get(&action.id)
.is_some_and(|requested_tool| {
requested_tool.view.as_ref(app).is_header_expanded()
}),
_ => false,
}

Comment on lines +1502 to +1508
&& conversation
.root_task_exchanges()
.skip_while(|exchange| {
exchange.id != self.client_ids.client_exchange_id
})
.nth(1)
.map_or(false, |exchange| {
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.

⚠️ [IMPORTANT] Skip hidden exchanges when checking the next exchange for spacing; otherwise a hidden bootstrap exchange can still remove this block's bottom margin even though no visible block is physically adjacent.

Suggested change
&& conversation
.root_task_exchanges()
.skip_while(|exchange| {
exchange.id != self.client_ids.client_exchange_id
})
.nth(1)
.map_or(false, |exchange| {
&& conversation
.root_task_exchanges()
.skip_while(|exchange| {
exchange.id != self.client_ids.client_exchange_id
})
.skip(1)
.find(|exchange| !conversation.is_exchange_hidden(exchange.id))
.map_or(false, |exchange| {

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.

1 participant