You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(create): preserve page context in events chat - #550
Preserve the current speaker and talk when Remy sends them through the AI client's forwardedProps. Keep legacy top-level values working, including mixed payloads where only one slug is nested.
AI review notes:
Each slug is resolved independently, with valid nested values taking priority. Non-string values are ignored, and thread validation stays intact.
Eight route regression cases pass. The previous revision fails the two new mixed-payload cases.
All 10 package builds, 541 unit tests and eight Chrome e2e tests passed through the normal commit hook.
A generated events app outside the monorepo passed production build and type checking with this asset overlaid. The actual published AI client transport was exercised against the route with provider calls stubbed and networking disabled.
No dependencies, workflows or CLI startup imports change. Includes a patch changeset for @tanstack/create.
Summary by CodeRabbit
Bug Fixes
The events example chat now retains speaker and talk-page context when generating responses, helping keep replies relevant to the page being viewed.
Existing chat payloads that provide context in the top-level fields remain supported, and forwarded context takes precedence when both formats are present.
Invalid or missing page context is ignored, and requests with an empty thread ID are rejected without starting a chat.
No actionable comments were generated in the recent review.
Walkthrough
The events chat route now reads speaker and talk context from forwarded properties when available, with a top-level request-body fallback. Added tests cover context selection and missing-thread responses.
Changes: Events chat context
Layer / File(s)
Summary
Select and validate chat context packages/create/src/frameworks/react/examples/events/assets/src/routes/api.remy-chat.ts, packages/create/tests/events-chat-context.test.ts, .changeset/events-forwarded-context.md
The route selects string context values from forwardedProps when they are present, otherwise from top-level string values. Tests cover precedence, fallback, absent or non-string values, and missing-thread responses. A patch changeset records the change.
TanStack/cli#446: This PR uses the same chat handler’s thread ID validation contract and tests the empty-thread response.
Merge Risk: Minimal · up to bb868
Context forwarding is covered without an identified current-head regression; the change is ready to merge.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
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. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: preserving page context in the events chat.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
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 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
packages/create/tests/events-chat-context.test.ts
Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/create/tests/events-chat-context.test.ts
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Apply the body fallback to each slug.
If forwardedProps contains speakerSlug but the request body contains talkSlug, this selection discards the top-level talkSlug. The session context then disappears from the prompt. Select each slug from forwardedProps when present, and otherwise select that slug from body. Add a mixed-payload test. (raw.githubusercontent.com)
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 26215607-cc17-4975-9aa4-e22411489c9a
Commits
Reviewing files that changed from the base of the PR and between 270f9b0 and ee1b20b.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Confirmed the mixed-payload gap. I’m keeping this as a draft until the corrected revision finishes its normal checks.
AI review notes:
The local revision falls back per slug, so a nested speaker and top-level talk, or the reverse, both retain context. The two new cases fail against the current PR head and pass with the revision.
All eight route cases and the generated app’s build/types passed. The unchanged full repository hook is still running; the corrected revision has not been pushed yet.
The mixed-payload case is fixed too, and this is ready for the normal checks.
AI review notes:
Revision bb8683f resolves each slug independently. Both mixed directions now have regression coverage, and both fail on the previous revision.
All 10 builds, 541 unit tests and eight Chrome e2e tests passed through the normal hook. The generated events app also passed production build and type checking with the corrected asset overlaid, offline with no provider calls.
The code has landed, but release verification isn’t complete yet.
AI review notes:
Version PR #551 merged at 58dc7ae. The normal publisher reported success, and six expected archives passed downloaded hash checks.
Fresh official metadata and the tarball URL still return 404 for @tanstack/create 0.71.14. The published CLI and aliases depend on that version, so fresh installation may fail until it is available. A fresh consumer has not been verified.
One retry of the unchanged normal release workflow is running: https://github.com/TanStack/cli/actions/runs/41673768768. Full archive, tag and public-consumer verification remains open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve the current speaker and talk when Remy sends them through the AI client's
forwardedProps. Keep legacy top-level values working, including mixed payloads where only one slug is nested.Summary by CodeRabbit