Files
Shangjie Chen 676d1e7645 fix: Restore invocation_context.branch from session history when executing a non-root agent node or resuming a sub-agent in Runner
Any event the node authored is eligible, including a plain text turn, which is
all a non-resumable sub-agent may leave behind. Tool messages are excluded: a
tool's user-facing message is authored under the agent's name and carries the
agent's node path, but is published on `<tool>@<function_call_id>`, so a branch
whose trailing id matches a function call in the session is skipped. Nodes are
matched by static node path (run ids stripped), falling back to author/name for
path-less legacy events, disambiguating sub-agents that share a name. At the
resume sites the scan is scoped to the invocation being resumed; the
new-invocation and live paths use the most recent matching event.

This supersedes the earlier (unsubmitted) cl/944151553, whose path-matching and
invocation-scoping approach is folded in here.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 970044047
2026-08-24 13:31:27 -07:00
..
2026-01-20 14:50:09 -08:00