Skip to content

fix(chat): identify CLI stream requests - #50

Merged
sriaradhyula merged 1 commit into
mainfrom
fix/send-cli-client-context
Aug 25, 2026
Merged

fix(chat): identify CLI stream requests#50
sriaradhyula merged 1 commit into
mainfrom
fix/send-cli-client-context

Conversation

@sriaradhyula

Copy link
Copy Markdown
Member

Summary

  • include client_context.source=cli in every AG-UI stream request
  • make the client identity explicit for gateways that augment client context
  • prevent request validation failures when a gateway materializes client_context and the backend requires source
  • add regression coverage for the serialized request body

Why

Some CAIPE gateways add trusted metadata to client_context before forwarding a request. Older CLI requests omit client_context entirely; a gateway can therefore materialize an object without the source required by Dynamic Agents and trigger HTTP 422. Sending the CLI source explicitly is defensive and remains compatible with servers where client_context is optional.

Validation

  • bun run test:unit (223 tests passed)
  • bunx vitest run tests/stream.test.ts
  • bunx biome check src/chat/stream.ts tests/stream.test.ts
  • bunx tsc --noEmit
  • bun run lint (passes with pre-existing warnings only)

Signed-off-by: Sri Aradhyula <sraradhy@cisco.com>
@sriaradhyula
sriaradhyula merged commit cddef28 into main Aug 25, 2026
3 checks passed
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.

1 participant