Skip to content

fix(automations): Tell the agent where to write the Automation creator mention - #2435

Merged
dcramer merged 8 commits into
mainfrom
fix/automation-creator-mention-rule
Oct 30, 2026
Merged

dcramer merged 8 commits into
mainfrom
fix/automation-creator-mention-rule

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

An Automation runs later without the conversation that created it. Words such as "this channel" or "here" mean nothing then. Before this change, the tools told the agent to rewrite "me" as the creator's Slack mention in the saved instruction. Now the agent calls the creator "the Automation creator". The run-time Created by: line says who that is and where to write the mention.

Refs #2362

Run-time creator line (chat/task-input.ts)

Created by: <@U123>. This person is the Automation creator. "The Automation creator", "me", and "my" in the instructions mean this person. Where the instructions refer to this person, write this mention in the message. If they do not, do not mention this person.

Tool description (chat/automations/edit-schema.ts)

The shared instruction description for the scheduled and event create and update tools now says:

  • The run does not see this conversation, so words like "this channel" or "here" will mean nothing then. Write the exact target instead, such as a channel mention or a link.
  • Call the person who created the Automation "the Automation creator", not "me". Each run knows who that is.
  • Name every other person with their Slack mention, including a requester who did not create the Automation.

The full term "the Automation creator" keeps "issue creator" or "PR creator" from matching. A requester who did not create the Automation is covered by this guidance and an eval, not by a fixed keyword check.

Evals (integration)

  • Scheduler creation: "remind me in this channel to submit my timesheet" saves "Automation creator", without "me", "my", or "this channel".
  • Scheduler delivery: "Remind me to do healthchecks." and "Remind the Automation creator to do healthchecks." both deliver <@U0TEST>.
  • Scheduler management: a requester who did not create the reminder asks to be reminded too. The update saves <@U0TEST>, without "me", "my", or "Automation creator".

Live results on c570f89 (integration run 41101189024, merged with main 15ee5c1)

  • All of the cases above pass, and all 6 OAuth cases pass.
  • 4 other cases fail: the two event-automation "post nothing" cases, "block it and tell only its creator", and scheduler "no message outcome". Each one reads the finishAutomationRun result, which was null in the eval session for dispatch runs. They failed the same way on other PRs against the same main, and fix(evals): Record automation fixture channels as public #2449 fixes the fixture. These failures do not come from this PR.

Not in this PR

  • renderCurrentInstruction (chat/current-instruction.ts) XML-escapes the task text, so the model sees &lt;@U0TEST&gt;. This can also make the model drop a mention. It applies to every current instruction, so it needs its own change.
  • Moving the creator consumers (credentials, DMs, creator checks, display) from the createdBy copy to creatorIdentityId is a separate hard cutover.

via David Cramer.

--

View Session [Sentry]

A due reminder such as "Remind me to do healthchecks" often posts
"Reminder: Do your healthchecks." without the creator mention, so Slack
notifies nobody.

#2052 changed the creator line in task input from a rule about what to
write ("Where the instructions say "me" or "my", write this mention.")
to a rule about what "me" means ("Me" and "my" mean this person: mention
them in the message.). With only the meaning, the model often resolves
"me" to "your" and drops the mention. The task input also reaches the
model XML-escaped inside `<current-instruction>`, so the mention shows as
`&lt;@U…&gt;`, which makes the drop more likely.

The creator line now says what to write again, and it keeps the rule to
not mention the creator when the instructions do not say "me" or "my".

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 30, 2026 5:45pm UTC

Request Review

@blacksmith-sh

This comment has been minimized.

@sentry-evals

sentry-evals Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Sentry Evals

junior-behavioral

Run Status Passed Failed Errored Cost Tokens Duration
Head Error 74 6 2 $0.63 0 1,576.22s

Base commit 8415974 has no eval run to compare against.

junior-guardian

Run Status Passed Failed Errored Cost Tokens Duration
Head Passed 94 0 0 $0.03 0 24.02s

Base commit 8415974 has no eval run to compare against.

junior-integration

Run Status Passed Failed Errored Cost Tokens Duration
Head Failed 101 4 0 $0.72 0 1,441.34s

Base commit 8415974 has no eval run to compare against.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

4 screenshot changes — 4 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Child Agent Drawer · Desktop
Conversation Child Agent Drawer · Desktop
Changed
Conversation Child Agent Drawer · Mobile
Conversation Child Agent Drawer · Mobile
Changed
Conversation Event Log · Mobile
Conversation Event Log · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed

Stored instructions keep the creator's own words. Each run reads the
creator identity and renders its mention for the Destination, instead of
using the createdBy copy or a mention saved in the instruction text.

Co-Authored-By: David Cramer <david@sentry.io>
@github-actions github-actions Bot added risk: high PR risk score: high and removed risk: medium PR risk score: medium labels Oct 30, 2026
Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title fix(automations): Tell the agent to write the creator mention for "me" fix(automations): Bind "me" to the creator identity at run time Oct 30, 2026
The instruction tool description said "write it to stand alone" without saying what that means. A reference such as "this channel", "here", "this thread", or "that PR" needs the request to make sense. The run does not see the request.

The description now tells the agent to replace each such reference with the exact target, such as a channel mention, a link, or an ID.
The run does not see the request, so "me" means nothing in a saved
instruction. Tools now save "the creator", and each run binds it to the
creator identity. The creator line still treats "me", "my", and a stored
creator mention as the creator, so older instructions keep working.

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title fix(automations): Bind "me" to the creator identity at run time fix(automations): Bind "the creator" to the creator identity at run time Oct 30, 2026

@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.

Stale Bugbot comment from a previous run.

Comment thread packages/junior/src/chat/task-input.ts Resolved
"The creator" also matched resource creators, such as an issue creator.
Use the full term in the tool description and the Created by line.
Bring back the rule to write exact targets instead of references to the
conversation. Reject "me" and "my" in an update by a requester who did
not create the Automation, because each run reads them as the creator.

@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 b0eeaa6. Configure here.

Creation already ties the creator identity to the Slack actor, so the
lookup could not change the mention. Keep createdBy for the Created by:
line. Replace the hard "me"/"my" rejection with tool guidance and an
eval for a requester who did not create the Automation. Simplify the
Created by: line to one rule.

Co-Authored-By: David Cramer <david@sentry.io>
The integration evals on a8eeb44 showed that "write this mention for
them" lets the model drop the mention in both delivery cases. Say where
to write it, as the earlier passing lines did. Say again in the tool
description that each run knows the Automation creator, so the agent
keeps the term instead of dropping the person.
@dcramer

dcramer commented Oct 30, 2026

Copy link
Copy Markdown
Member

are the eval failures related?

@sentry-junior sentry-junior Bot changed the title fix(automations): Bind "the creator" to the creator identity at run time fix(automations): Tell the agent where to write the Automation creator mention Oct 30, 2026
dcramer pushed a commit that referenced this pull request Oct 30, 2026
Since #2440 (`15ee5c130`), an automation run no longer writes its saved
visibility to the Destination row. Only a live Slack signal does. A run
into a channel with no row stores `unknown`, and readers treat it as
private.

In production, the Slack thread where a person created the Automation
records the channel. The eval fixture inserted Automations without that
thread, so their channels stayed `unknown`. The fixture reads results as
`WEB_VIEWER_EMAIL`, who is not a participant. So
`readConversationAccessFromSql` returned `canViewPrivateContent: false`,
and the reporting API hid tool payloads for every scheduled and event
automation run. Tool calls came back with no input and no output
(`result null [4B]` on every tool). `finishAutomationRun` results and
tool arguments were empty. This broke these cases on unrelated branches
(#2435, #2442, fix/flaky-behavioral-evals, chore/remove-slash-command):

- Integration: `Event automation delivery` (no-match silence ×2, blocked
automation) and `Scheduled Delivery` (no message outcome)
- Behavioral: `Scheduled Delivery` (post in this channel, provider that
Junior does not have) and `Sentry Skill Workflows` (creator-bound
scheduled Sentry work)

There is no product change. Fail-closed `unknown` is intended (#2440).
Automations are created from a live Slack turn in their channel, so
production channels have a known visibility.

## Fix

`packages/junior-evals/src/fixture/insert.ts`:
`insertScheduledAutomation` and `insertEventAutomation` now store the
creation thread through the Conversation store with `visibility:
"public"`, as the live Slack event would. No assertions, cases, or
timeouts change.

## Checks

- `pnpm lint`, `pnpm typecheck`, `pnpm --filter @sentry/junior-evals
test` pass.
- A throwaway harness check (not committed) used the real insert
functions. A dispatch-shaped write into a bare `slackChannel()` was
redacted (`unknown`). Channels from either insert function were readable
(`public`).
- The 7 affected eval cases did not run locally: the sandbox has no
`cloudflared` for eval egress. CI must confirm them.

<!-- junior-request-attribution:start -->
via **David Cramer**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A5d3914babce549420a1ad7b950c41799 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A5d3914babce549420a1ad7b950c41799)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A5d3914babce549420a1ad7b950c41799/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
@dcramer
dcramer merged commit eed2021 into main Oct 30, 2026
48 of 50 checks passed
@dcramer
dcramer deleted the fix/automation-creator-mention-rule branch October 30, 2026 19:09

This branch was successfully deployed

1 active deployment
Preview – junior-docs — c570f896 Deployed Oct 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant