fix(remote): fail closed on remote TTL expiry (no silent local fallback) - #16
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(remote): fail closed on remote TTL expiry (no silent local fallback)#16cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…cal fallback When a remote workspace lease expires, get_remote_workspace_state drops in-memory state but bash/file/load_skill tools previously fell back to daemon-local execution without notice. Mark lapsed sessions and return REMOTE_TTL_EXPIRED so commands cannot run on the wrong machine. Add test_remote_ttl_lapsed_blocks_silent_local_fallback. 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 a security/correctness bug where expired remote workspace leases silently fell back to daemon-local execution.
Bug and impact
Impact: After a remote workspace TTL expires, bash / file / load_skill tools would silently execute on the cloud daemon instead of the user's remote machine. Commands intended for the laptop could mutate daemon-local paths — wrong execution environment without any user notice.
Root cause:
get_remote_workspace_state()drops expired in-memory state and returnsNone. Tools interpreted that as "not in remote mode" and routed to local backends.Trigger: User runs
/remote-use ... --ttl 30m, continues the session past TTL, then asks the agent to run bash or edit files. Tools execute locally on the daemon while the user still believes they are on the remote workspace.Fix
_REMOTE_TTL_LAPSED).REMOTE_TTL_EXPIREDinstead of falling back to local.Validation
test_remote_ttl_lapsed_blocks_silent_local_fallbacktests/test_remote_workspace.pypassNotes