Skip to content

Post-merge review fixes for v0.6.0#236

Merged
sethconvex merged 2 commits intomainfrom
fix/post-merge-review
Mar 19, 2026
Merged

Post-merge review fixes for v0.6.0#236
sethconvex merged 2 commits intomainfrom
fix/post-merge-review

Conversation

@sethconvex
Copy link
Contributor

@sethconvex sethconvex commented Mar 19, 2026

Summary

  • Simplify findApprovalContext to a single page of 100 messages instead of 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()
  • Bump version to 0.6.0-beta.0

Addresses review comments from #235 that landed after the merge.

Test plan

  • npm run build passes
  • npm test — 262 tests pass
  • npm run lint clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Released 0.6.0-beta.0 pre-release.
    • Optimized approval request lookup to focus on recent thread messages.
    • Improved stream operation error handling and cleanup logic during abort scenarios.

sethconvex and others added 2 commits March 18, 2026 13:47
- 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>
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

This PR updates the package version to 0.6.0-beta.0, reformats the changelog for readability, simplifies the approval context lookup to perform a single message batch request instead of paginating, and refactors stream cleanup error handling to remove error logging while clarifying control flow comments.

Changes

Cohort / File(s) Summary
Version and Documentation
CHANGELOG.md, package.json
Updated version to 0.6.0-beta.0 and reformatted changelog entries with adjusted line wrapping and indentation; no content changes to version notes.
Client Message Pagination
src/client/index.ts
Simplified findApprovalContext to fetch only the last 100 messages in a single listMessages call, removing the pagination loop and MAX_MESSAGES_TO_SCAN counter; adjusted error message to reflect single-batch lookup.
Stream Cleanup and Control Flow
src/client/streaming.ts
Removed error logging from abort-signal cleanup, simplified finish logic to always call #sendDelta() internally, and clarified comments around stream cleanup sequencing and abort signal handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A pre-release hops into view,
Pagination loops bid adieu,
Cleaner streams flow without cry,
Errors logged now pass on by,
Beta bounces toward the sky! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes post-merge review fixes for v0.6.0, which accurately reflects the main intent of the PR. However, the changes span multiple unrelated areas (approval context logic, stream abort handling, version bump) rather than a single cohesive feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/post-merge-review
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/get-convex/agent/@convex-dev/agent@236

commit: ed955be

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 853a2b7 and ed955be.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • CHANGELOG.md
  • package.json
  • src/client/index.ts
  • src/client/streaming.ts

@sethconvex sethconvex merged commit 47e40ab into main Mar 19, 2026
3 checks passed
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.

1 participant