fix(session): clear bg jobs/wakes on delete; persist remote binding in checkpoint - #26
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(session): clear bg jobs/wakes on delete; persist remote binding in checkpoint#26cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…n checkpoint - delete_session/expire_session now drop bash-job tracking and agent wakes so completed jobs or scheduled wakes cannot inject into removed sessions - persist active remote workspace state in CoreCheckpoint and rehydrate on restore_from_checkpoint so daemon restart does not silently fall back to local bash/file execution while history still shows remote mode 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.
Bugs fixed
1. Ghost injects after session delete/expire
Impact: Deleting or expiring a session left bash-job tracking and agent-wake registries in memory. When a background job finished or a wake fired,
inject_turncould resurrect a removed session and push unsolicited turns.Root cause:
delete_session/expire_sessionevicted the core and registry but never clearedbash_job_notifyoragent_wakeper-session state.Fix:
_dispose_session_scheduled_work()clears job tracking and cancels pending wakes before evict.2. Remote workspace lost on daemon restart
Impact: After
/remote-use, a daemon restart dropped in-memory remote binding while chat history still indicated remote mode. Subsequent bash/file tools silently executed on the daemon host.Root cause:
RemoteWorkspaceStatelived only in process memory; checkpoints did not persist it.Fix: Persist
remote_workspaceinCoreCheckpointand rehydrate viarestore_remote_workspace_from_checkpoint()duringrestore_from_checkpoint().Validation
tests/test_bash_job_notify.py::test_clear_session_job_tracking_drops_tracked_and_pendingtests/test_agent_wake.py::test_clear_session_agent_wakes_removes_scheduled_and_pendingtests/test_automation_core_gateway.py::test_gateway_delete_session_clears_background_trackingtests/test_remote_workspace.py::test_remote_workspace_checkpoint_roundtrip