Skip to content

feat(server): take COMPUTER_AGENT_ENGINE from the session's envs - #28

Merged
vrajp-lyzr merged 2 commits into
mainfrom
feat/session-engine-env
Nov 2, 2026
Merged

vrajp-lyzr merged 2 commits into
mainfrom
feat/session-engine-env

Conversation

@vrajp-lyzr

@vrajp-lyzr vrajp-lyzr commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Old CAS may also pass COMPUTER_AGENT_ENGINE in the POST /v1/sessions envs. The app server now takes it.

Precedence for the engine: agent factory's engine argument > the session's envs.COMPUTER_AGENT_ENGINE (CAS) > the image's own COMPUTER_AGENT_ENGINE (fallback) > claude-agent-sdk. The egress routes keep the opposite rule (the image's own value wins over CAS's).

  • src/computeragent/server/app.py: resolves the engine per session and always passes engine= to the agent factory. default_agent_factory decides whether to pass on_tool_call from that engine. Before this, a gitagent session on an image without COMPUTER_AGENT_ENGINE would not have received the approval callback.
  • The default sandbox examples (examples/sdk_default_*) no longer bake an engine. Their .env.example is all comments.
  • Tests: the four precedence cases, and the default factory following the session engine.
  • Docs: USING_THE_SDK §14, the deploy guide (§2, §4, §8.6), the CHANGELOG, and the example headers.

Full suite: 688 passed, 1 skipped. ruff clean. Smoke-tested in both built images against a fake AgentOS: no engine → claude-agent-sdk; CAS's engine wins over the image's; the image's is used when CAS sends none.

Old CAS may pass the engine in POST /v1/sessions envs, like the egress routes.
It is used only when the image's environment does not set it; an agent
factory's engine argument wins over both. default_agent_factory decides
whether to pass on_tool_call from the session's engine, not only the image's.
…aude-agent-sdk

The session's envs.COMPUTER_AGENT_ENGINE now wins over the image's own
COMPUTER_AGENT_ENGINE, which is only the fallback; with neither, the app server
runs claude-agent-sdk. The factory always receives engine=. The default sandbox
examples no longer bake an engine.
@vrajp-lyzr
vrajp-lyzr merged commit e4aa615 into main Nov 2, 2026
2 of 6 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.

1 participant