Conversation
- Limit findApprovalContext to a single page of 100 messages instead of a paginated do/while loop. - Remove console.error in abort cleanup — best-effort with timeout fallback. - Add comment clarifying abort vs finish flow in consumeStream. - Remove redundant aborted check before #sendDelta in finish(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR updates the package version to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
commit: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/client/index.ts (1)
1133-1181: Consider removing unnecessary block braces.The
{ ... }block wrapping the for loop (lines 1133 and 1181) appears to be leftover structure from the removed do/while pagination loop. These braces no longer serve a purpose and add unnecessary nesting.♻️ Suggested cleanup
const page = await this.listMessages(ctx, { threadId: args.threadId, paginationOpts: { cursor: null, numItems: 100 }, }); - { - for (const message of page.page) { + for (const message of page.page) { const content = message.message?.content; if (!Array.isArray(content)) continue; // ... rest of loop body ... } - }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/client/index.ts` around lines 1133 - 1181, The extra block braces surrounding the for (const message of page.page) loop are leftover and unnecessary; remove the outer { ... } so the loop and its inner logic (references: existingResponseMessage, args.approvalId, typedPart, message._id) are directly in the parent scope, preserving all conditionals and returns unchanged and reformat the indentation accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/client/index.ts`:
- Around line 1133-1181: The extra block braces surrounding the for (const
message of page.page) loop are leftover and unnecessary; remove the outer { ...
} so the loop and its inner logic (references: existingResponseMessage,
args.approvalId, typedPart, message._id) are directly in the parent scope,
preserving all conditionals and returns unchanged and reformat the indentation
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5fbf9a09-e99f-4098-9a92-ec732a4edac2
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (4)
CHANGELOG.mdpackage.jsonsrc/client/index.tssrc/client/streaming.ts
Summary
findApprovalContextto a single page of 100 messages instead of paginated do/while loopconsole.errorin abort cleanup (best-effort with timeout fallback)consumeStream#sendDeltainfinish()0.6.0-beta.0Addresses review comments from #235 that landed after the merge.
Test plan
npm run buildpassesnpm test— 262 tests passnpm run lintclean🤖 Generated with Claude Code
Summary by CodeRabbit