Repository navigation
fix(prompt): Steer replies by intent instead of length and content rules - #2514
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
dcramer
approved these changes
Nov 1, 2026
dcramer
approved these changes
Nov 1, 2026
Member
|
needs rebased |
Co-Authored-By: David Cramer <[email protected]>
The parent is the only agent that talks to the user, and the general concise-reply intent already covers how it uses a child result.
Without the old length target, a how-to DM got a 2.4k-character guide that Slack split into two messages. State the chat-reply intent and keep the canvas route for long detail, without a number.
Drop the Slack-only chat-reply line. The shared intent now says that the request sets the length, so long answers stay possible when they are needed.
sentry-junior
Bot
force-pushed
the
fix/concise-reply-steering
branch
from
November 2, 2026 00:01
dd296ea to
72ea6bb
Compare
dcramer
enabled auto-merge (squash)
November 2, 2026 00:01
dcramer
added a commit
that referenced
this pull request
Nov 2, 2026
The integration eval "when the request is reaction-only, add a reaction
without reply clutter" fails when its recordings miss and the model runs
live. The model adds the reaction, then ends the Turn with a text reply
that only reports it. This is the product rule that the failure exposed:
when a reaction on the person's message is the whole reply, Junior does
not restate it in text.
**Cause.** The runtime is correct. `decideReply`
(`services/assistant-reply.ts`) does not deliver text from a message
that calls a tool. `turn-result.ts` accepts `[[NO_REPLY]]` and gives the
`no_reply` status. A text reply goes out only when the final message has
no tool call and is not the marker. The final message in the failing
runs was plain text. The reaction tool gave the model no sign that the
person can see the reaction: its description says only "Add an emoji
reaction to the current inbound Slack message.", and its result is only
`{channel_id, message_ts, emoji}`. The system prompt rule ("When no
visible thread reply is requested or useful ... `[[NO_REPLY]]`") leaves
"useful" to the model. The output rules also push toward a text reply,
for example "state the choices that matter in your reply". So the model
reported the reaction.
Live evidence from the CI result artifacts (`openai/gpt-6-luna`):
| Run | Branch | Reaction-only reply |
| --- | --- | --- |
| 41344475173 | feat/no-plain-text-questions | `Added a heart reaction.`
(failed) |
| 41346487651 | feat/no-plain-text-questions | none (passed) |
| 41354398644 | feat/no-plain-text-questions | `Added a ❤️ reaction.`
(failed) |
| 41356852872 | feat/no-plain-text-questions | `Added a ❤️ reaction.`
(failed) |
| 41327735429 | feat/scheduled-automation-dashboard-access | `Added a ❤️
reaction.` (failed) |
| 41360978430 | this PR | none (passed) |
The eyes reaction case in the earlier runs posted `👀` or `👀 Done.` as a
reply too. That case does not check replies, so it passed. In this PR's
run it posted no reply.
**Change.** The `addReaction` description now says that the person sees
the reaction, and that a reaction that is the whole reply ends the Turn
with exactly `[[NO_REPLY]]`. `addReviewItem` uses the same contract for
its card ("the card is your reply, so end with exactly `[[NO_REPLY]]`").
The rule is owned by the tool, as `policies/agent-steering.md` says. The
cross-tool protocol stays in the system prompt. No system prompt line is
added.
**Rejected option.** I did not make the runtime drop a final message
that restates a reaction. To find such a message, the runtime must
classify free text. It would drop real answers that also add a reaction,
for example "Added 👍. The deploy is green."
**Tests.** I added no new test. The existing reaction-only case in
`evals/integration/conversation/actions.eval.ts` owns this behavior, and
its assertions do not change. `policies/testing.md` says not to assert
static prompt strings. Local checks: `pnpm --filter @sentry/junior
typecheck`, plus `vitest run tests/unit/slack
tests/integration/slack-channel-tools.test.ts` (290 passed). I could not
run the eval live locally because the eval env (`ROACH_TOKEN`,
`cloudflared`) is not available in this sandbox.
Integration evals run on this PR only with the
`trigger-evals-integration` label, so I added it. Run 41360978430: both
reaction cases missed their recordings, ran live, and passed with no
reply. One live run is evidence, not a failure rate. Shard 2 failed on
two scheduler cases ("save it for the Automation creator", "a due
reminder says me, mention its creator"). They also failed live on
`feat/scheduled-automation-dashboard-access` (run 41327735429), and this
change does not touch them.
Related: #2514 removes "state the choices that matter in your reply",
which is one of the rules that push toward a text reply.
<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A7a1dc2757924a78a9104357ce0de2cbf -->
--
[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A7a1dc2757924a78a9104357ce0de2cbf)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A7a1dc2757924a78a9104357ce0de2cbf/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
dcramer
added a commit
that referenced
this pull request
Nov 2, 2026
…2520) Integration evals on PRs off main with both #2514 and #2504 failed four cases. Each failure has a root cause in a tool contract, a turn input, or the eval fixture. None is a runtime double post. **Attachments: "when the vision model cannot read an image"** (0.50 in 4 of 4 runs on main; at the 0.75 floor in 9 of 13 earlier runs) The turn input said only that the image "could not be analyzed". `viewImage` said "unsupported image format; use PNG, JPEG, GIF, or WebP" for a `.png` with bad bytes. The agent then told the user that the attachment "didn't come through" and asked for a re-upload, as if no file arrived. Both messages now say that the file arrived but could not be read as an image. The case now scores 1.0. **Slack Thread Status and Title, both cases** ("expected 2 to have a length of 1") This is not a double post and not a second title. The failing assertion is `replies` (lines 27 and 42). Since #2514, a how-to answer is about 2,200–2,400 characters, which is over the 2,200-character Slack inline budget. Delivery splits it into two posts. #2514's own branch failed this way at 08f9f6a. The fixture counted each post as a reply, and the judge saw the answer three times. The fixture (`slackCallReplies` in `src/fixture/results.ts`) now treats the consecutive posts that make up one stored reply as one reply. A repeated post is still a second reply. The comparison removes the continuation marker and drops code fence lines. A split inside a code block closes the block in one post and reopens it, with its language tag, in the next. Dropping the fence lines also keeps a cut between two real code blocks matching. The fix is fixture-only, and Slack output code does not change. I checked it against the real split posts of the failing runs. Unit tests cover a plain split, a split inside a ```ts block, a cut between two code blocks, and a repeated post. **Schedule Creation: "simple one-off reminder"** (Guardian `ask`, then the agent asked to confirm) The `createAutomation` description said that the automation "delivers to the channel or DM of this conversation". Guardian believed it over the `task_creator` outcome and returned `unclear_destination`. The new Guardian snapshot reproduces this on the old description (run 41374373955: "schedules a reminder in the active public Slack channel") and allows on the new one (run 41374880826). The description now says that the automation belongs to the conversation and that its outcomes set where its messages go. A later cleanup removes the sentences that other surfaces already own. The `<tool-policy>` block owns creator credentials and subscribable tool results. The trigger `identifier` field and `searchEventTypes` own namespace-wide event reach. The cleanup also removes the provider example from core. The first invalid call (`timezone` beside `schedule`) is a model nesting slip that 8 earlier passing runs also had. The strict schema catches it, and the retry recovers. **Scheduled Delivery: the creator mention** (run 41382009284 on 60f4efe, all 3 attempts) `createAutomation` is in the tool list of every automation run. A change to its description stops the stored recordings from matching, so these cases run live. Live, a reminder for its creator often posted without the mention: "Reminder: The Automation creator, please do healthchecks.", "Reminder: Do your healthchecks.", and "Reminder: Do healthchecks.". Such a reminder posts to the channel without pinging its creator. `requireInstructionReferences` makes a stored instruction call the creator "the Automation creator". `renderTaskInput` passed that text through, and only the `Created by:` line told the run to write the mention instead. `renderTaskInput` now writes the creator mention in place of "the Automation creator" (any case, whole words). Scheduled and event automations pass a creator. Watches do not, so their input does not change. The `Created by:` line stays, because it still covers "me" and "my". `heartbeat-scheduled-automations.test.ts` now checks that a stored "the Automation creator" reaches the run as the mention in the `Instructions:` line. The test fails without the fix. All three failures were on "when a due reminder says me, mention its creator". Its legacy instruction says "me", not "the Automation creator", so this fix does not reach it. That case stays model choice. #2519, stacked on this PR, moves it to the behavioral suite. This PR does not move it. CI: pending on a35f17f. Part of #2488 <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A7a1dc2757924a78a9104357ce0de2cbf --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A7a1dc2757924a78a9104357ce0de2cbf) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A7a1dc2757924a78a9104357ce0de2cbf/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Junior's Slack replies run long and are hard to follow. The cause is steering, not one missing rule. The
<output>block has an 800-character target, and several other rules require content in every reply: changed paths, the exact failed command and stderr, a "what I checked / known / unknown / what would settle it" recipe, cited paths, which source is authoritative, and the choices made. The length target loses to those rules. Every reply turns into a report with bold section labels.This change states the intent once and removes the per-reply requirements:
<output>(Slack and local): the 800-char line becomes one intent line: be precise and concise, lead with the result, and include only what the person needs to understand, decide, or act on.<evidence>rules still decide what Junior may claim. They no longer decide what each reply must include.github-codeskill: "Report repo, branch, PR, checks, and skipped checks" becomes "link the PR; mention checks only when they failed or were skipped". The follow-up steps now fix routine review feedback and failed checks without a thread update. They reply only when the requester must act, or when the PR merges or closes.policies/system-prompt.mdnow says<output>states intent. Guidance for one situation goes in that tool result or input.The two watch evals no longer require the reply to state the watch expiry. Watch expiry is an internal detail. The existing "watched event does not serve the intent, stay silent" eval still covers no-reply on events.
The matching
junior-prodchange (PR watch intent and local skills) is getsentry/junior-prod#587.via @dcramer.
--
View Session [Sentry]