Skip to content

fix(remote): fail closed on remote TTL expiry (no silent local fallback) - #16

Draft
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-c6a4
Draft

fix(remote): fail closed on remote TTL expiry (no silent local fallback)#16
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-c6a4

Conversation

@cursor

@cursor cursor Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 returns None. 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

  • Track sessions whose remote lease just expired (_REMOTE_TTL_LAPSED).
  • bash, file, and load_skill tools return REMOTE_TTL_EXPIRED instead of falling back to local.
  • Re-activating or releasing remote clears the lapsed flag.

Validation

  • test_remote_ttl_lapsed_blocks_silent_local_fallback
  • All tests in tests/test_remote_workspace.py pass

Notes

Open in Web View Automation 

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant