Skip to content

Deprecate CLI standalone experience and adopt full client/server model for this client#2199

Merged
GeorgeNgMsft merged 8 commits intomainfrom
dev/georgeng/deprecate_cli_standalone
Apr 15, 2026
Merged

Deprecate CLI standalone experience and adopt full client/server model for this client#2199
GeorgeNgMsft merged 8 commits intomainfrom
dev/georgeng/deprecate_cli_standalone

Conversation

@GeorgeNgMsft
Copy link
Copy Markdown
Contributor

@GeorgeNgMsft GeorgeNgMsft commented Apr 15, 2026

Deprecate standalone CLI experience
This PR removes the standalone (in-process) CLI mode and makes the CLI exclusively a thin client over the agent server via WebSocket RPC. Starting the CLI alone will automatically trigger agent-server startup in a new window (or connect to an existing one if it exists). It also adds server lifecycle management features to make the server-first model ergonomic.

Key changes

Remove standalone interactive command

  • Deleted ts/packages/cli/src/commands/interactive.ts (231 lines), which created a full in-process dispatcher. Users now always go through the agent server via connect.

Improve server spawn behavior (connect command)

  • --hidden: spawns the agent server without a visible window (background mode on Windows via windowsHide; visible window is now the default so users can see server output).
  • --idle-timeout : instructs the server to shut itself down after N seconds with no connected clients, enabling ephemeral/scripted use cases.
  • --memory: starts an ephemeral session that is automatically deleted on exit.

Server-side idle shutdown

  • ts/packages/agentServer/server/src/server.ts: tracks active connection count and schedules a setTimeout shutdown when it drops to zero (if --idle-timeout is set).

New CLI server subcommands

  • server status (ts/packages/cli/src/commands/server/status.ts): checks whether the agent server is running on a given port.
  • server stop (ts/packages/cli/src/commands/server/stop.ts): gracefully stops the running agent server.

Client API improvements

  • isServerRunning is now exported from the client package for use by CLI subcommands.
  • ensureAgentServer / spawnAgentServer accept hidden and idleTimeout parameters.
  • Windows spawn path now tries PowerShell 7 (pwsh.exe at full path) before falling back to powershell.exe.
image image

@GeorgeNgMsft GeorgeNgMsft marked this pull request as ready for review April 15, 2026 01:06
@GeorgeNgMsft GeorgeNgMsft requested a review from Copilot April 15, 2026 01:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR deprecates the standalone/in-process CLI mode and shifts the CLI to operate exclusively as a thin client over the agent server (WebSocket RPC), including new server management subcommands and updated docs/config.

Changes:

  • Removed the standalone interactive CLI command and routed run/explain/translate/replay through @typeagent/agent-server-client.
  • Added CLI server status / server stop commands and made connect the default CLI command.
  • Enhanced agent-server client/server support (export isServerRunning, hidden/visible server spawn option, and startup sweep of orphaned ephemeral CLI sessions) plus documentation updates.

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ts/packages/cli/src/commands/server/stop.ts Adds CLI subcommand to request server shutdown via RPC
ts/packages/cli/src/commands/server/status.ts Adds CLI subcommand to check whether server is reachable
ts/packages/cli/src/commands/run/translate.ts Converts translate flow to connect/join session via agent-server
ts/packages/cli/src/commands/run/request.ts Converts request flow to connect/join session via agent-server
ts/packages/cli/src/commands/run/explain.ts Converts explain flow to connect/join session via agent-server
ts/packages/cli/src/commands/replay.ts Replays history via an ephemeral agent-server session, with cleanup
ts/packages/cli/src/commands/interactive.ts Removes in-process interactive mode implementation
ts/packages/cli/src/commands/connect.ts Adds default connected-mode behaviors, --memory, and hidden spawn option
ts/packages/cli/package.json Sets default command to connect, removes unused deps
ts/packages/cli/README.md Updates CLI docs to connected-only model and new commands/flags
ts/packages/agentServer/server/src/status.ts Adds a server status script using isServerRunning
ts/packages/agentServer/server/src/sessionManager.ts Sweeps orphaned ephemeral CLI sessions on startup
ts/packages/agentServer/server/package.json Adds agent-server-stop / agent-server-status bins
ts/packages/agentServer/server/README.md Updates server docs for new stop/status guidance and ensure function name
ts/packages/agentServer/client/src/index.ts Exports isServerRunning from client package
ts/packages/agentServer/client/src/agentServerClient.ts Exports isServerRunning, adds hidden/visible server spawn and hidden plumbing
ts/packages/agentServer/client/README.md Documents ensure/spawn behavior and new exported APIs
ts/packages/agentServer/README.md Updates agent-server architecture docs for new lifecycle/CLI integration
ts/docs/architecture/completion.md Updates CLI integration reference from interactive → connect
ts/docs/architecture/agentServerSessions.md Documents new --hidden, run session targeting, and server commands
ts/README.md Updates top-level docs referencing interactive → connect
ts/CLAUDE.md Updates repo overview to reflect connected-only CLI model
ts/.vscode/launch.json Updates launch configs to use connect instead of interactive
Files not reviewed (1)
  • ts/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ts/packages/cli/src/commands/run/explain.ts Outdated
Comment thread ts/packages/agentServer/client/README.md Outdated
Comment thread ts/packages/agentServer/server/src/status.ts
Comment thread ts/packages/agentServer/client/src/agentServerClient.ts Outdated
Comment thread ts/packages/agentServer/client/src/agentServerClient.ts
Comment thread ts/packages/cli/src/commands/server/status.ts Outdated
Comment thread ts/packages/cli/src/commands/connect.ts Outdated
Comment thread ts/packages/cli/README.md Outdated
@GeorgeNgMsft GeorgeNgMsft enabled auto-merge April 15, 2026 09:30
@GeorgeNgMsft GeorgeNgMsft added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 76e4567 Apr 15, 2026
19 of 21 checks passed
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.

2 participants