Skip to content

Add (and correctly trigger) failure state for cloud mode setup#10761

Open
harryalbert wants to merge 2 commits into
masterfrom
harry/app-4432-improve-environment-setup-failure-ui-for-cloud-mode-setup
Open

Add (and correctly trigger) failure state for cloud mode setup#10761
harryalbert wants to merge 2 commits into
masterfrom
harry/app-4432-improve-environment-setup-failure-ui-for-cloud-mode-setup

Conversation

@harryalbert
Copy link
Copy Markdown
Contributor

@harryalbert harryalbert commented May 12, 2026

Description

If any command in environment setup failed, the new setup UI would just get stuck in the "setting up environment" state. Instead, we should indicate this error state by blocking the input and expanding the error block.

Testing

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

image.png

Agent Mode

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

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

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

@harryalbert harryalbert marked this pull request as ready for review May 12, 2026 20:39
@harryalbert harryalbert requested a review from zachbai May 12, 2026 20:39
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 12, 2026

@harryalbert

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

@harryalbert harryalbert changed the title write product and tech specs Add (and trigger) failure state for cloud mode setup May 12, 2026
@harryalbert harryalbert changed the title Add (and trigger) failure state for cloud mode setup Add (and correctly trigger) failure state for cloud mode setup May 12, 2026
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 adds Cloud Mode V2 setup-failure handling, including a failed setup-command state, an error footer, and product/tech specs for the behavior.

Concerns

  • The setup-command failure path toggles command output visibility, so a command the user already expanded can be hidden exactly when it fails.
  • The startup-command gate is cleared before the async server error is resolved, which can expose the normal input while the failure footer is still pending.
  • The deferred task-data lookup has no fallback path when the fetch fails, so the generic error footer is not guaranteed within a bounded time.

Verdict

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

me.status = Status::Completed { is_success };
if !is_success {
me.is_expanded = true;
ctx.emit(CloudModeSetupCommandBlockEvent::ToggleBlockVisibility(
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] This always toggles the terminal block when a command fails. If the user already expanded the command while it was running, failure hides the output instead of leaving it visible; make auto-expansion idempotent by only toggling hidden blocks or by calling an explicit unhide path.

{
model
.block_list_mut()
.finish_oz_environment_startup_commands_at_block(
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] This clears is_executing_oz_environment_startup_commands before setup_failure_error is set. When task data is not cached, is_cloud_agent_pre_first_exchange becomes false and the normal input can render until the fetch succeeds, so keep a failure-pending state or defer clearing this gate until the error footer is ready.

ctx.emit(AmbientAgentViewModelEvent::EnvironmentSetupFailed);
} else {
// Task data not cached yet — subscribe for when it arrives.
ctx.subscribe_to_model(
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] get_or_async_fetch_task_data only emits TasksUpdated after a successful fetch; fetch failures update internal cooldown state without notifying this subscription. In that case setup_failure_error stays None and the generic fallback never appears, so add an error/timeout path that sets the fallback message.

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