Skip to content

bridge-sdk: add feature-flagged sessions transport scaffold for start_agent#31

Open
jt-poolside wants to merge 2 commits intomainfrom
jt/bridge-sessions-transport-prep
Open

bridge-sdk: add feature-flagged sessions transport scaffold for start_agent#31
jt-poolside wants to merge 2 commits intomainfrom
jt/bridge-sessions-transport-prep

Conversation

@jt-poolside
Copy link
Copy Markdown
Contributor

Summary

This PR adds an opt-in sessions-API transport path to BridgeSidecarClient.start_agent() while keeping existing sidecar behavior as the default.

What this changes

  • Adds transport selection (sidecar default, sessions behind flag).
  • Adds a sessions path that:
    • resolves agent by name via Core API,
    • creates remote session via /v0/agents/{agent_id}/sessions.
  • Adds continue_from translation for sessions payload (previous_session_id, strategy=no_compaction).
  • Explicitly rejects compaction in sessions transport for this phase.
  • Adds tests for sessions-path validation and payload mapping.
  • Documents flags and current limitations in README.

Why

This is prep work for the sidecar-elimination project. It lets us land SDK plumbing now (safely, behind a flag) while backend approvals/review for full behavior are still in flight.

Compatibility and rollout

  • Default behavior is unchanged (sidecar).
  • Sessions path is opt-in and requires explicit env/config.
  • No breaking API changes for existing SDK users.

Full project context

Next

After backend continue_from (no-compaction) support lands, we can enable the sessions path in the bridge execution flow and then remove sidecar-specific agent orchestration code in a follow-up PR.

from bridge_sdk.models import ContentPartInput, to_proto_content_part
from bridge_sdk.proto import bridge_sidecar_pb2, bridge_sidecar_pb2_grpc

_DEFAULT_AGENT_NAME = "agent_1003_cc_v2_rc-fp8-tpr"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do we want to have this in the sdk? I think we may be able to get this through an api call if we need it, but we may be fine not having a default

Copy link
Copy Markdown
Collaborator

@tkpoolside tkpoolside left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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