Skip to content

feat(channel): allow callers to pass RuntimeContext into Gateway - #2604

Merged
oss-maintainer merged 2 commits into
release/2.0.1from
feat/channel-runtime-context
Aug 7, 2026
Merged

oss-maintainer merged 2 commits into
release/2.0.1from
feat/channel-runtime-context

Conversation

@chickenlj

Copy link
Copy Markdown
Collaborator

Summary

  • Add Gateway run/runStream overloads that accept a caller RuntimeContext, merged in HarnessGateway with AG-UI-style precedence (caller → optional ChannelRuntimeContextResolver replace → gateway identity wins).
  • Carry RTC via SendOptions.withRuntimeContext / withAttribute and InboundMessage.runtimeContext, forwarding through ChatUi and platform channels.
  • Document merge behavior (EN/ZH) and cover merge/resolver/SendOptions with unit tests.

Test plan

  • mvn -pl agentscope-harness -am test -Dtest=HarnessGatewayRuntimeContextMergeTest
  • Smoke ChatUi send with withAttribute / CTX_FORCE_SYNC and verify agent sees attributes
  • Optional: wire GatewayBootstrap.runtimeContextResolver(...) and confirm resolver replaces caller base

Merge SendOptions/InboundMessage caller context (and optional ChannelRuntimeContextResolver) with gateway identity fields, matching AG-UI semantics so attributes like CTX_FORCE_SYNC reach agents on Channel turns.
Mirror String-based send/sendStream/sendToSubagent APIs with Msg and List<Msg> so callers can pass multimodal content without wrapping ChatUiRequest.
@oss-maintainer
oss-maintainer merged commit 1462fad into release/2.0.1 Aug 7, 2026
5 of 9 checks passed
@oss-maintainer
oss-maintainer deleted the feat/channel-runtime-context branch August 7, 2026 16:55
wzl521 pushed a commit to wzl521/agentscope-java that referenced this pull request Aug 12, 2026
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