fix: emit subagent conversation_id in state snapshots [LET-9476]#3240
Merged
Conversation
Local subagent dual-view tabs opened the wrong conversation: local agents have a bare-id agentURL with no ?conversation= param, so the desktop routing fell back to the "default" sentinel and opened the parent agent's main conversation. Cloud agents only worked because their full URL happened to carry the conversation param. Store the subagent's own conversationId (init event + fork path) and emit it as conversation_id in update_subagent_state snapshots — the field letta-cloud's SubagentSnapshot already types and consumes. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code <noreply@letta.com>
christinatong01
requested review from
4shub,
carenthomas,
cpacker,
jnjpng and
kl2806
as code owners
July 6, 2026 22:59
…-conversation-id # Conflicts: # src/agent/subagents/manager.ts
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.
Summary
agentURL(no?conversation=param to parse), so the dual-view routing precedenceconversationId ?? parsedAgentLink.conversationId ?? 'default'fell through to thedefaultsentinel and opened the parent agent's main conversation. Cloud agents only worked by accident — their fullapp.letta.comURL carries the conversation param, which the URL parser rescued.conversationIdonSubagentState(populated from the init event, plus the fork path used by recall subagents) and emit it asconversation_idinupdate_subagent_statesnapshots.SubagentSnapshot.conversation_idis already typed andSubagentGroupalready passes it intoopenSubagentLink— the field was just never populated on the emitter side. This makes the explicit conversation id the first-precedence source for both local and cloud agents.Test plan
tsc --noEmit👾 Generated with Letta Code