Skip to content

Relayed child agent results talk about thread participants in the third person #2849

Closed

Description

@sentry-junior

When a child agent reports a GitHub event, such as a PR review, the parent relays it into the Slack thread. It mentions the reviewer and then talks about them by name in the same message, as if they were someone else. The reviewer is in the thread and reads the reply as written about them, not to them.

This is the same symptom as #2248, on a path the #2248 fix doesn't cover.

What happened

A root conversation started one child agent per PR (getsentry/toolkit#2051–#2057). Each child watched its PR. When the reviewer requested changes or approved, the child reported to the parent, and the parent posted to the thread. The reviewer was in the thread, had asked for the work, and is linked to their GitHub account. The parent's replies looked like this:

@Reviewer @requester Burak requested changes on #2055. One of his two asks is done…

@Reviewer … Burak approved #2051 and asked whether…

That happened in at least five replies. The right form is "you requested changes on #2055" when addressing the reviewer.

Why it happens

  • The PR review notifications refer to the reviewer by GitHub login even when they are the mentioned Slack user #2248 fix only covers Event task input. peopleTags in packages/junior/src/chat/task-input.ts renders the doer and adds If you mention <@U…>, write to them as "you"…. The child agent that receives the watch Event sees that rule.
  • The child then writes its result as free text, using the GitHub login (BYK requested changes on …), and often adds the mention too. That text reaches the parent as an <agent-result>, with no doer or people metadata.
  • When the parent writes its reply, it has no rule that ties the login in the result to the Slack user it mentions or to someone present in the thread. The system prompt's <agent-result> rule (system-prompt-rules.ts:40) only covers status handling. So the parent maps the login to a display name and keeps the child's third-person framing.

Possible fix

This needs a design choice. Options:

  1. General prompt rule: when a reply mentions or addresses someone, talk to them as "you", and don't also name them in the third person. That covers relays, catch-ups and plain replies, but it's prompt steering rather than structure.
  2. Carry the doer through the result: when a child's turn was started by an Event with a resolved doer, attach the doer's mention and handles to the <agent-result>. The parent then renders the same "you" rule that peopleTags gives Event turns.
  3. Both. Option 2 for the event case, option 1 as the baseline.

Add an eval next to subscriptions.eval.ts ("when the person who asked reviews the PR, address them once as you"), with the delivery going through a child agent result instead of a direct watch delivery.

Related

via @BYK.

--

View Session [Sentry]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions