Skip to content

Guardian loses the user request in long multi-agent threads #2768

Done

Description

@sentry-junior

In a long Slack thread where a parent run coordinated 8+ child agents, Guardian kept asking before child agents edited the title, body, or draft state of PRs that Junior itself had opened for the user's request. One PR description needed four review-desk approvals. From about 30 minutes into the thread, Guardian could no longer see the message that asked for the work.

Observed (Nov 5, sentry/junior spans, gen_ai.execute_tool, app.guardian.decision)

  • 18:00 UTC: opening message: "determine if there is MCP metadata missing…". 18:06: the user's second message: "knock them out… put up PRs for each separate change".
  • 18:29–18:32: three github_updatePullRequest draft conversions on Junior's own PRs got ask.
  • 19:03:29: a feat(tools): Return structured output from get_latest_base_snapshot toolkit#1984 body update got ask (trace 747fa51fc3d447988df65821bb3eed15).
  • 19:14:42 and 19:16:10: the fix(mcp): Report the shipped version in stdio serverInfo and User-Agent toolkit#1994 body update got ask, with userAuthorization: unknown. That was after the review-desk answer "Approve for the whole effort" (19:04) to "OK for agents to open/update the MCP metadata PRs?". The reasons were "a write not requested in the current actor's user instructions" and "the root instructions contain no user authorization for that update" (traces 8e4ce6c0861446c488e159d4e521a75d, b0672528949340ba811edbf731fc5b13).
  • 19:20:55: the same edit got allow, userAuthorization: high, after a second answer, "Yes, update it" (trace fcc8d9eae2d543bbbcc1871ea95f8326).
  • 19:21:30: a body update on feat(mcp): Keep get_sentry_resource loaded in Claude Code toolkit#1989 by another child agent got allow with no approval card (trace 5a95a1f02f2b4fabbfcb8b2a7b1b1248).
  • 19:29:10: the title and body update got ask. Reason: "the visible user intent only asks to determine whether MCP metadata is missing" (trace c35c56d1fb304c14a5f4f83d6bbef15a).
  • 19:36:54: the same edit got ask again, after the third answer, "Title and description" (19:35). Reason: "materially equivalent to the previously rejected PR-metadata write, and no authorizing user message is visible" (trace ec76247c29db443c8b6c525b74c02deb). A fourth card followed.

Root cause (verified)

  • readRootConversation reads only the newest MAX_ROOT_MESSAGE_EVENTS = 64 message and message_updated events (packages/junior/src/chat/agent-invocations/root-conversation.ts:43, :229-232). It pins only the opening message (:253).
  • Each child result in this thread wrote one message event and two message_updated events. Each user message wrote one message event and one message_updated event. The two I read (seq 169/171) had the same text, so a message_updated can take a slot without adding content. These events come from appendConversationMessages, which writes one on any change to the stored message (chat/conversations/messages.ts:127-147).
  • In the root event log, the 18:06 "knock them out" message had left the page at every blocked review from 19:03 on. The first event on each page was seq 171, 353, 371, 616 and 736, and that message is seq 113. Only 70 message events existed at 19:03. Guardian saw the pinned "determine if…" message as the whole request, which matches the 19:29 reason text.

Contributing (inference)

  • A review-desk answer reaches the root as only the item title, the field label and the chosen option (chat/review-items/messages.ts:58-66, chat/tools/runtime/user-input-request.ts:223-238). The question text and the named action are not in it. Under CHILD_AGENT_RULES (chat/guardian/reviewer.ts:45-54), the reviewer may read "Approve for the whole effort" or "Title and description" as a bare answer to text the parent wrote. That fits userAuthorization: unknown after 19:04 and 19:35, but high after 19:20.
  • No core fact tells Guardian that Junior created the PR. The upkeep exemption (chat/guardian/policy.ts:164, also different_change at :48) depends on the reviewer finding the creation in bounded child evidence. The fix(mcp): Report the shipped version in stdio serverInfo and User-Agent toolkit#1994 child's history compacted between 19:14 and 19:16 (history_version 1 → 2).
  • The repeat ask at 19:36 is the unresolved_prior_ask pattern from Guardian ignores later approvals in child agent runs #2450. Here it combined with the root window above.
  • Draft conversions are different_change by policy (policy.ts:164), so those three asks were by design.

Related: #2450 (a later approval does not clear an earlier ask) and #2438 (Guardian asks before routine upkeep on PRs that Junior created).

Expected (reported by the user): Junior should not need approval to keep its own PRs up to date inside work that the user already approved. A review-desk answer should count as approval every time. A fresh, explicit approval should clear an earlier ask.

Proposed in discussion

  • Always keep every authorizing root user: message, at least the ones that started or widened the work, and not only the opener. Or leave out message_updated events when the text did not change, so they do not use the 64 slots.
  • Put the question and the action into the review-desk answer message that goes to the root.
  • Pass a core fact that the current work created the resource, so upkeep does not depend on evidence that compaction can remove.

via @dcramer.

--

View Session [Sentry]

Activity

  1. sentry-junior commented on Nov 5, 2026

    @sentry-junior
    ContributorAuthor

    Working on this. #2769 fixes the root message window and adds the question to review desk answers. The created-resource core fact and #2450 are still open.

  2. sentry-junior commented on Nov 23, 2026

    @sentry-junior
    ContributorAuthor

    Closing as superseded by the Guardian redesign: intent in #4139, technical proposal in #4140. This issue's concern is covered there.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions