Repository navigation
feat(ai-client): send AG-UI protocolVersion in the run request body - #1934
kbuschgens wants to merge 2 commits into
Conversation
AG-UI 1.0 RunAgentInput has an optional protocolVersion field that the
consumer sends in-band. buildRunAgentInputBody now sets it to
PROTOCOL_VERSION ("1.0") for every connection adapter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01825k3Ap3Aa2ZVUkHA9d7iV
🦋 Changeset detectedLatest commit: 7f1830e The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and verify protocol version in client requests packages/ai-client/src/connection-adapters.ts, packages/ai-client/tests/connection-adapters.test.ts, testing/e2e/tests/ag-ui-compliance.spec.ts, packages/ai/src/client.ts, .changeset/run-input-protocol-version.md |
The connection adapter adds protocolVersion: PROTOCOL_VERSION to generated request bodies. Adapter and compliance tests check for '1.0'. The client entry point re-exports PROTOCOL_VERSION, and the changeset declares patch releases for both packages. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Feature
Possibly related PRs
- TanStack/ai#1894: Adds a pi bridge that parses TanStack AG-UI request bodies, which now include
protocolVersion. - TanStack/ai#1893: Adds
fromChatTransport, which uses the connection adapters that now includeprotocolVersionin request bodies.
Suggested reviewers: alemtuzlak
Merge Risk: 
Minimal · up to 7f183
-
No concrete merge-blocking defect is established by this change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description covers the required Changes, Checklist, and Release Impact sections. It also documents implementation details, testing, risk, rollback, and the changeset. The unfinished Public API change example is non-critical.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01825k3Ap3Aa2ZVUkHA9d7iV
|
Thanks for the PR, @kbuschgens! 🙌 @jherr will take a look. Automated pre-review checks
Automated triage — a human review follows. |
The chat client now sends
protocolVersion: "1.0"in every AG-UIRunAgentInputPOST body. AG-UI 1.0 (@ag-ui/core1.0.0) defines this optional field for the consumer's version. The spec says to send it in-band, so a recorded exchange describes itself. Before this PR,buildRunAgentInputBodydid not set it.🎯 Changes
buildRunAgentInputBodyin@tanstack/ai-clientsetsprotocolVersion: PROTOCOL_VERSION. All connection adapters use this function, so all of them send the field.@tanstack/ai/clientre-exportsPROTOCOL_VERSIONfrom@ag-ui/core, next toEventType.@tanstack/ai-clientgets the value from there.@tanstack/aiand@tanstack/ai-client).✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.docs/for this change, or this change is not user-facing.pnpm changeset), or this PR does not change a published package.🚀 Release Impact
Testing
Commands run.
test:prtarget set (nx affectedwith sherif, knip, docs, kiira, oxlint, lib, types, test:build, build): all 441 targets passed across 110 projects.@tanstack/ai-react:test:libtimed out once under parallel load and passed on rerun; Nx marks it flaky, and it does not touch this change.testing/e2e/tests/ag-ui-compliance.spec.tsfails without the fix (Received: undefined) and passes with it.ag-ui-compliance,ag-ui-foreign-client,ag-ui-old-client-rejection, andchatE2E specs: 19 passed.Manual test.
pnpm --filter @tanstack/ai-e2e test:e2e -- tests/ag-ui-compliance.spec.ts."protocolVersion": "1.0".How this PR makes testing easy. A unit test in
packages/ai-client/tests/connection-adapters.test.tsand an E2E assertion intesting/e2e/tests/ag-ui-compliance.spec.tsboth check the field in the request body.Risk / rollback
Low risk. The field is optional in the AG-UI schema, so servers that follow the spec accept it. A server with a strict schema that rejects unknown keys can reject the request. To undo, revert this PR.
Public API change
Before