-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Demote non-actionable AI agent SDK error reports #13931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -878,7 +878,7 @@ impl AgentDriver { | |
| .await | ||
| .context("Failed to update agent task state to InProgress") | ||
| { | ||
| report_error!(e); | ||
| log::error!("Failed to update agent task state to InProgress: {e:#}"); | ||
| } | ||
| } | ||
| // Primary: WARP_SANDBOX_DEADLINE client-side timer. | ||
|
|
@@ -1032,7 +1032,7 @@ impl AgentDriver { | |
| Self::run_snapshot_upload(&foreground).await; | ||
|
|
||
| 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"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill assigns recoverable/handled conditions and fallbacks to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
|
|
||
| Self::cleanup(foreground).await; | ||
|
|
@@ -3010,7 +3010,7 @@ impl AgentDriver { | |
| .await | ||
| .context("Failed to clean up harness runtime state") | ||
| { | ||
| report_error!(err); | ||
| log::warn!("Failed to clean up harness runtime state: {err:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill places best-effort cleanup and recoverable handled paths at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
|
|
||
| // A runtime failure detected mid-run takes precedence over the | ||
|
|
@@ -3940,9 +3940,7 @@ pub(super) async fn report_driver_error( | |
| .update_agent_task(task_id, Some(state), None, None, Some(status_update)) | ||
| .await | ||
| { | ||
| report_error!( | ||
| anyhow!(e).context(format!("Failed to report driver error for task {task_id}")) | ||
| ); | ||
| log::error!("Failed to report driver error for task {task_id}: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,6 @@ use parent_bridge::{MessageBridge, MessageBridgeCleanupDisposition}; | |
| use shell_words::quote as shell_quote; | ||
| #[cfg(test)] | ||
| use wake_driver::{ClaudeWakeRemoteContext, CLAUDE_WAKE_PROMPT_FILE_NAME}; | ||
| use warp_errors::report_error; | ||
|
|
||
| #[cfg(test)] | ||
| use super::super::OZ_MESSAGE_LISTENER_STATE_ROOT_ENV; | ||
|
|
@@ -461,7 +460,7 @@ impl HarnessRunner for ClaudeHarnessRunner { | |
| .create_external_conversation(CLAUDE_CODE_FORMAT) | ||
| .await | ||
| .map_err(|e| { | ||
| report_error!(&e); | ||
| log::error!("Failed to create external conversation: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill distinguishes external failures from actionable bugs: use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| AgentDriverError::ConfigBuildFailed(e) | ||
| }) | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ use tempfile::NamedTempFile; | |
| use uuid::Uuid; | ||
| use warp_cli::agent::Harness; | ||
| use warp_core::features::FeatureFlag; | ||
| use warp_errors::report_error; | ||
| use warp_managed_secrets::ManagedSecretValue; | ||
| use warpui::{ModelHandle, ModelSpawner, SingletonEntity}; | ||
|
|
||
|
|
@@ -326,7 +325,7 @@ impl HarnessRunner for CodexHarnessRunner { | |
| .create_external_conversation(CODEX_CLI_FORMAT) | ||
| .await | ||
| .map_err(|e| { | ||
| report_error!(&e); | ||
| log::error!("Failed to create external conversation: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says external-system failures that prevent an operation but do not indicate a Warp bug belong at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| AgentDriverError::ConfigBuildFailed(e) | ||
| }) | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ use serde::{Deserialize, Serialize}; | |
| use serde_json::{Map, Value}; | ||
| use tempfile::NamedTempFile; | ||
| use warp_cli::agent::Harness; | ||
| use warp_errors::report_error; | ||
| use warp_managed_secrets::ManagedSecretValue; | ||
| use warpui::{ModelHandle, ModelSpawner}; | ||
|
|
||
|
|
@@ -167,7 +166,7 @@ impl HarnessRunner for GeminiHarnessRunner { | |
| .create_external_conversation(GEMINI_CLI_FORMAT) | ||
| .await | ||
| .map_err(|e| { | ||
| report_error!(&e); | ||
| log::error!("Failed to create external conversation: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logging skill reserves
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| AgentDriverError::ConfigBuildFailed(e) | ||
| }) | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,10 +145,7 @@ pub(super) async fn run_declarations_script( | |
| }; | ||
| let script_path = PathBuf::from(script_path); | ||
| if !script_path.exists() { | ||
| report_error!( | ||
| "Snapshot declarations script not found; skipping", | ||
| extra: { "script_path" => %script_path.display(), "task_id" => %task_id } | ||
| ); | ||
| log::warn!("Snapshot declarations script not found; skipping"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says expected or handled fallback paths should use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return; | ||
| } | ||
|
|
||
|
|
@@ -173,36 +170,19 @@ pub(super) async fn run_declarations_script( | |
| let output = match command.output().with_timeout(script_timeout).await { | ||
| Ok(Ok(output)) => output, | ||
| Ok(Err(e)) => { | ||
| report_error!( | ||
| anyhow::Error::new(e).context("Failed to spawn snapshot declarations script"), | ||
| extra: { "script_path" => %script_path.display(), "task_id" => %task_id } | ||
| ); | ||
| log::error!("Failed to spawn snapshot declarations script: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill uses
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return; | ||
| } | ||
| Err(_) => { | ||
| report_error!( | ||
| "Snapshot declarations script timed out", | ||
| extra: { | ||
| "script_path" => %script_path.display(), | ||
| "timeout" => ?script_timeout, | ||
| "task_id" => %task_id | ||
| } | ||
| ); | ||
| log::warn!("Snapshot declarations script timed out"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill places recoverable timeouts and fallback behavior at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return; | ||
| } | ||
| }; | ||
|
|
||
| if !output.status.success() { | ||
| let stderr = String::from_utf8_lossy(&output.stderr); | ||
| log::error!("Snapshot declarations script stderr: {stderr}"); | ||
| report_error!( | ||
| "Snapshot declarations script exited with non-zero status", | ||
| extra: { | ||
| "script_path" => %script_path.display(), | ||
| "status" => %output.status, | ||
| "task_id" => %task_id | ||
| } | ||
| ); | ||
| log::error!("Snapshot declarations script exited with non-zero status"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,11 @@ | ||
| use std::process; | ||
|
|
||
| use anyhow::{anyhow, Result}; | ||
| use anyhow::Result; | ||
| use serde_json::json; | ||
| use warp_cli::agent::OutputFormat; | ||
| use warp_cli::federate::{FederateCommand, IssueGcpTokenArgs, IssueTokenArgs}; | ||
| use warp_cli::GlobalOptions; | ||
| use warp_core::features::FeatureFlag; | ||
| use warp_errors::report_error; | ||
| use warp_managed_secrets::ManagedSecretManager; | ||
| use warpui::platform::TerminationMode; | ||
| use warpui::{AppContext, SingletonEntity as _}; | ||
|
|
@@ -103,11 +102,10 @@ fn issue_gcp_token(ctx: &mut AppContext, args: IssueGcpTokenArgs) -> Result<()> | |
| let output = | ||
| serde_json::to_string(&token).expect("gcp token output should serialize"); | ||
|
|
||
| // If we can't cache the token, report an error but don't fail the command. | ||
| // If we can't cache the token, log an error but don't fail the command. | ||
| if let Some(output_path) = output_file { | ||
| 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:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,6 @@ use warp_cli::share::ShareRequest; | |
| use warp_cli::task::{MessageCommand, TaskCommand}; | ||
| use warp_cli::{CliCommand, GlobalOptions, OZ_HARNESS_ENV}; | ||
| use warp_core::features::FeatureFlag; | ||
| use warp_errors::report_error; | ||
| use warp_graphql::object_permissions::OwnerType; | ||
| use warp_isolation_platform::IsolationPlatformError; | ||
| #[cfg(not(target_family = "wasm"))] | ||
|
|
@@ -1148,7 +1147,7 @@ impl AgentDriverRunner { | |
| Some(id) | ||
| } | ||
| Err(e) => { | ||
| report_error!(e); | ||
| log::error!("Failed to create task: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says external-system failures belong at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| // Continue without a task_id rather than failing entirely | ||
| None | ||
| } | ||
|
|
@@ -1193,7 +1192,7 @@ impl AgentDriverRunner { | |
| let parsed_task_id = match task_id_str.parse().context("Failed to parse task ID") { | ||
| Ok(id) => Some(id), | ||
| Err(e) => { | ||
| report_error!(e); | ||
| log::warn!("Failed to parse task ID: {e:#}"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill calls expected handled input/resource failures
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| None | ||
| } | ||
| }; | ||
|
|
@@ -1435,21 +1434,15 @@ impl AgentDriverRunner { | |
| let environment = foreground | ||
| .spawn(move |_, ctx| -> Result<_, AgentDriverError> { | ||
| let server_id = ServerId::try_from(environment_id.as_str()).map_err(|_| { | ||
| report_error!( | ||
| "Invalid environment ID", | ||
| extra: { "environment_id" => %environment_id } | ||
| ); | ||
| log::warn!("Invalid environment ID"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill recommends plain
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| AgentDriver::log_valid_environments(ctx); | ||
| AgentDriverError::EnvironmentNotFound(environment_id.clone()) | ||
| })?; | ||
| let sync_id = SyncId::ServerId(server_id); | ||
|
|
||
| CloudAmbientAgentEnvironment::get_by_id(&sync_id, ctx) | ||
| .ok_or_else(|| { | ||
| report_error!( | ||
| "Environment not found with ID", | ||
| extra: { "environment_id" => %environment_id } | ||
| ); | ||
| log::warn!("Environment not found with ID"); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The skill says gracefully handled missing resources should not use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| AgentDriver::log_valid_environments(ctx); | ||
| AgentDriverError::EnvironmentNotFound(environment_id) | ||
| }) | ||
|
|
||
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.