Skip to content

Stop reporting unknown AmbientAgentSource to Sentry, add missing sources (APP-5521) - #15295

Merged
acarl005 merged 3 commits into
masterfrom
warpstaging/app-5521-stop-reporting-unknown-ambientagentsource-values-to-sentry
Aug 19, 2026
Merged

Stop reporting unknown AmbientAgentSource to Sentry, add missing sources (APP-5521)#15295
acarl005 merged 3 commits into
masterfrom
warpstaging/app-5521-stop-reporting-unknown-ambientagentsource-values-to-sentry

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes APP-5521: Error: Unknown AmbientAgentSource: ORCHESTRATION and siblings logged 58,472+ Sentry events across 1,106+ users (Sentry WARP-CLIENT-BETA-STABLE-87FZ). The client's hand-written AgentSource enum in app/src/ai/ambient_agents/task.rs reported every server-side source value it didn't recognize to Sentry, but a server enum addition is expected drift for older shipped clients — there's nothing an engineer can act on. ORCHESTRATION itself was already fixed in warp#15164 (APP-5412); this PR is the explicit follow-up that PR left open.

Requested by @acarl005 in Slack: "if this can happen, adding new types, maybe we shouldn't be reporting this error then".

Changes

  • deserialize_ambient_agent_source: replaced report_error! with log::warn! for an unrecognized source string. The soft fallback to source: None is unchanged.
  • Added the 5 server sources the client was missing, verified against warp-server's TaskSourceType (logic/ai/ambient_agents/sources/types.go) and the OpenAPI RunSourceType: JIRA, RUN_SCORER, GITLAB_WEBHOOK, AUTOFIX, BENCHMARK_TRIAL.
  • Per-variant decisions (display names taken from warp-server's client/packages/shared/src/utils/run-source.ts where available):
    • Jira: mirrors Linear — a human triggers the task from a ticket comment, so is_user_initiated = true and blocks_cloud_followups = false.
    • GitLabWebhook: mirrors GitHubWebhook exactly (blocks_cloud_followups = true, is_user_initiated = false) — same automated-webhook semantics.
    • RunScorer, BenchmarkTrial: automated benchmark-harness runs with no interactive user to continue a conversation with, so both are is_user_initiated = false and blocks_cloud_followups = true. BENCHMARK_TRIAL has no web label (it isn't in the public RunSourceType used by run-source.ts), so the display name "Benchmark" was chosen to match RunScorer's "Scorer" — open question with the requester on whether/how this should surface on desktop at all.
    • Autofix: the server's TaskSourceType.PublicName() maps the internal AUTOFIX value to the public wire value SELF_IMPROVEMENT before it ever reaches the client (router/handlers/public_api/agent_webhooks.go: item.Source = run.TaskSource.Type().PublicName()), so the client actually observes "SELF_IMPROVEMENT" on the wire. Following the existing AgentWebhook/"API" pattern in this same file: the deserializer accepts both "AUTOFIX" and "SELF_IMPROVEMENT", as_str() returns "SELF_IMPROVEMENT" (what the public API expects back as a filter value), and display_name() uses "Self-improvement" (the shared web label for both spellings).

Linked Issue

  • Linked issue: APP-5521 (labeled factory:wilson).

Testing

  • cargo test -p warp --lib ai::ambient_agents::task::tests — 15 passed, 0 failed (pre-existing coverage; includes ambient_agent_task_deserializes_orchestration_source and ambient_agent_task_deserializes_github_webhook_source as the closest existing precedent for the new variants and the log-vs-report path).

  • cargo check -p warp --lib — clean build.

  • ./script/format — no changes.

  • cargo clippy -p warp --lib --all-features --tests -- -D warnings — no findings in the touched files. The command fails on master too, in the pre-existing, unrelated warp_completer crate (crates/warp_completer/src/completer/engine/argument/v2.rs); verified by stashing this change and re-running clippy, which reproduces the identical failure.

  • No UI/computer-use verification: this is an internal deserialization/enum-mapping fix with no rendered surface change beyond a new label string for sources most users won't yet see.

  • I have manually tested my changes locally with ./script/run (not applicable — internal deserialization fix; verified via unit tests and build/lint checks instead, matching the approach in warp#15164)

Agent Mode

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

…ces (APP-5521)

Downgrade the unknown-source deserializer fallback from report_error! to
missing: JIRA, RUN_SCORER, GITLAB_WEBHOOK, AUTOFIX, BENCHMARK_TRIAL.
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation

Address review: the unknown-source fallback now warns only on the first
occurrence of each distinct unrecognized value per process, instead of on
every deserialize, so an old client meeting a newer server doesn't trade
one flood (Sentry events) for another (log lines / breadcrumbs).

Also add a regression test for the dedup mechanism itself.

@warp-agent-staging warp-agent-staging 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

Unknown source values now warn once per distinct value instead of reporting to Sentry, and five sources the client lacked are added. Two points need a human decision; no correctness or standards findings are outstanding.

Concerns

  • APP-5521's central criterion, no Sentry event on any unknown-source path, is not directly asserted. init_logging_for_unit_tests installs a global logger before any test body runs, so a test cannot swap in a capturing logger, and report_error!'s Sentry call sits behind the crash_reporting feature the test build does not enable. Coverage is therefore indirect, and closing the gap needs a test-only production seam for the reporter — worth deciding deliberately rather than by default.

Verdict

Checks: build pass, tests pass (22/22 in ai::ambient_agents::task), CI green, visual proof n/a

Found: 0 critical, 0 important, 0 suggestions, 0 nits, 2 questions

Responding as wilson: Open session · View factory task

AgentSource::GitLabWebhook => "GitLab",
AgentSource::RunScorer => "Scorer",
AgentSource::Autofix => "Self-improvement",
AgentSource::BenchmarkTrial => "Benchmark",

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.

"Benchmark" is an invented user-facing label: BENCHMARK_TRIAL has no entry in the web RUN_SOURCE_LABELS and is absent from the public RunSourceType, so no existing contract pins this string. Decide whether desktop should surface this internal source at all, and if so under which label, then pin the choice in a test.

Responding as wilson: Open session · View factory task

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.

Still open — this is the requester's call, not mine. Not resolving; waiting on his answer for whether/how BENCHMARK_TRIAL should surface on desktop before touching the label.

Responding as wilson: Open session · View factory task

Revert the per-value dedup helper and the tests this PR added. The
requester wants the unknown-source arm to be a plain log::warn! with no
gating, and considers the added tests unnecessary. Net change is now
just the five new AgentSource variants plus the report_error! ->
log::warn! swap.
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

Re the review's Sentry-observability concern: moot now. e1733d6 reverted the dedup helper and its tests per the requester's explicit call — the arm is back to a plain, ungated log::warn!, so there's nothing left needing that test seam.

Responding as wilson: Open session · View factory task

@acarl005
acarl005 marked this pull request as ready for review August 19, 2026 00:41
@acarl005
acarl005 merged commit d019ddf into master Aug 19, 2026
45 checks passed
@acarl005
acarl005 deleted the warpstaging/app-5521-stop-reporting-unknown-ambientagentsource-values-to-sentry branch August 19, 2026 01:12
@acarl005 acarl005 self-assigned this Aug 19, 2026
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