Skip to content

fix(agent): Stop resource watches when users ask#1032

Merged
dcramer merged 4 commits into
mainfrom
codex/agentic-stop-resource-watches
Jul 24, 2026
Merged

fix(agent): Stop resource watches when users ask#1032
dcramer merged 4 commits into
mainfrom
codex/agentic-stop-resource-watches

Conversation

@dcramer

@dcramer dcramer commented Jul 24, 2026

Copy link
Copy Markdown
Member

When Junior starts watching a pull request, it stores a resource subscription
for the current Slack conversation. The bug was that a later message such as
stop could be handled as ordinary chat: Junior would say monitoring stopped,
but the stored subscription could remain active. The existing cancellation tool
also required an internal subscription ID that users never see.

This replaces that model-facing contract with a no-argument
stopWatchingResources action. It cancels every resource watch owned by the
current conversation through the existing bulk-cancellation boundary, and
Junior only confirms after that call succeeds. Stopping everything is
intentional: resource watches are conversation-owned, and the existing Slack
thread opt-out path already uses the same scope.

Creating a watch now returns the exact inverse catalog call, so a later turn can
understand natural requests such as stop without relying on a magic phrase or
rediscovering subscription IDs. Creating subscriptions stays directly
available; the less-common list and stop actions live in the deferred tool
catalog. A regression eval creates a pull-request watch, follows it with
stop, and requires the cancellation action before the confirmation.

Expose one context-aware action that stops specific or unambiguous resource watches before the agent confirms completion. Cover the terse follow-up flow with unit tests and a model-backed eval.
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Jul 24, 2026 10:03pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5e2ed83. Configure here.

Comment thread packages/junior/src/chat/tools/resource-events.ts Outdated
Let the resource-events feature own capability gating, model-facing names, and per-turn tool binding so the shared registry only composes the feature tool set.
Return a structured inverse-action hint when creating a resource watch, then stop every watch through the existing conversation cancellation boundary without listing subscription IDs.
Keep subscription creation native-visible while moving list and stop actions into the resource-watch catalog. Subscription results provide the exact dispatcher call needed for later stop intent.
@dcramer
dcramer marked this pull request as ready for review July 24, 2026 22:04
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Jul 24, 2026
@dcramer dcramer changed the title fix(agent): Stop resource watches from conversation intent fix(agent): Stop resource watches when users ask Jul 24, 2026
@dcramer
dcramer merged commit b1c7a5b into main Jul 24, 2026
34 of 36 checks passed
@dcramer
dcramer deleted the codex/agentic-stop-resource-watches branch July 24, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant