Skip to content

Demote non-actionable AI agent SDK error reports#13931

Open
warp-dev-github-integration[bot] wants to merge 2 commits into
masterfrom
factory/app-4874-demote-agent-sdk-report-errors
Open

Demote non-actionable AI agent SDK error reports#13931
warp-dev-github-integration[bot] wants to merge 2 commits into
masterfrom
factory/app-4874-demote-agent-sdk-report-errors

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Description

Demote report_error! calls in the AI agent SDK driver that represent handled external failures, best-effort cleanup, invalid user/configuration input, or expected fallback paths. These conditions now remain visible as local log::error!/log::warn! breadcrumbs without creating Sentry issues; invariant violations and critical handoff failures remain structured reports.

Originating thread: https://warp-dev.slack.com/archives/C0BDQDW8V5E/p1784336780055059

Linked Issue

Linear: https://linear.app/warpdotdev/issue/APP-4874/demote-non-actionable-report-error-calls-in-ai-agent-sdk-driver-to

Testing

  • ./script/format passed.
  • cargo clippy passed with no warnings.
  • CARGO_BUILD_JOBS=1 cargo test -p warp --lib ai::agent_sdk::driver::tests -- --nocapture passed: 45 tests.
  • Full CARGO_BUILD_JOBS=1 NEXTEST_TEST_THREADS=1 ./script/presubmit completed formatting, clippy, clang-format, WGSL checks, and most tests, but environment-dependent integration tests failed (SSH/password-prompt, XDG/DBus, and missing branch metadata); no failures implicated these logging changes.
  • No new regression test was added because this is a logging-sink-only audit; the focused existing AgentDriver test module passes.

Agent Mode

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

Conversation: https://staging.warp.dev/conversation/e3b04a67-a444-4f36-bcbf-745cec9e9508
Run: https://oz.staging.warp.dev/runs/019f72c9-6232-7222-9129-ce27acc069cf
This PR was generated with Oz.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jul 18, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

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

@warp-dev-github-integration warp-dev-github-integration Bot left a comment

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.

Logging audit rationale: each inline comment documents why this demotion follows the logging-and-error-reporting skill.

.context("Failed to update agent task state to InProgress")
{
report_error!(e);
log::error!("Failed to update agent task state to InProgress: {e:#}");

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.

The logging skill says log::error! is appropriate for a genuine failure caused by an external system when there is no code defect to fix. Updating the task state is an external API operation; the driver continues after this handled failure, so it should not create a Sentry issue.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.


if tx.send(result).is_err() {
report_error!("Caller did not wait for agent driver to finish");
log::warn!("Caller did not wait for agent driver to finish");

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.

The skill assigns recoverable/handled conditions and fallbacks to log::warn!. A dropped receiver means the caller exited before consuming the result, while teardown still proceeds; this is expected lifecycle degradation rather than an engineering issue.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Ok(()) => true,
Err(err) => {
report_error!(err);
log::error!("Failed to save harness conversation (final): {err:#}");

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.

Per the skill, external failures that are real but not our code's fault belong at log::error!, not report_error!. Final conversation persistence can fail because of the external storage/network path and the harness already degrades to a non-resumable cleanup disposition, so this should remain breadcrumb-only.

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.

This path is restored to report_error! in rework commit d3b5e34: a final save failure selects DropResumptionState, so the resulting loss of resumability is actionable rather than a breadcrumb-only external failure.

.context("Failed to clean up harness runtime state")
{
report_error!(err);
log::warn!("Failed to clean up harness runtime state: {err:#}");

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.

The skill places best-effort cleanup and recoverable handled paths at log::warn!. Harness runtime-state cleanup is attempted after the run and failure does not block the completed result, so this is not Sentry-actionable.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

Comment thread app/src/ai/agent_sdk/driver.rs Outdated
for provider in providers {
if let Err(err) = provider.cleanup().await {
report_error!(anyhow!(err).context("Unable to clean up cloud provider"));
log::warn!("Unable to clean up cloud provider: {err:#}");

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.

The skill reserves report_error! for failures worth engineering attention and uses log::warn! for handled fallback/cleanup paths. Cloud-provider cleanup only removes temporary credentials after the run; a cleanup failure is an external best-effort teardown issue and does not affect the run result.

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.

This path is restored to report_error! in rework commit d3b5e34: AWS/GCP provider cleanup removes credential material, so failures need structured visibility even though teardown continues.

}
Err(e) => {
report_error!(e);
log::error!("Failed to create task: {e:#}");

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.

The skill says external-system failures belong at log::error! when the app can handle the failure without a code fix. Task creation is a server/API dependency and this path deliberately continues without a task ID, so it should not create a Sentry issue.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

Ok(id) => Some(id),
Err(e) => {
report_error!(e);
log::warn!("Failed to parse task ID: {e:#}");

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.

The skill calls expected handled input/resource failures log::warn!. A malformed task ID is invalid external/user-provided input and this path falls back to an unscoped run, so it is not an engineering issue for Sentry.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

"Invalid environment ID",
extra: { "environment_id" => %environment_id }
);
log::warn!("Invalid environment ID");

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.

The skill recommends plain log::* for expected validation misses and user-provided invalid values. An invalid environment ID is handled by listing valid environments and returning a user-facing not-found error, so log::warn! is the appropriate non-Sentry level.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

"Environment not found with ID",
extra: { "environment_id" => %environment_id }
);
log::warn!("Environment not found with ID");

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.

The skill says gracefully handled missing resources should not use report_error!; use log::warn! for the degraded/user-correctable path. An environment absent from the local collection is expected invalid configuration, and valid IDs are listed before returning the typed error.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

if let Err(err) = std::fs::write(&output_path, &output) {
report_error!(anyhow!(err)
.context(format!("Error writing GCP token to {output_path}")));
log::error!("Error writing GCP token to {output_path}: {err:#}");

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.

The skill says external filesystem failures that do not indicate a Warp bug belong at log::error!, while handled fallback paths should not page Sentry. The token is printed and the command terminates successfully even if optional caching fails, so this remains a local breadcrumb.

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.

Acknowledged. This accepted demotion remains unchanged in rework commit d3b5e34; no additional code change was requested for this path.

@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 demotes several report_error! calls in the AI agent SDK driver and third-party harness paths to breadcrumb-only log::* calls. Most changes are consistent with reducing non-actionable Sentry noise, and no approved spec context was available for this PR.

Concerns

  • Final harness conversation save failures can still complete the run successfully while dropping resumption state, so they should remain structured reports.
  • Cloud provider cleanup failures can leave temporary credential material on disk; demoting them to warning breadcrumbs hides a security-relevant cleanup failure.
  • Snapshot upload timeouts break the end-of-run handoff artifact path and should keep structured reporting with diagnostic context.

Security

  • Cloud provider cleanup errors cover AWS/GCP credential file cleanup, so suppressing their structured report can hide leaked credential artifacts.

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

Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Comment thread app/src/ai/agent_sdk/driver.rs Outdated

@warp-dev-github-integration warp-dev-github-integration Bot left a comment

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.

Overview

The demotions are generally consistent with the logging policy for recoverable external failures, and GitHub CI is green. Three demotions still hide failures that materially affect resumption, credential cleanup, or cloud handoff reliability.

Concerns

  • A final conversation-save failure causes the code to select DropResumptionState; this can silently make a completed run non-resumable, so it remains an actionable incident.
  • Cloud-provider cleanup owns AWS OIDC and GCP credential files; a failed cleanup can leave credential material on disk and requires structured reporting rather than a warning breadcrumb.
  • Snapshot upload is the end-of-run handoff artifact path; a timeout can make follow-up agents miss workspace context and should retain structured reporting with timeout/task context.

Verification

GitHub CI is green (21 successful checks). Local ./script/presubmit completed formatting and clippy but could not finish the build because the review environment exhausted disk space while linking WarpUI examples.

Verdict

Found: 0 critical, 3 important, 0 suggestions

Request changes

Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Comment thread app/src/ai/agent_sdk/driver.rs Outdated
Keep final harness persistence, cloud credential cleanup, and snapshot handoff timeout failures in structured error reporting so reliability and security incidents remain visible.

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

Copy link
Copy Markdown
Contributor Author

Rework cycle 1 addressed all three requested findings in commit d3b5e34: final harness-save failures again use structured report_error!, AWS/GCP credential cleanup failures retain typed cloud-provider reporting, and snapshot handoff upload timeouts retain report_error! with task ID and timeout metadata. ./script/format passed; the mandatory presubmit formatter/lint/build phases passed, but test linking stopped on the 30 GB environment filesystem reaching 0 bytes (error 28). The unchanged PR HEAD reproduces the same 17 baseline all-features clippy dead-code diagnostics outside this change.

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Validation update: the exact presubmit Warp clippy gate cargo clippy -p warp --all-targets --tests -- -D warnings passed directly in 5m10s with no warnings. The earlier all-features diagnostic remains a baseline-only comparison; presubmit itself still stopped later at test linking because the filesystem filled.

@warp-dev-github-integration warp-dev-github-integration Bot left a comment

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.

Overview

Re-reviewed PR #13931 at d3b5e34 after rework cycle 1. The demotions are limited to handled external failures, expected fallbacks, and user/configuration errors, while the three actionable paths identified previously retain structured reporting: final harness conversation-save failures, AWS/GCP credential cleanup failures, and snapshot handoff upload timeouts.

Verification

All required GitHub checks are successful (20 successful, 6 skipped). The PR records passing formatting, clippy, and focused AgentDriver tests; the local full presubmit reached the test build but was interrupted by the review environment, so CI is the authoritative full-gate result.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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