Repository navigation
fix(resource): return from on_resource_added once the reason commit is queued - #6077
Conversation
There was a problem hiding this comment.
Thanks for the fix!
One small suggestion when you have time: since the reason commit now runs asynchronously, could memory_linking.status use accepted or queued, and could the docs mention polling commit_task_id for the final result? This would make it clear that the returned status confirms submission while memory extraction may still be pending or may later fail.
Also, add-resource --reason calls for the same user currently share one session. Isolating sessions by resource would let commits for different resources proceed independently and improve session.commit throughput.
Both points can be handled in a follow-up PR when convenient. I'll merge this PR shortly. Thanks for the contribution!
Withdrawing my previous change request. The remaining suggestions are optional follow-ups and do not block merging this PR.
fujiajie666
left a comment
There was a problem hiding this comment.
Two small suggestions that can be follow up on these later.
…ne#6153, upgrade notes for main 2026-10-16 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #6077 on_resource_added returns once the reason commit is queued, but memory_linking.status still said "success", which reads as a finished link. It now says "accepted" (the word connector submissions already use), and the API docs say to poll commit_task_id for the result. Follow-up to the #6077 review. Co-authored-by: mayunxiang.26 <mayunxiang.26@bytedance.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Description
on_resource_addedcommitted the reason into the shared session__openviking_resource_reason__and then waited (up to 30 min) for that commit task. Reason commits are processed in order on that one session, so everyadd_resourcewith a reason waited behind all earlier reason commits; one stalled commit blocked resource processing (about 12 h in our deployment). It now returns once the commit is queued, withcommit_task_id, like a normal async commit.Human Involvement
Related Issue
Fixes #6076
Type of Change
Changes Made
on_resource_added: no_wait_for_commit_task; the result dropscommit_task(its only caller stores the dict inresult["memory_linking"]). The deletion path still waits, since there the unlink must follow the memory update.test_on_resource_added_returns_once_reason_commit_is_queued(commit task whose wait never finishes).Testing
git diff --checkclean.Checklist
Additional Notes
No API or data-format change; no new dependency.
🤖 Generated with Claude Code