fix(server): Claude artifact watchers show as monitors, not agents#14885

closed1
main
GitHub fork: fix/claude-artifact-watcher-monitor
opened27d agobyJJonasFocus
View on GitHubTwo-way sync enabledPR last imported 9d ago

Problem

When Claude publishes a claude.ai artifact, Claude Code starts a background monitor_ws task that watches it for live updates. The V2 Claude adapter treats every task type except local_bash as a subagent, so the watcher shows up in the Agents panel as a working agent with the session's model and effort, sometimes for hours. Fixes #13978.

Change

monitor_ws is now listed with the other opaque background tasks as a monitor, so it shows in the thread's waiting work as a monitor and never becomes a subagent. It's a two-entry map change plus a comment.

Scope and approval

Triaged bug, and this is the classification the triage asked for. The old MONITOR_TASK_TYPES set it pointed at was removed in the V2 merge, so the change lives in ClaudeAdapterV2 now. Earlier attempt: #14019 by @kvnloo.

I left monitor_mcp alone since nobody has reported it on V2 yet, but it would probably want the same treatment.

Verification

New adapter test: a monitor_ws task_started lands in the background task list as a monitor and emits no subagent update. It fails without the change. The full ClaudeAdapterV2 test file passes (127 tests) and the server typecheck is clean. I didn't have a real recorded monitor_ws session to replay, so the test frame is modeled on the existing local_bash ones.

Checks

8 successful ¡ 7 skipped
All checks passed
95273c4

Added 1 commit

  • fix(server): Claude artifact watchers show as monitors, not agents95273c4
Synced from GitHub

Approvability

Verdict: Approved at 95273c4

Macroscope's review found this PR approvable — This is a focused server-side classification fix: monitor_ws watchers are represented as monitors rather than model-backed agents, with a regression test covering the behavior. The change is isolated and does not modify product defaults, schemas, deployment, or static-analysis configuration.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
1docs/internals/effect-services.md — configured

No actionable comments were generated in the recent review. 🎉

â„šī¸ Recent review info
âš™ī¸ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 21168e00-e2c4-4c42-a3b9-dca00223f384

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between cc1e634bfa62edd56ff792eea666e436fdef788f and 95273c49733a5eb96c900448a1e95783cf812b7c.

📒 Files selected for processing (2)
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

ClaudeAdapterV2 now classifies monitor_ws tasks as monitors. A test checks their roster entry and verifies that no subagent.updated event is emitted.

Changes

Claude monitor task classification

Layer / File(s)Summary
Classify and test monitor tasks
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
The adapter maps monitor_ws to monitor. The test checks that the task appears in the background-task roster and does not emit a subagent.updated event.

Priority: âŦ‡ī¸ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix ¡ Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: âšĒ Minimal ¡ up to 95273

The adapter routes monitor_ws task starts to background monitor work instead of the working-agent path. No actionable merge-blocking risk is established.

Security Architecture Review

Security architecture risk: đŸ”ĩ Low ¡ up to 95273

The change reuses existing background-task handling and does not appear to add permissions or external access. Risk is low, with recovery of tasks retained across upgrades not fully established.

Retained concerns No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure is provider-task classification, waiting-state projection, and completion reporting within the server runtime. The examined change does not establish additional tenant, service, credential, or data-store access.

Trust Boundaries and Controls

  • inferred — Provider-supplied task metadata gains access to an existing roster path, not a newly callable endpoint or authority-bearing operation. Classification remains allowlist-based, and primary roster lookup and event emission remain associated with the native provider thread.

Resilience and Maintainability Implications

  • observed — The existing last-known-task fallback and one monitor cleanup predicate use taskId without native-thread qualification. The primary roster is thread-scoped. Task-ID uniqueness across concurrent native threads was not established, so cross-thread collision behavior remains a coverage gap rather than a verified attack path.
đŸšĨ Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverageâš ī¸ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and concisely identifies the main change: Claude artifact watchers are classified as monitors instead of agents.
Description check✅ PassedThe description covers the problem, implementation, scope, linked issue, approval context, verification results, and test limitations. It provides enough detail to review the focused fix.
Linked Issues check✅ PassedIssue #13978 requires monitor_ws artifact watchers to avoid subagent presentation and working-agent accounting. The PR classifies monitor_ws in CLAUDE_OPAQUE_BACKGROUND_TASK_KINDS as monitor. â€Ļ
Out of Scope Changes check✅ PassedThe PR changes only Claude V2 task classification and adds the matching adapter test. Both changes directly support issue #13978. No unrelated product behavior is shown in the reviewed change summary.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
đŸ§Ē Generate unit tests (beta)
  • Create a new PR
  • Autopilot ¡ Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description.