Skip to content

fix: emit subagent conversation_id in state snapshots [LET-9476]#3240

Merged
cpacker merged 2 commits into
mainfrom
fix/subagent-snapshot-conversation-id
Jul 16, 2026
Merged

fix: emit subagent conversation_id in state snapshots [LET-9476]#3240
cpacker merged 2 commits into
mainfrom
fix/subagent-snapshot-conversation-id

Conversation

@christinatong01

Copy link
Copy Markdown
Contributor

Summary

  • Local subagent dual-view tabs in desktop opened the wrong conversation: local agents have a bare-id agentURL (no ?conversation= param to parse), so the dual-view routing precedence conversationId ?? parsedAgentLink.conversationId ?? 'default' fell through to the default sentinel and opened the parent agent's main conversation. Cloud agents only worked by accident — their full app.letta.com URL carries the conversation param, which the URL parser rescued.
  • Store the subagent's own conversationId on SubagentState (populated from the init event, plus the fork path used by recall subagents) and emit it as conversation_id in update_subagent_state snapshots.
  • letta-cloud needs no changes: SubagentSnapshot.conversation_id is already typed and SubagentGroup already passes it into openSubagentLink — 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
  • Desktop: spawn a local subagent, click its card → dual-view tab opens the subagent's own conversation (not the parent main)
  • Desktop: recall/fork subagent card opens the forked conversation
  • Cloud-backed subagent card still opens correctly

👾 Generated with Letta Code

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 christinatong01 changed the title fix: emit subagent conversation_id in state snapshots fix: emit subagent conversation_id in state snapshots [LET-9476] Jul 16, 2026
…-conversation-id

# Conflicts:
#	src/agent/subagents/manager.ts
@cpacker
cpacker merged commit a4507c7 into main Jul 16, 2026
21 checks passed
@cpacker
cpacker deleted the fix/subagent-snapshot-conversation-id branch July 16, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants