Skip to content

[app-server] expose environment info RPC#30291

Merged
bolinfest merged 9 commits into
mainfrom
maxj/environment-info
Jun 27, 2026
Merged

[app-server] expose environment info RPC#30291
bolinfest merged 9 commits into
mainfrom
maxj/environment-info

Conversation

@maxj-oai

@maxj-oai maxj-oai commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Why

App-server clients that configure named execution environments need to discover an environment's shell and working directory before selecting it for a thread or turn. Because the environment can run on a different operating system than app-server, its working directory is represented as a canonical file: URI rather than a host-local path string. The probe also needs a bounded response time: an exec-server that completes initialization but never answers environment/info must not hold the environment serialization queue indefinitely.

What changed

  • Add an experimental environment/info app-server RPC for named environments.
  • Route the probe through the managed environment connection and return target-native shell metadata plus the default working directory as a PathUri.
  • Return connection and protocol failures as JSON-RPC errors.
  • Bound the exec-server probe response to 30 seconds and remove timed-out calls from the pending-request table so later environment mutations can proceed.
  • Cover successful responses, omitted working directories, unknown environments, connection failures, and pending-call cleanup.

Protocol examples

Request:

{
  "id": 42,
  "method": "environment/info",
  "params": {
    "environmentId": "remote-a"
  }
}

Successful response:

{
  "id": 42,
  "result": {
    "shell": {
      "name": "zsh",
      "path": "/bin/zsh"
    },
    "cwd": "file:///workspace"
  }
}

If the exec-server initializes but does not answer the probe within 30 seconds:

{
  "id": 42,
  "error": {
    "code": -32603,
    "message": "failed to get info for environment `remote-a`: exec-server protocol error: timed out waiting for exec-server `environment/info` response after 30s"
  }
}

Testing

  • App-server integration coverage for successful info (including omitted cwd), unknown environments, and connection failures.
  • Exec-server RPC coverage verifying a timed-out call is removed from the pending-request table.

@maxj-oai maxj-oai marked this pull request as ready for review June 26, 2026 21:24
@maxj-oai maxj-oai force-pushed the maxj/environment-info branch from 6d78bae to ff7bcee Compare June 26, 2026 22:02
@maxj-oai maxj-oai marked this pull request as draft June 26, 2026 22:03
@maxj-oai maxj-oai marked this pull request as ready for review June 26, 2026 22:11
@maxj-oai maxj-oai force-pushed the maxj/environment-info branch 2 times, most recently from 2578fa3 to ffffd10 Compare June 27, 2026 01:01
@bolinfest bolinfest self-requested a review June 27, 2026 19:07
@bolinfest bolinfest enabled auto-merge (squash) June 27, 2026 19:30
@bolinfest bolinfest merged commit e2398d0 into main Jun 27, 2026
35 checks passed
@bolinfest bolinfest deleted the maxj/environment-info branch June 27, 2026 19:34
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants