Skip to content

Set cloud agent task context before setup#11533

Open
bnavetta wants to merge 1 commit into
masterfrom
ben/cloud-agent-error-context
Open

Set cloud agent task context before setup#11533
bnavetta wants to merge 1 commit into
masterfrom
ben/cloud-agent-error-context

Conversation

@bnavetta
Copy link
Copy Markdown
Contributor

@bnavetta bnavetta commented May 22, 2026

Summary

  • Set ServerApi's ambient agent task ID immediately when agent run --task-id starts, before Warp Drive sync, metadata refresh, secrets/attachment fetches, cloud provider setup, or driver error reporting can fail.
  • Reuse the same helper when a local CLI run creates a task and when existing task setup parses the task ID.
  • Keep GraphQL request handling unchanged; once ServerApi has the task ID, existing header injection adds the cloud agent context automatically.

This should fix a regression where early setup failures couldn't be reported to the server, since they didn't include cloud agent request metadata.

Validation

  • cargo check --manifest-path /workspace/warp/Cargo.toml -p warp --lib passed with existing warnings.
  • rustfmt --edition 2021 --config-path /workspace/warp/.rustfmt.toml --check /workspace/warp/app/src/ai/agent_sdk/mod.rs passed.
  • git -C /workspace/warp --no-pager diff --check passed.
  • cargo nextest run --manifest-path /workspace/warp/Cargo.toml -p warp -E 'test(ambient_agent_headers_for_task_overrides_existing_cloud_agent_header)' was attempted but the test build was killed with SIGKILL; retrying with CARGO_BUILD_JOBS=1 stalled near the end of compiling warp(test) and was interrupted.

Conversation: https://staging.warp.dev/conversation/231ac3b7-4202-44a7-9e0d-68370eebdde0
Run: https://oz.staging.warp.dev/runs/019e4f84-9b90-78ff-992c-c292c42dc194
This PR was generated with Oz.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 22, 2026
@bnavetta bnavetta marked this pull request as ready for review May 22, 2026 12:18
@bnavetta bnavetta requested a review from abhishekp106 May 22, 2026 12:18
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 22, 2026

@bnavetta

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 moves ambient cloud-agent task context setup earlier in AgentDriverRunner::setup_and_run_driver and reuses a helper so early setup calls and driver error reporting can include the task ID header.

Concerns

  • No blocking correctness, security, or spec-alignment concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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

Powered by Oz

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