Stop reporting unknown AmbientAgentSource to Sentry, add missing sources (APP-5521) - #15295
Conversation
…ces (APP-5521) Downgrade the unknown-source deserializer fallback from report_error! to missing: JIRA, RUN_SCORER, GITLAB_WEBHOOK, AUTOFIX, BENCHMARK_TRIAL.
|
This PR was generated with Warp. Comment |
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.
There was a problem hiding this comment.
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_testsinstalls a global logger before any test body runs, so a test cannot swap in a capturing logger, andreport_error!'s Sentry call sits behind thecrash_reportingfeature 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", |
There was a problem hiding this comment.
"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
There was a problem hiding this comment.
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.
|
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 Responding as wilson: Open session · View factory task |


Description
Fixes APP-5521:
Error: Unknown AmbientAgentSource: ORCHESTRATIONand siblings logged 58,472+ Sentry events across 1,106+ users (Sentry WARP-CLIENT-BETA-STABLE-87FZ). The client's hand-writtenAgentSourceenum inapp/src/ai/ambient_agents/task.rsreported 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.ORCHESTRATIONitself 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: replacedreport_error!withlog::warn!for an unrecognized source string. The soft fallback tosource: Noneis unchanged.warp-server'sTaskSourceType(logic/ai/ambient_agents/sources/types.go) and the OpenAPIRunSourceType:JIRA,RUN_SCORER,GITLAB_WEBHOOK,AUTOFIX,BENCHMARK_TRIAL.warp-server'sclient/packages/shared/src/utils/run-source.tswhere available):Jira: mirrorsLinear— a human triggers the task from a ticket comment, sois_user_initiated = trueandblocks_cloud_followups = false.GitLabWebhook: mirrorsGitHubWebhookexactly (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 areis_user_initiated = falseandblocks_cloud_followups = true.BENCHMARK_TRIALhas no web label (it isn't in the publicRunSourceTypeused byrun-source.ts), so the display name"Benchmark"was chosen to matchRunScorer's"Scorer"— open question with the requester on whether/how this should surface on desktop at all.Autofix: the server'sTaskSourceType.PublicName()maps the internalAUTOFIXvalue to the public wire valueSELF_IMPROVEMENTbefore 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 existingAgentWebhook/"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), anddisplay_name()uses"Self-improvement"(the shared web label for both spellings).Linked Issue
factory:wilson).Testing
cargo test -p warp --lib ai::ambient_agents::task::tests— 15 passed, 0 failed (pre-existing coverage; includesambient_agent_task_deserializes_orchestration_sourceandambient_agent_task_deserializes_github_webhook_sourceas 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 onmastertoo, in the pre-existing, unrelatedwarp_completercrate (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