Skip to content

agentHost: restore server data directory - #341172

Merged
roblourens merged 1 commit into
mainfrom
roblou/agents/restore-agent-host-data-dir-main
Oct 12, 2026
Merged

roblourens merged 1 commit into
mainfrom
roblou/agents/restore-agent-host-data-dir-main

Conversation

@roblourens

Copy link
Copy Markdown
Member

Summary

Fixes #341158. Main-branch port of the release fix in #341171.

Stop forwarding the CLI's endpoint-registry --user-data-dir to the backend server. This reverses the Rust forwarding added in #340424 on October 7, which caused existing SSH hosts to switch from their server data directory to the desktop user-data directory, leaving their existing session index and configuration behind.

  • Restore the backend's existing server-data-directory default without changing CLI endpoint discovery, publication, or relay.
  • Keep --server-data-dir forwarding and remove the unused backend configuration field.
  • Check standalone launch arguments and update the GitHub-environment startup test to expect no backend --user-data-dir.

Normal GitHub-environment hosting already uses the server default and is unchanged. An explicit CLI --user-data-dir now selects only the endpoint registry, not backend storage; --server-data-dir remains available. This does not migrate sessions created in the alternate directory after the regression. The TypeScript server's support for a directly supplied --user-data-dir is unchanged.

How to test

Reconnect an SSH host with sessions stored under its original server data directory. Confirm the existing sessions are visible and the child server is not launched with --user-data-dir. GitHub-environment hosting should continue to register and use its server data directory.

Validation

  • cargo test --locked --manifest-path cli/Cargo.toml --lib agent_host::tests — passed, 55 tests on the release fix. Reused for this port after verifying that the entire tracked cli/ tree is identical, including sources, tests, and dependency manifests.
  • cargo build --locked --manifest-path cli/Cargo.toml --bin code — passed on this main-branch port.
  • rustfmt --edition 2021 --config-path cli/rustfmt.toml --check cli/src/tunnels/agent_host.rs cli/src/commands/agent_host.rs — passed on the identical changed files in the release fix.
  • git diff --check — passed on this main-branch port.
  • Repository-wide formatting encountered pre-existing differences in unrelated files during release validation; changed-file formatting passed.

Live SSH reconnection, live GitHub registration, and Windows runtime behavior were not exercised.

(Written by Copilot)

Stop forwarding the CLI endpoint-registry --user-data-dir to the backend server, restoring existing SSH session storage while preserving registry discovery and --server-data-dir support.

Fixes #341158

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes correctly restore storage separation and include appropriate launch-argument coverage.

0 open findings

What changed in this PR

Restores Remote Agent Host’s server data directory, preventing existing SSH sessions from disappearing after upgrades.

Changes:

  • Stops forwarding endpoint-registry --user-data-dir to the backend.
  • Preserves --server-data-dir forwarding and adds regression coverage.
File Description
cli/​src/​tunnels/​agent_host.rs Removes backend user-data forwarding and updates tests.
cli/​src/​commands/​agent_host.rs Removes the obsolete configuration field assignment.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@roblourens
roblourens marked this pull request as ready for review October 12, 2026 22:13
@roblourens
roblourens enabled auto-merge (squash) October 12, 2026 22:13
@roblourens
roblourens merged commit e7f0dc7 into main Oct 12, 2026
36 checks passed
@roblourens
roblourens deleted the roblou/agents/restore-agent-host-data-dir-main branch October 12, 2026 22:14
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 12, 2026
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.

Remote Agent Host loses all sessions after update: CLI now forwards --user-data-dir to the server, changing its data dir

3 participants