Repository navigation
docs(react-core): stop pointing v1 appendMessage at non-public sendMessage - #6940
Conversation
…ssage The v1 `useCopilotChat` JSDoc told readers to use `sendMessage` instead of `appendMessage`, but `UseCopilotChatReturn` omits `sendMessage` from the public return type, so following that advice does not compile. Point at the v2 migration path instead, and state that `appendMessage` is the public v1 programmatic-send path. Reported via #4215. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe deprecated ChangesDeprecated v1 chat API documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This updates deprecated v1 chat API guidance to direct users to the public appendMessage method and the v2 migration path. It does not change runtime behavior or types, and no current merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Size Change: 0 B Total Size: 1.65 MB ℹ️ View Unchanged
|
@copilotkit/a2ui-renderer
@copilotkit/agentcore-runner
@copilotkit/angular
@copilotkit/channels
@copilotkit/channels-core
@copilotkit/channels-discord
@copilotkit/channels-intelligence
@copilotkit/channels-slack
@copilotkit/channels-teams
@copilotkit/channels-telegram
@copilotkit/channels-ui
@copilotkit/channels-whatsapp
@copilotkit/core
@copilotkit/react-core
@copilotkit/react-native
@copilotkit/react-textarea
@copilotkit/react-ui
@copilotkit/runtime
@copilotkit/runtime-client-gql
@copilotkit/sdk-js
@copilotkit/shared
@copilotkit/sqlite-runner
@copilotkit/voice
@copilotkit/vue
@copilotkit/web-components
@copilotkit/web-inspector
commit: |
Summary
The v1
useCopilotChatJSDoc tells readers to usesendMessageinstead ofappendMessage.sendMessageis not part of the public v1 return type, so following that advice does not compile.packages/react-core/src/v1-deprecated/hooks/use-copilot-chat.ts:109explicitly omits it:sendMessageexists only onuseCopilotChatInternal. The public hook returnsappendMessage, which is the working v1 programmatic-send path.This replaces the misdirection with the v2 migration pointer and states plainly what
appendMessageis for. Comment-only change — no runtime effect.Found while closing #4215, where a user was told by our own docs to call a method we do not export.
The published page does not change yet
This fixes the source of truth. The generated page cannot be refreshed until #6939 is resolved: running the generator today would also embed the internal v1 deprecation banner ("AI CODING AGENTS: Never copy, suggest, or generate these v1 APIs") into 20 public reference pages. I deliberately excluded the regenerated
.mdxfiles from this PR rather than ship that. Once #6939 lands, a regenerate publishes this wording.Testing
1.
oxfmt --check— pass2. Generator reads this file successfully (26/26) — confirms the JSDoc edit is picked up, and that the only thing blocking publication is #6939, not this change:
The regenerated page contained the new wording as expected; I then reverted the generated files per the section above.
3. Diff is a single comment hunk — verified with
git diff --stat:1 file changed, 4 insertions(+), 1 deletion(-), all inside a JSDoc block. No exported symbol, type, or runtime line touched, so no typecheck or test surface is affected.4. Claim verified against
origin/main, not a local branch:git show origin/main:packages/react-core/src/v1-deprecated/hooks/use-copilot-chat.tsconfirms both the misdirecting line (:70) and theOmit(:109-121).Notes
ben1/oss-docs-generator-v1-paths); the change is the wording fix only.packages/react-core/src/hooks/. If that stack lands, this one-line change needs carrying forward into the reapply.Summary by CodeRabbit
appendMessageoption inuseCopilotChat.