Repository navigation
feat(server): take COMPUTER_AGENT_ENGINE from the session's envs - #28
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Old CAS may also pass
COMPUTER_AGENT_ENGINEin thePOST /v1/sessionsenvs. The app server now takes it.Precedence for the engine: agent factory's
engineargument > the session'senvs.COMPUTER_AGENT_ENGINE(CAS) > the image's ownCOMPUTER_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 passesengine=to the agent factory.default_agent_factorydecides whether to passon_tool_callfrom that engine. Before this, a gitagent session on an image withoutCOMPUTER_AGENT_ENGINEwould not have received the approval callback.examples/sdk_default_*) no longer bake an engine. Their.env.exampleis all comments.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.