-
Notifications
You must be signed in to change notification settings - Fork 81
Add auto-continuation for tool approval workflow #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sethconvex
wants to merge
22
commits into
main
Choose a base branch
from
01-24-add_auto-continuation_for_tool_approval_workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
946a489
Fix tool approval continuation streaming to separate message
sethconvex c3cddfd
Remove debug logging from approval example
sethconvex ddce09b
Add approveToolCall and denyToolCall helper methods to Agent
sethconvex 05a5f19
Remove noisy warning for paginated tool results
sethconvex 78dcc30
Add specific types for AI SDK v6 usage token details
sethconvex 3a29dd1
Enhance CLAUDE.md with comprehensive AI upgrade guidance
sethconvex 820fdea
Add compile-time errors for AI SDK v5 patterns
sethconvex cc2bdd8
Fix code review issues from CodeRabbit
sethconvex 9fc04f3
Include MIGRATION.md in npm package and update error references
sethconvex 74d91a6
Fix CI: update example tools to AI SDK v6 syntax and fix lint errors
sethconvex 65fe1c2
Add comprehensive tests for tool approval workflow
sethconvex 27fba6f
Add bug-finding tests for tool approval workflow
sethconvex 25b70cb
Fix TOCTOU race condition with atomic idempotency check
sethconvex c391865
Improve upgrade experience with better docs and tooling
sethconvex 70481a6
Upgrade convex to 1.31.6
sethconvex de5763d
Remove unused check-upgrade script
sethconvex 8383396
Simplify TOCTOU handling: just throw if already handled
sethconvex 353112f
Fix UI flashing during tool approval continuation
sethconvex 6506402
Refactor approval flow: save-only approve/deny, defer tool execution
sethconvex cac50e3
Fix race condition: Atomic stream finish with message save
sethconvex 06e5305
Optimize approval API: eliminate database lookup
sethconvex 9ae2e58
Optimize approval workflow with indexed fields (O(1) lookup)
sethconvex File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: get-convex/agent
Length of output: 92
🏁 Script executed:
Repository: get-convex/agent
Length of output: 87
🌐 Web query:
Convex ctx.db API changes version 1.31.0 table name parameter💡 Result:
In
convexnpm package v1.31.0, Convex changed severalctx.dbmethods so they accept the table name as the first argument (the old “infer table from the ID” form is still supported for now, but the table name is now recommended and is expected to be required for future features like custom/bring-your-own IDs). [1] [2]What changed (table name parameter added)
These methods now take
tableNamefirst:db.get,db.patch,db.replace,db.delete. [1]Old (still works for now):
await ctx.db.get(id)await ctx.db.patch(id, value)await ctx.db.replace(id, value)await ctx.db.delete(id)New (v1.31.0+):
await ctx.db.get("messages", id)await ctx.db.patch("messages", id, value)await ctx.db.replace("messages", id, value)await ctx.db.delete("messages", id)[1] [2]Migration help
@convex-dev/explicit-table-ids(autofix vianpx eslint . --fix) [1]npx@convex-dev/codemod@latest explicit-ids[1]🏁 Script executed:
Repository: get-convex/agent
Length of output: 13897
🏁 Script executed:
Repository: get-convex/agent
Length of output: 281
Version bump to
^1.31.2aligns with Convex's v1.31.0 API changes requiring table names as the first argument toctx.dbmethods.Since version 1.31.0,
ctx.db.get(),ctx.db.patch(),ctx.db.replace(), andctx.db.delete()accept the table name as the first argument. The old API (e.g.,ctx.db.get(id)) remains functional for now but will be required for custom ID generation in future versions.The codebase has 70+ instances of old-style calls throughout
src/component/that need migration to the new format (e.g.,ctx.db.get("tableName", id)). Consider using the automated migration tool:npx@convex-dev/codemod@latest explicit-idsor enable the ESLint rule@convex-dev/explicit-table-idswith--fix.🤖 Prompt for AI Agents