Skip to content

Add MCP startup failure details to Oz errors#12101

Open
ianhodge wants to merge 1 commit into
masterfrom
oz-agent/mcp-startup-error-details
Open

Add MCP startup failure details to Oz errors#12101
ianhodge wants to merge 1 commit into
masterfrom
oz-agent/mcp-startup-error-details

Conversation

@ianhodge
Copy link
Copy Markdown
Member

@ianhodge ianhodge commented Jun 2, 2026

Description

Adds safe, actionable MCP startup details to Oz/cloud-agent task errors. When requested or profile MCP servers fail to start, the agent driver now accumulates failed/timed-out server names and sanitized reason categories instead of reporting only a generic MCP startup failure.

The reported task error intentionally does not include MCP logs or raw process output, but it does include guidance to check the named server configuration, command/URL, required env vars/secrets, and whether the command exists in the cloud agent environment.

Linked Issue

Slack request: MCP server startup failures in cloud agent runs should include more actionable info without leaking sensitive logs.

  • 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

  • cargo test --manifest-path /workspace/warp/Cargo.toml -p warp mcp_startup_failed_includes_safe_server_details

  • cargo test --manifest-path /workspace/warp/Cargo.toml -p warp ai::agent_sdk::driver::error_classification::tests

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

Screenshots / Videos

Not applicable; this is cloud-agent error reporting behavior without a local UI change.

Agent Mode

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

CHANGELOG-OZ: MCP startup failures in cloud agent runs now show failed server names and safe, actionable reasons without including sensitive MCP logs.

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

Conversation: https://staging.warp.dev/conversation/93f382d7-d946-4c83-9db9-83ca659f2933
Run: https://oz.staging.warp.dev/runs/019e8a3b-ba1f-7802-936f-4d2ba28b81e3
This PR was generated with Oz.

@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@ianhodge ianhodge force-pushed the oz-agent/mcp-startup-error-details branch from 90a5804 to af0d2ef Compare June 2, 2026 22:12
@ianhodge ianhodge marked this pull request as ready for review June 2, 2026 22:22
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Jun 2, 2026

@ianhodge

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 adds structured MCP startup failure details to Oz/cloud-agent task errors, including failed server names and sanitized reason categories while avoiding raw MCP logs. The implementation updates startup wait state tracking, error classification, and targeted failure-message storage in the templatable MCP manager.

Concerns

  • One non-blocking suggestion: the broad not found sanitizer match can misclassify the new installation-missing reason as a missing command.
  • Security pass: no security findings.
  • Spec alignment: no approved or repository spec context was available for this PR.

Verdict

Found: 0 critical, 0 important, 1 suggestions

Approve with nits

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

Powered by Oz

"PATH was unavailable when Warp tried to launch the MCP command".to_string()
}
_ if lower.contains("no such file")
|| lower.contains("not found")
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.

💡 [SUGGESTION] This generic not found match also rewrites the new MCP server installation could not be found reason as a missing command, which sends users toward PATH/command debugging instead of the missing installation; handle that reason first or narrow this match to command/path failures.

Co-Authored-By: Oz <oz-agent@warp.dev>
@ianhodge ianhodge force-pushed the oz-agent/mcp-startup-error-details branch from af0d2ef to 02f891d Compare June 2, 2026 22:37
@ianhodge
Copy link
Copy Markdown
Member Author

ianhodge commented Jun 3, 2026

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Jun 3, 2026

@ianhodge

I'm re-reviewing this pull request in response to a review 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 adds per-server MCP startup failure details to Oz agent errors and keeps raw MCP logs out of user-facing task messages.

Concerns

  • The newly stored PATH failure reason does not match the sanitizer branch, so that failure mode still falls back to the generic startup message instead of the intended actionable detail.

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

Comment on lines +471 to +473
_ if lower.contains("path required")
|| lower.contains("path not available")
|| lower.contains("unknown path") =>
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] The raw reason stored for this path is PATH was unavailable when trying to launch the MCP command, which does not match any of these substrings and therefore falls through to the generic fallback instead of surfacing the actionable PATH detail.

Suggested change
_ if lower.contains("path required")
|| lower.contains("path not available")
|| lower.contains("unknown path") =>
_ if lower.contains("path required")
|| lower.contains("path not available")
|| lower.contains("path was unavailable")
|| lower.contains("unknown path") =>

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