Skip to content

feat(agent): expose parent session identity to child extension contexts for RLM trees #34

Description

@rynfar

Part of #22 (Meridian reliability umbrella). Prerequisite for rynfar/meridian#902 (proxy-side parent-tree cancellation).

Problem

After #23 / PR #31, every RLM child stamps its own session identity via its own extension runner. But the proxy still cannot associate a child with its parent, so aborting a parent's request cannot tear down the children's provider streams proxy-side. The wire contract proposed in #23 is an additive field in the metadata.user_id JSON envelope: {"session_id": "<child>", "parent_session_id": "<root>"}.

The extension cannot produce that today: a child runner's ctx.sessionManager.getSessionId() returns the child's id, and nothing extension-visible names the parent.

Proposed shape

  • Expose the spawning session's id to a child session's extension context — e.g. ctx.sessionManager.getParentSessionId?(): string | undefined on the read-only view (undefined for root sessions), or an equivalent context field. Must work for inline and daemon RLM children and compose with the sessionIdScope mechanism from PR fix(coding-agent): scope provider identity to the agent that owns each request #31 (a scoped view keeps reporting the owner's parent).
  • Additive only: existing extensions unchanged; no daemon wire change (the value rides inside the payload extensions already produce).
  • Update packages/coding-agent/docs/extensions.md.

Acceptance

  • With a test extension: an inline RLM child's before_provider_request can read both its own session id and its parent's; a root session reads undefined; a side question / auxiliary scoped call reports its owner's parent linkage consistently.
  • Focused tests at the runner/context seam.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions