fix(scheduler,remote): post-cancel user turns + attachment sync reopen - #20
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(scheduler,remote): post-cancel user turns + attachment sync reopen#20cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…hment sync - Stamp cancel epoch on enqueue so user messages submitted after cancel_session_tasks are not skipped while the cancel drain flag lingers - Retry file_blob_write via open_workspace when worker session is not open after reconnect (Feishu attachment sync to remote inbox) - Add regression tests for both paths Co-authored-by: Yuxuan Liu <Osc-7@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes two critical correctness bugs found in recent scheduler/remote attachment changes.
Bug 1: Post-cancel user messages silently dropped
cancel_session_tasks, if the user immediately sent a new message while the cancel drain flag was still set, dispatch skipped it withCancelledError— the session appeared dead until the flag cleared._cancelled_sessionsmembership, with no distinction between pre-cancel queued turns and post-cancel new user submits.enqueue_cancel_epochon submit/inject; skip only when stamped epoch is older than current epoch (agent_wake/system inject semantics preserved).Bug 2: Feishu attachment sync fails after worker reconnect
file_blob_writereturnedSESSION_NOT_OPEN; attachments were not mirrored to.macchiato/inboxwhile the turn continued in remote mode.attachment_synccalledfile_blob_writedirectly without the reopen path used bybash_tool.open_workspaceon session-not-open errors.Validation
tests/test_kernel_runtime.py(cancel epoch + post-cancel user turn)tests/test_attachment_sync.py::test_sync_reopens_worker_session_on_not_open