Artifact live-update monitor (monitor_ws) persists indefinitely in scheduled-task sessions, blocking app restart — no way to disable auto-arm or auto-exit the session
Environment
- Claude Code desktop app, Windows 11 Pro (10.0.26200)
- Scheduled tasks created via the scheduled-tasks MCP (weekday cron runs in the desktop app)
- Model: claude-fable-5
Description
Every publish with the Artifact tool auto-arms a persistent background WebSocket monitor, shown in the Background tasks panel as "live updates for artifact (auto-armed on publish)" / monitor_ws. Its purpose (notify the session if another session republishes the same artifact URL) makes sense for interactive sessions, but it arms unconditionally, including in one-shot scheduled-task sessions that publish a report once and never publish again.
In the desktop app, scheduled-task sessions linger after the run completes (documented behavior, so the user can review the run). The result:
- The
monitor_wswatcher sits in Running all day, every day, after each scheduled run. - Attempting to restart the app is blocked with "something is running, wait" — but this task never finishes by design, so the advice is un-followable. The user's only option is to force past the warning daily.
What we verified from inside the session
TaskListreturns empty — the monitor has no visible task id.TaskStoprejects themonitor_wsdisplay label; the real id only surfaces via task notifications, which a headless scheduled run never receives in a reviewable way.- No hook fires post-publish with the monitor's handle; no hook can force session termination.
- The only related knob is
CLAUDE_CODE_DISABLE_ARTIFACT=1, which disables artifacts entirely — self-defeating when the artifact is the scheduled deliverable (a daily dashboard republished to a stable URL via theurlparam).
Requested fixes (any of these would resolve it)
- Don't auto-arm the live-update monitor in scheduled/headless sessions, where a cross-session republish race is not meaningfully preventable anyway (the next day's run is a fresh session with a stale baseline regardless).
- Give the monitor a TTL or a setting (e.g.
artifactLiveUpdates: false/ env var) so it can be disabled without disabling artifacts. - Let scheduled-task sessions auto-exit when the run completes, which would end this whole class of lingering background work.
- At minimum, exclude notify-only monitors from the "something is running" restart guard — a watcher that never finishes by design should not block a clean restart.
Impact
Daily friction for any user running scheduled reports that publish artifacts: a permanently-running background task per run and a blocked restart path with advice ("wait") that can never be satisfied.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗