Skip to content

fix(session): alert for an agent waiting on artifact comments - #491

Open
irisitymichaelgrundberg wants to merge 1 commit into
Ark0N:masterfrom
irisitymichaelgrundberg:fix/artifact-comment-monitor-needs-you
Open

irisitymichaelgrundberg wants to merge 1 commit into
Ark0N:masterfrom
irisitymichaelgrundberg:fix/artifact-comment-monitor-needs-you

Conversation

@irisitymichaelgrundberg

Copy link
Copy Markdown
Contributor

Follow-up to #473.

What goes wrong

An agent that publishes an artifact arms a monitor for its comments and ends its turn. Claude Code shows that on the footer as · 1 Artifact comment monitor ·. #473 put that chip on Claude's watchingLine list, so the session counts as watching and its idle prompt opens already acknowledged. Every other chip on that list is work the agent runs for itself. This one waits on the user: the agent hears nothing until somebody comments, so the alert #473 quiets is the one the user needs.

The fix

Claude's watchingLine drops the chip from its label list and gains a lookahead, ^(?!.*Artifact comment), that refuses any footer row carrying it.

  • The lookahead judges the whole row, so a shell running beside the comment monitor cannot report the session as watching either, whichever order the chips appear in. The ^ makes that work, and the registry comment says so, so a later tidy-up does not drop it.
  • It stops short of "monitor", so a footer cut off in the middle of the chip still counts.
  • It can only refuse a match, never create one, so the injection guard from feat(approvals): let a session watching its own background work keep quiet (#468) #473 is unchanged. The worst an agent can do by printing the chip is make its own session alert.
  • The pattern still passes compileVersionRegex(). It has no nested quantifier and it is 164 characters, under the 200-character cap.

docs/cli-registry.md and docs/wiki/Notifications-And-Approvals.md each gain a short paragraph about the exception.

Verification

npm test passes (433 files, 8302 tests), and typecheck, lint and format are clean.

The new tests in test/session-watching.test.ts cover the chip on its own, the plural, both chip orders beside a shell, and a footer cut off mid-chip. The singular footer is a verbatim capture from a live session waiting on artifact comments. The plural is assumed.

I also ran the stock pattern against the live pane of that session: before the change it reported 1 Artifact comment monitor, and after it reports nothing.

A two-model review (Codex CLI and Claude, same diff, same brief) raised six findings, and I applied the five that called for a change.

🤖 Generated with Claude Code

An agent that publishes an artifact arms a monitor for its comments and
ends its turn. Claude Code shows that on the footer as `1 Artifact
comment monitor`, and Ark0N#473 put that chip on the list of background work,
so the session counted as watching and its idle prompt opened already
acknowledged. Unlike every other chip on the list, that monitor waits
on the user: the agent hears nothing until somebody comments.

Claude's `watchingLine` now refuses any footer that carries the chip,
through a lookahead over the whole row, so a shell running beside the
monitor cannot report the session as watching either.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@irisitymichaelgrundberg
irisitymichaelgrundberg marked this pull request as ready for review September 25, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant