Threads 1: Define useThread package contracts - #234
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Sorry @FranciscoMoretti, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe PR establishes the ChangesThread package foundation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
🚥 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d36f512b52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5063777 to
532a106
Compare
532a106 to
c9ec33d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/thread/package.json (1)
43-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueInclude the
testdirectory in formatting and linting.The
testdirectory is referenced in thetestscript andtsconfig.json, but it is excluded from the Biome scripts. Adding it ensures consistent code quality across both source and test files.🛠️ Proposed fix
- "format": "bunx `@biomejs/biome`@2.4.10 check --write src *.md package.json tsconfig.json tsconfig.build.json biome.jsonc", - "lint": "bunx `@biomejs/biome`@2.4.10 check src ARCHITECTURE.md package.json tsconfig.json tsconfig.build.json biome.jsonc", + "format": "bunx `@biomejs/biome`@2.4.10 check --write src test *.md package.json tsconfig.json tsconfig.build.json biome.jsonc", + "lint": "bunx `@biomejs/biome`@2.4.10 check src test ARCHITECTURE.md package.json tsconfig.json tsconfig.build.json biome.jsonc",🤖 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 `@packages/thread/package.json` around lines 43 - 44, Update the format and lint scripts in package.json to include the test directory alongside src, so Biome checks and formats both production and test files consistently.
🤖 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 `@packages/thread/package.json`:
- Around line 23-31: Update the package exports and top-level types field in
package.json to reference the generated declaration files under dist rather than
src/index.ts. Keep the existing runtime conditions and default JavaScript export
unchanged, and align the types paths with the declarations emitted by
tsconfig.build.json.
---
Nitpick comments:
In `@packages/thread/package.json`:
- Around line 43-44: Update the format and lint scripts in package.json to
include the test directory alongside src, so Biome checks and formats both
production and test files consistently.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bb575fba-607c-4a5b-a717-38531b4b4ade
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
packages/thread/biome.jsoncpackages/thread/package.jsonpackages/thread/src/index.tspackages/thread/src/types.tspackages/thread/tsconfig.build.jsonpackages/thread/tsconfig.json
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2049304 to
e9ae97f
Compare

Summary
useChat.Behavior
Introduces types and package structure only; no orchestration yet.
Verification
bun test:typesat the stack tip.Review focus
Are the public contracts minimal and sufficient for later implementation commits?
Summary by cubic
Introduces
@chatjs/thread, a type-only package that defines public contracts for a threaded chat engine aligned withaiuseChat. No runtime code.New Features
MessageTreeSnapshot(cursorId, nodes[], version: 1) andThreadStateSnapshotwith maps, rootIds, messages, status, runs, activeRuns, and error.ThreadRun(id, status, error) andThreadRunHandle(id, finished, getSnapshot(), stop()).TreeSendOptionswithtree.fromandtree.follow;ThreadStartRunOptionswithmessageandrequest.ThreadConcurrencylimits;ThreadChatOptionsmirrorsuseChatplusconcurrencyand eitherinitialTreeormessages.Refactors
Written for commit e9ae97f. Summary will update on new commits.
Summary by CodeRabbit
New Features
@chatjs/threadnpm package for threaded chat experiences.Documentation
useThreadbehavioral contract covering cursor following, identity semantics, and how tree context interacts with the request lifecycle and concurrency.Chores
Stack