Skip to content

Expose optional message source provenance across SDK languages #2563

Description

@aurokin

Problem

The runtime already accepts an optional source on session.send, but the high-level send APIs in the Node/TypeScript, Python, Go, .NET, Java, and Rust SDKs do not expose or forward it. Applications forwarding an agent's message into another session cannot preserve its origin through these APIs.

In Rust, the generated SendRequest.source field also exists but is crate-private, so consumers using typed RPC cannot set it through a supported public API.

Reproduction

At SDK revision d5c9d06d8c4118530083848d9c3fa9d615c0a5c4:

  1. Prepare an update originating from another agent.
  2. Try to supply source: "agent-sender-id" through the high-level send options, or source="agent-sender-id" through Python's keyword API.
  3. The public option is unavailable; sending through the existing API omits source from the request.

Without provenance, downstream consumers cannot reliably distinguish that agent-originated message from source-less input. Encoding the sender in prompt text is not a substitute for the runtime's source field.

Expected behavior

Expose an optional source on high-level send and send-and-wait APIs across all six SDKs, preserving it through builders, cloning, and request serialization. Provide a narrow handwritten Rust typed-request builder for callers using rpc::SendRequest.

  • Forward supplied values unchanged and leave validation to the runtime.
  • Omit source when unset, preserving existing behavior.
  • Preserve billing, delivery mode, attachments, display prompt, tracing, and request correlation.
  • Do not broaden generated-field visibility or add unrelated internal options.

Semantics and scope

Source identifies the message origin; it is not a requirement for a visible reply. A successful high-level send acknowledgement confirms acceptance and returns a message ID, not proof of recipient consumption. Silence alone should not trigger automatic resending.

This request covers SDK passthrough and documentation, not an end-to-end remote-delivery guarantee or a redesign of runtime scheduling. Remote backends may not preserve source after accepting the request.

Regression coverage

Cover supplied and omitted source, enqueue and immediate delivery, send-and-wait forwarding, clone preservation where applicable, and unchanged surrounding request fields. Include Rust typed-RPC serialization and local-runtime event propagation.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions