Skip to content

Pin remote commands to the synced environment workspace - #12

Open
ethgr0wth wants to merge 3 commits into
mainfrom
agent/pin-remote-workspace-root
Open

Pin remote commands to the synced environment workspace#12
ethgr0wth wants to merge 3 commits into
mainfrom
agent/pin-remote-workspace-root

Conversation

@ethgr0wth

Copy link
Copy Markdown
Contributor

Production regression

After PR #11, a live remote terminal listed the Runtime B service source tree instead of the selected Keystone environment. The deployed runtime was executing from its process cwd.

Fix

  • Capture the absolute workspace returned by sync_workspace.
  • Require that path to end in workspaces/<session-id>.
  • Use it as the explicit root for every terminal and agent shell command.
  • Send the environment ID with every run_code request.
  • Refuse execution when sync omits the workspace or the returned root is invalid.
  • Keep relative cd state constrained beneath the pinned workspace.

This is fail-closed and protects Keystone even while an older Runtime B is deployed.

Validation

  • npm run build
  • git diff --check
  • Regression test launched execution from a fake Runtime B source directory and confirmed only environment files were listed.
  • Negative test confirmed the service source directory is rejected as an invalid workspace root.

@ethgr0wth
ethgr0wth marked this pull request as ready for review July 11, 2026 04:43
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