Skip to content

ci: type-check examples/** and testing/** to catch call-site regressions (#820)#857

Open
tombeckenham wants to merge 2 commits into
mainfrom
820-ci-type-check-is-excluded-from-examples-and-testing-call-site-type-regressions-slip-through-testpr
Open

ci: type-check examples/** and testing/** to catch call-site regressions (#820)#857
tombeckenham wants to merge 2 commits into
mainfrom
820-ci-type-check-is-excluded-from-examples-and-testing-call-site-type-regressions-slip-through-testpr

Conversation

@tombeckenham

@tombeckenham tombeckenham commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #820.

test:pr/test:ci excluded examples/** and testing/** from every target, so test:types never type-checked the apps where the library is actually consumed. Call-site type regressions — like a provider summarize adapter not being assignable to summarize()'s adapter param — slipped through CI. Because those surfaces were never type-checked, they had also accumulated ~80 latent type errors, all fixed here.

CI wiring

Coverage

  • Added a test:types target to every example/testing project that lacked one (testing/e2e, testing/panel, ts-react-native-chat, react-native-smoke).
  • ts-angular-chat type-checks templates via ngc, resolved from the existing @angular/build peer — no new dependency, no lockfile change (a node scripts/typecheck.mjs wrapper).

Fixes (examples/testing drift from the current API — nothing under packages/**)

  • ts-react-chat / ts-solid-chat / ts-code-mode-webMediaPrompt, maxTokensmodelOptions, ContentPart[] narrowing, the chat transport XOR.
  • testing/e2e — removed poisoning as never model casts, fixed adapter/tool typings, OpenRouter summarize header injection via httpClient.
  • testing/panelAnyAdapter factory maps, AG-UI EventType migration, removed dead app.config.ts (Vinxi-era config; the app runs on vite.config.ts), and rewrote createEventRecording to reconstruct AG-UI StreamChunks (with START/END boundaries) instead of the obsolete flat chunk shape.

In-package guard (acceptance criterion 2)

packages/ai-grok/tests/summarize-callsite-type-safety.test.ts asserts the grokSummarize → summarize() contract in an included package, so the per-provider adapter→activity contract is exercised by CI without depending on the (excluded) example apps. It uses @ts-expect-error to track the known Grok options-shape bug (#821); delete the directives to flip it to a positive regression guard once #835 lands.

Test plan

  • pnpm test:pr — green end-to-end (RN smoke + affected package gate for 36 projects + test:types for all 14 example/testing projects).
  • Each fixed project verified individually green via its test:types / ngc.

Notes / follow-ups (out of scope, pre-existing)

  • Lockfile: root pnpm-lock.yaml pins the now-yanked rolldown@1.1.2 (via ts-react-searchnitro). It breaks any install that re-resolves the workspace; frozen CI install still works. Worth a separate fix (bump nitro or a pnpm.overrides pin).
  • model-meta: gpt-5.5/gpt-5.5-pro are missing from OpenAIChatModelToolCapabilitiesByName, so provider tools can't be typed with those models.
  • The rewritten createEventRecording type-checks and emits a structurally-correct AG-UI sequence, but hasn't been replayed through the stream-debugger live.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added/expanded TypeScript type-check scripts across examples and testing projects, including Angular template-aware type checking.
    • Updated token limiting to use model-specific token options for chat requests.
    • Improved media generation by resolving user image/video prompts before sending requests.
    • Enhanced the testing panel trace/stream debugger with a newer event format.
  • Bug Fixes

    • Normalized tool-result content for more consistent display across chat demos and routes.
  • Documentation

    • Updated CI/PR verification guidance to reflect the expanded test:pr/test:ci coverage and refreshed recording instructions.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 82594ea9-361e-4ef7-a0a8-f0d2269e97d3

📥 Commits

Reviewing files that changed from the base of the PR and between f7780e5 and ce8eb7a.

📒 Files selected for processing (2)
  • CLAUDE.md
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • CLAUDE.md

📝 Walkthrough

Walkthrough

The PR broadens typecheck coverage into example and testing surfaces, updates example routes to normalize tool-result content and media prompts, and revises testing-panel/e2e routes and trace recording to use AG-UI-style stream chunks and direct adapters.

Changes

Typecheck coverage

Layer / File(s) Summary
Typecheck entrypoints
CLAUDE.md, package.json, examples/ts-angular-chat/..., examples/ts-react-native-chat/..., testing/e2e/package.json, testing/panel/package.json, testing/react-native-smoke/package.json
The root scripts and guidance now include example and testing typecheck coverage, and the affected packages add local test:types entrypoints.
Type guards and example typings
packages/ai-grok/tests/summarize-callsite-type-safety.test.ts, examples/ts-angular-chat/src/app.component.ts, examples/ts-react-chat/src/routes/index.tsx, examples/ts-react-chat/src/routes/generations.structured-output.tsx, examples/ts-solid-chat/src/routes/index.tsx
A compile-time summarize call-site check is added, and example chat typings are adjusted to match the updated hook and message shapes.

Example content normalization

Layer / File(s) Summary
Tool-result stringification
examples/ts-code-mode-web/src/lib/tool-result-content.ts, examples/ts-code-mode-web/src/routes/_banking-demo/..., examples/ts-code-mode-web/src/routes/_database-demo/..., examples/ts-code-mode-web/src/routes/_home/..., examples/ts-code-mode-web/src/routes/_npm-github-chat/..., examples/ts-code-mode-web/src/routes/_reporting/...
A shared helper converts tool-result content to strings, and code-mode-web routes store the normalized value in their per-tool-call maps.
Token-budget option wiring
examples/ts-code-mode-web/src/routes/_database-demo/api.database-demo.ts, examples/ts-code-mode-web/src/routes/_home/api.product-regular.ts, examples/ts-code-mode-web/src/routes/_npm-github-chat/api.codemode.ts, examples/ts-code-mode-web/src/routes/_reporting/api.reports.ts
The code-mode-web chat routes replace maxTokens with modelOptions: maxTokensModelOptions(..., 8192).
Media prompt resolution
examples/ts-react-chat/src/routes/generations.image.tsx, examples/ts-react-chat/src/routes/generations.video.tsx
React chat image and video routes resolve prompt text before sending direct and server-fn generation requests.

Panel recording and adapters

Layer / File(s) Summary
Trace chunks and replay
testing/panel/src/lib/recording.ts, testing/panel/src/routes/stream-debugger.tsx, testing/panel/README.md, testing/panel/src/components/Header.tsx
The recorder emits AG-UI chunk events, the stream debugger reads the new trace shape and event names, and the docs and link state point to the trace-based flow.
Direct adapter routes
testing/panel/src/routes/api.image.ts, testing/panel/src/routes/api.simulator-chat.ts, testing/panel/src/routes/api.structured.ts, testing/panel/src/routes/api.summarize.ts, testing/panel/src/routes/api.transcription.ts, testing/panel/src/routes/api.video.ts
The panel image, simulator, structured, summarize, transcription, and video routes now pass adapters directly or emit the new event stream shapes.
Panel tests
testing/panel/tests/basic-inference.spec.ts, testing/panel/tests/helpers.ts
Panel tests derive inference-capable providers from PROVIDERS and simplify the response wait helper imports and locators.

E2E adapter wiring

Layer / File(s) Summary
OpenRouter request headers
testing/e2e/src/routes/api.summarize.ts, testing/e2e/src/routes/api.arktype-tool-wire.ts, testing/e2e/src/routes/api.openrouter-cost.ts, testing/e2e/src/routes/api.openrouter-web-tools-wire.ts, testing/e2e/src/routes/api.otel-usage.ts
OpenRouter summarize wiring injects test headers through an HTTPClient hook, and related routes remove as never model casts.
Fixture typing and provider links
testing/e2e/src/routes/$provider/index.tsx, testing/e2e/src/routes/api.openai-shell-skills-wire.ts, testing/e2e/src/routes/api.tool-call-lifecycle-wire.ts, testing/e2e/src/routes/tools-test.tsx
Feature links add a persistence search field, the OpenAI shell-skills wire uses gpt-5.2, the server tool adapter adds structuredOutput, and the tools test casts fixture messages to UIMessage<typeof clientTools>.

Sequence Diagram(s)

sequenceDiagram
  participant apiChat as api.chat route
  participant Recording as createEventRecording
  participant ChunkFile as ChunkRecording file
  participant Debugger as stream-debugger
  participant Processor as StreamProcessor
  apiChat->>Recording: wrapAdapterForRecording(traceId)
  Recording->>ChunkFile: write AG-UI StreamChunk events
  Debugger->>ChunkFile: load trace data
  Debugger->>Processor: createProcessor() or reuse existing processor
  Processor-->>Debugger: stepForward updates result state
Loading

Estimated code review effort: 5 (Critical) | ~90+ minutes

Possibly related PRs

  • TanStack/ai#572: Also changes the monorepo test:pr/test:ci scope around examples/** and testing/**.
  • TanStack/ai#783: Also normalizes tool-result content into plain strings before downstream rendering.
  • TanStack/ai#854: Also targets Grok summarize call-site type safety and the surrounding adapter typing.

Suggested reviewers: schiller-manuel, AlemTuzlak

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is detailed, but it doesn't follow the required template sections for Changes, Checklist, and Release Impact. Reformat it to the repository template and add the missing checklist and release-impact sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: extending CI type-checking to examples and testing to catch call-site regressions.
Linked Issues check ✅ Passed The changes add type-check coverage for examples/testing, fix the call-site regressions, and add an included-package guard for #820.
Out of Scope Changes check ✅ Passed The diff stays focused on CI type-check coverage and related type fixes; no clearly unrelated changes stand out.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 820-ci-type-check-is-excluded-from-examples-and-testing-call-site-type-regressions-slip-through-testpr

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@nx-cloud

nx-cloud Bot commented Jun 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ce8eb7a

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 2m 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-06 21:28:24 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@857

@tanstack/ai-acp

npm i https://pkg.pr.new/@tanstack/ai-acp@857

@tanstack/ai-angular

npm i https://pkg.pr.new/@tanstack/ai-angular@857

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@857

@tanstack/ai-bedrock

npm i https://pkg.pr.new/@tanstack/ai-bedrock@857

@tanstack/ai-claude-code

npm i https://pkg.pr.new/@tanstack/ai-claude-code@857

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@857

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@857

@tanstack/ai-code-mode-skills

npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@857

@tanstack/ai-codex

npm i https://pkg.pr.new/@tanstack/ai-codex@857

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@857

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@857

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@857

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@857

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@857

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@857

@tanstack/ai-grok-build

npm i https://pkg.pr.new/@tanstack/ai-grok-build@857

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@857

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@857

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@857

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@857

@tanstack/ai-mcp

npm i https://pkg.pr.new/@tanstack/ai-mcp@857

@tanstack/ai-mistral

npm i https://pkg.pr.new/@tanstack/ai-mistral@857

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@857

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@857

@tanstack/ai-opencode

npm i https://pkg.pr.new/@tanstack/ai-opencode@857

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@857

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@857

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@857

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@857

@tanstack/ai-sandbox

npm i https://pkg.pr.new/@tanstack/ai-sandbox@857

@tanstack/ai-sandbox-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@857

@tanstack/ai-sandbox-daytona

npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@857

@tanstack/ai-sandbox-docker

npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@857

@tanstack/ai-sandbox-local-process

npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@857

@tanstack/ai-sandbox-sprites

npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@857

@tanstack/ai-sandbox-vercel

npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@857

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@857

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@857

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@857

@tanstack/ai-utils

npm i https://pkg.pr.new/@tanstack/ai-utils@857

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@857

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@857

@tanstack/openai-base

npm i https://pkg.pr.new/@tanstack/openai-base@857

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@857

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@857

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@857

commit: ce8eb7a

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
testing/e2e/src/routes/$provider/index.tsx (1)

27-31: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the active persistence query instead of clearing it.

Line 31 always resets persistence to undefined, so navigation from /$provider/?persistence=localStorage drops the mode before /$provider/$feature can consume it. The downstream route already reads search.persistence, so this should be forwarded from the current page instead of hard-coded away.

Proposed fix
 function ProviderPage() {
   const { provider } = Route.useParams() as { provider: Provider }
+  const { persistence } = Route.useSearch()
   const features = getSupportedFeatures(provider)
@@
             search={{
               testId: undefined,
               aimockPort: undefined,
               mode: undefined,
-              persistence: undefined,
+              persistence,
             }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@testing/e2e/src/routes/`$provider/index.tsx around lines 27 - 31, The
navigation in the $provider route is clearing the active persistence query,
which prevents downstream routes from reading it. Update the search object in
the index route component to forward the current search.persistence value
instead of hard-coding persistence to undefined, so the $feature route can
consume it correctly. Use the existing route search handling in the
$provider/index.tsx component as the place to preserve this query.
🧹 Nitpick comments (4)
testing/panel/src/routes/api.simulator-chat.ts (1)

130-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an interface for the chatStream options shape.

The new inline object type should be promoted to an interface to match the repository TypeScript guideline.

Proposed refactor
+interface SimulatorChatStreamOptions {
+  messages: Array<ModelMessage>
+}
+
 function createSimulatorAdapter() {
@@
-    async *chatStream(options: {
-      messages: Array<ModelMessage>
-    }): AsyncIterable<StreamChunk> {
+    async *chatStream(
+      options: SimulatorChatStreamOptions,
+    ): AsyncIterable<StreamChunk> {

As per coding guidelines, **/*.{ts,tsx} should use interface for defining object shapes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@testing/panel/src/routes/api.simulator-chat.ts` around lines 130 - 132, The
chatStream method currently defines its options shape inline, which violates the
TypeScript guideline to use interfaces for object types. Move the { messages:
Array<ModelMessage> } parameter shape into a named interface near chatStream,
then update the chatStream signature to use that interface so the options type
is reusable and consistent with the repository style.

Source: Coding guidelines

examples/ts-react-native-chat/package.json (1)

20-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Alias test:types to typecheck instead of duplicating the command.

These two scripts are now the same command. Pointing test:types at typecheck keeps CI and local typecheck behavior from drifting the next time flags change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/ts-react-native-chat/package.json` around lines 20 - 21, The package
scripts duplicate the same TypeScript command for type checking, so update the
package.json scripts to make test:types reference typecheck instead of repeating
tsc --noEmit; keep the change within the scripts section and use the existing
typecheck entry as the single source of truth.
testing/react-native-smoke/package.json (1)

16-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse the existing typecheck script here too.

test:types and typecheck currently duplicate the same tsc --noEmit invocation. Making one call the other avoids silent drift between the smoke flow and the CI gate.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@testing/react-native-smoke/package.json` around lines 16 - 17, The package
scripts for type checking are duplicated, so update the react-native-smoke
package.json scripts to reuse the existing typecheck command from test:types
instead of repeating the same tsc --noEmit invocation. Keep typecheck as the
single source of truth and make test:types delegate to it so both paths stay
aligned if the command ever changes.
examples/ts-angular-chat/src/app.component.ts (1)

189-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract this inline message shape into an interface.

The unknown broadening makes sense, but the changed code still defines the object shape inline. Pulling it into an interface keeps this aligned with the repo’s TS conventions and makes the render contract easier to reuse.

As per coding guidelines, **/*.{ts,tsx}: Use interface for defining object shapes in TypeScript.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/ts-angular-chat/src/app.component.ts` around lines 189 - 190, The
message shape in isRenderable is still defined inline and should be extracted
into a reusable TypeScript interface to match repo conventions. Create an
interface for the message/parts contract used by AppComponent and update
isRenderable to reference it instead of an inline object type, keeping the
existing unknown broadened content field.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Around line 233-242: The “second pass” description in CLAUDE.md does not match
the actual script wiring: the examples/testing typecheck is run via pnpm
test:types:examples (backed by nx run-many), not nx affected. Update the
paragraph near the documented CI command sequence to reference the real command
path, using either pnpm test:types:examples or the exact nx run-many
--targets=test:types --projects=examples/**,testing/** invocation, so
contributors can reproduce CI accurately.

In `@testing/e2e/src/routes/api.summarize.ts`:
- Around line 33-46: The current OpenRouter setup uses a non-existent
`createOpenRouterSummarize`/`httpClient` pattern and an `HTTPClient.addHook` API
that the SDK does not support. Replace the `openRouterHttpClient` helper and the
`httpClient` option with the SDK’s supported `hooks.beforeRequest` configuration
on the OpenRouter client or adapter factory (for example, the same
request-header mutation logic applied directly in the client config). Make sure
the updated implementation uses the existing OpenRouter client symbols in this
route module so the request headers are injected through the supported hook path
and the code compiles against `@openrouter/sdk`.

In `@testing/e2e/src/routes/api.tool-call-lifecycle-wire.ts`:
- Line 124: The structuredOutput implementation does not match the
AnyTextAdapter contract: update the adapter method to accept the required
StructuredOutputOptions argument and return the expected shape used by
adapter.structuredOutput, including the raw field instead of rawText. Locate the
fix in structuredOutput and align both the signature and returned object with
the contract defined in the adapter interface.

In `@testing/e2e/src/routes/tools-test.tsx`:
- Line 4: The import order in tools-test.tsx violates ESLint import/order
because the UIMessage type import is placed before the zod import. Reorder the
imports so the `@tanstack/ai-react` type import comes after the zod import,
keeping the existing import grouping consistent and satisfying the lint rule.

In `@testing/panel/README.md`:
- Around line 39-45: The Trace Format example is stale and still shows the old
chunk shape, while the current captured-data flow uses AG-UI EventType values.
Update the README example near the Trace Format section to reflect the new
recorded chunk structure used by the panel, replacing the pre-AG-UI `"chunk": {
"type": "content", ... }` shape with examples that match the actual
EventType-based records such as TEXT_MESSAGE_CONTENT, and keep the surrounding
description consistent with the updated flow.

In `@testing/panel/src/lib/recording.ts`:
- Around line 362-382: The tool-call reconstruction in recording.ts is emitting
TOOL_CALL_ARGS incorrectly by using the full argument snapshot as delta and
never closing the call with TOOL_CALL_END. Update the logic around the
TOOL_CALL_START / toolCallArgs emission so toolCallArgs gets only the
incremental arguments change (or an empty delta when rebuilding from a
snapshot), then emit a TOOL_CALL_END chunk immediately after the arguments for
each tool call. Use the existing stream.startedToolCalls tracking and the
toolCallStart, toolCallArgs, and pushChunk helpers to keep the recorded trace
aligned with StreamProcessor and adapter traces.

---

Outside diff comments:
In `@testing/e2e/src/routes/`$provider/index.tsx:
- Around line 27-31: The navigation in the $provider route is clearing the
active persistence query, which prevents downstream routes from reading it.
Update the search object in the index route component to forward the current
search.persistence value instead of hard-coding persistence to undefined, so the
$feature route can consume it correctly. Use the existing route search handling
in the $provider/index.tsx component as the place to preserve this query.

---

Nitpick comments:
In `@examples/ts-angular-chat/src/app.component.ts`:
- Around line 189-190: The message shape in isRenderable is still defined inline
and should be extracted into a reusable TypeScript interface to match repo
conventions. Create an interface for the message/parts contract used by
AppComponent and update isRenderable to reference it instead of an inline object
type, keeping the existing unknown broadened content field.

In `@examples/ts-react-native-chat/package.json`:
- Around line 20-21: The package scripts duplicate the same TypeScript command
for type checking, so update the package.json scripts to make test:types
reference typecheck instead of repeating tsc --noEmit; keep the change within
the scripts section and use the existing typecheck entry as the single source of
truth.

In `@testing/panel/src/routes/api.simulator-chat.ts`:
- Around line 130-132: The chatStream method currently defines its options shape
inline, which violates the TypeScript guideline to use interfaces for object
types. Move the { messages: Array<ModelMessage> } parameter shape into a named
interface near chatStream, then update the chatStream signature to use that
interface so the options type is reusable and consistent with the repository
style.

In `@testing/react-native-smoke/package.json`:
- Around line 16-17: The package scripts for type checking are duplicated, so
update the react-native-smoke package.json scripts to reuse the existing
typecheck command from test:types instead of repeating the same tsc --noEmit
invocation. Keep typecheck as the single source of truth and make test:types
delegate to it so both paths stay aligned if the command ever changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9f09057-1092-4975-b927-dd018d073df9

📥 Commits

Reviewing files that changed from the base of the PR and between c22c663 and 8c173ca.

📒 Files selected for processing (47)
  • CLAUDE.md
  • examples/ts-angular-chat/package.json
  • examples/ts-angular-chat/scripts/typecheck.mjs
  • examples/ts-angular-chat/src/app.component.ts
  • examples/ts-code-mode-web/src/lib/tool-result-content.ts
  • examples/ts-code-mode-web/src/routes/_banking-demo/banking-demo.tsx
  • examples/ts-code-mode-web/src/routes/_database-demo/api.database-demo.ts
  • examples/ts-code-mode-web/src/routes/_database-demo/database-demo.tsx
  • examples/ts-code-mode-web/src/routes/_home/api.product-regular.ts
  • examples/ts-code-mode-web/src/routes/_home/index.tsx
  • examples/ts-code-mode-web/src/routes/_npm-github-chat/api.codemode.ts
  • examples/ts-code-mode-web/src/routes/_npm-github-chat/npm-github-chat.tsx
  • examples/ts-code-mode-web/src/routes/_reporting/api.reports.ts
  • examples/ts-code-mode-web/src/routes/_reporting/reporting-agent.tsx
  • examples/ts-react-chat/src/routes/generations.image.tsx
  • examples/ts-react-chat/src/routes/generations.structured-output.tsx
  • examples/ts-react-chat/src/routes/generations.video.tsx
  • examples/ts-react-native-chat/package.json
  • examples/ts-react-native-chat/tsconfig.json
  • examples/ts-solid-chat/src/routes/index.tsx
  • package.json
  • packages/ai-grok/tests/summarize-callsite-type-safety.test.ts
  • testing/e2e/package.json
  • testing/e2e/src/routes/$provider/index.tsx
  • testing/e2e/src/routes/api.arktype-tool-wire.ts
  • testing/e2e/src/routes/api.openai-shell-skills-wire.ts
  • testing/e2e/src/routes/api.openrouter-cost.ts
  • testing/e2e/src/routes/api.openrouter-web-tools-wire.ts
  • testing/e2e/src/routes/api.otel-usage.ts
  • testing/e2e/src/routes/api.summarize.ts
  • testing/e2e/src/routes/api.tool-call-lifecycle-wire.ts
  • testing/e2e/src/routes/tools-test.tsx
  • testing/panel/README.md
  • testing/panel/app.config.ts
  • testing/panel/package.json
  • testing/panel/src/components/Header.tsx
  • testing/panel/src/lib/recording.ts
  • testing/panel/src/routes/api.image.ts
  • testing/panel/src/routes/api.simulator-chat.ts
  • testing/panel/src/routes/api.structured.ts
  • testing/panel/src/routes/api.summarize.ts
  • testing/panel/src/routes/api.transcription.ts
  • testing/panel/src/routes/api.video.ts
  • testing/panel/src/routes/stream-debugger.tsx
  • testing/panel/tests/basic-inference.spec.ts
  • testing/panel/tests/helpers.ts
  • testing/react-native-smoke/package.json
💤 Files with no reviewable changes (2)
  • testing/panel/app.config.ts
  • examples/ts-react-chat/src/routes/generations.structured-output.tsx

Comment thread CLAUDE.md Outdated
Comment thread testing/e2e/src/routes/api.summarize.ts
Comment thread testing/e2e/src/routes/api.tool-call-lifecycle-wire.ts
Comment thread testing/e2e/src/routes/tools-test.tsx
Comment thread testing/panel/README.md
Comment thread testing/panel/src/lib/recording.ts
@tombeckenham tombeckenham force-pushed the 820-ci-type-check-is-excluded-from-examples-and-testing-call-site-type-regressions-slip-through-testpr branch from 8c173ca to f0bde42 Compare June 26, 2026 09:27
…ons (#820)

`test:pr`/`test:ci` excluded examples/** and testing/** from every target, so
`test:types` never checked the apps where the library is actually consumed —
call-site type regressions (e.g. a provider summarize adapter not assignable to
`summarize()`) slipped through CI. Because those surfaces were never type-checked,
they had also accumulated ~80 latent type errors.

CI wiring:
- test:pr / test:ci now run a second pass — `test:types` over examples/** and
  testing/** — after the existing packages-only run. Heavy targets (build/lib/...)
  stay excluded; only the cheap, high-value type check is added.
- Add `test:types:examples` convenience script and document the gate in CLAUDE.md.

Coverage:
- Add a `test:types` target to every example/testing project that lacked one
  (e2e, panel, react-native-chat, react-native-smoke). ts-angular-chat type-checks
  templates via `ngc`, resolved from an existing @angular/build peer (no new dep,
  no lockfile change).

Fixes (examples/testing drift from the current API; nothing under packages/**):
- ts-react-chat, ts-solid-chat, ts-code-mode-web: MediaPrompt, maxTokens→modelOptions,
  ContentPart[] narrowing, transport XOR, onResult result-type inference (#848).
- testing/e2e: drop poisoning `as never` model casts, fix adapter/tool typings,
  OpenRouter summarize httpClient header injection.
- testing/panel: AnyAdapter factory maps, AG-UI EventType migration, remove dead
  app.config.ts (Vinxi-era), rewrite createEventRecording to emit AG-UI StreamChunks.

Guard:
- packages/ai-grok/tests/summarize-callsite-type-safety.test.ts asserts the
  grokSummarize → summarize() contract in an included package — a positive
  assertion now that the options-shape fix (#854) has landed, so a regression
  surfaces as a real type error instead of silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tombeckenham tombeckenham force-pushed the 820-ci-type-check-is-excluded-from-examples-and-testing-call-site-type-regressions-slip-through-testpr branch from f0bde42 to f7780e5 Compare July 2, 2026 09:57
Comment thread package.json Outdated
Per review feedback, drop the --exclude=examples/**,testing/** carve-out and
the separate test:types:examples pass; include the example/testing projects
directly in the main affected/run-many invocation. Nx runs whatever of the
target set each project defines (in practice build + test:types), so call-site
type regressions in examples/testing are caught without a bolted-on command.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

ci: type-check is excluded from examples/** and testing/** — call-site type regressions slip through test:pr

2 participants