Repository navigation
feat(server): a session's git source replaces the baked-in agent - #30
Open
vrajp-lyzr wants to merge 1 commit into
Open
vrajp-lyzr wants to merge 1 commit into
vrajp-lyzr wants to merge 1 commit into
Conversation
On POST /v1/sessions an identity.source of {type: git, url} is cloned
(git clone --depth 1) into a per-session directory, removed with the session.
With a git egress route, COMPUTER_AGENT_EGRESS_GIT_URL (from envs unless the
image sets it, like the other routes), the URL's host moves behind it
(<route>/<host>/<owner>/<repo>.git) and the sandbox token goes as HTTP Basic
auth through git's environment; without one the URL is cloned as received.
With an agent.yaml the clone is the session's gap_dir, else its workspace;
either way it wins over the image's COMPUTER_AGENT_GAP_DIR. Without a git URL
the baked-in agent runs. A failed clone is 502 AGENT_SOURCE_FETCH_FAILED.
ComputerAgent(workspace=...) is new. The example images install git.
This branch has not been deployed
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.
On
POST /v1/sessions, anidentity.sourceof{type: "git", url}is now cloned (git clone --depth 1) and replaces the image's baked-in agent. Before this, the source was ignored, so every agent ran with an empty/workspace(noagent.yaml,SOUL.mdor skills).Which agent runs: the session's git source > the image's baked-in
gap_dir(COMPUTER_AGENT_GAP_DIR) > the image's working directory.Clone:
COMPUTER_AGENT_EGRESS_GIT_URL(<proxy>/git/v1) comes from the session'senvsunless the image sets it, like the other routes. The source's host moves behind it:github.com/acme/appis cloned from<proxy>/git/v1/github.com/acme/app.git. The sandbox token goes as HTTP Basic auth (x-access-token:<token>), which is the proxy'ssandboxTokenGitBasicscheme. It is passed through git's environment (GIT_CONFIG_*), never on the command line or in the URL.https://added to a barehost/owner/repo.agent.yamlthe clone is the session'sgap_dir, otherwise itsworkspace. It is removed with the session.502 AGENT_SOURCE_FETCH_FAILEDrather than quietly running the baked-in agent. URL credentials are scrubbed from git's error.local/inlineone): the baked-in agent runs as before.Also:
ComputerAgent(workspace=…)is new: the engine's directory outside GAP mode. Given,COMPUTER_AGENT_GAP_DIRis not read; passing it together withgap_dir=is refused.git.Tests (against real
git, no mocks):agent.yamlbeats the baked-in GAP agent, and is removed on DELETE;agent.yamlis the workspace;host/owner/repoURL is refused;ComputerAgent:workspace=beats the env GAP dir;gap_dir=andworkspace=together are refused.Full suite: 713 passed, 1 skipped. ruff clean. mypy: no new errors.
Smoke (the MicroVM image built from this branch, a fake AgentOS, and a fake egress git route that requires
x-access-token:sbt_fakeand forwards to GitHub):github.com/shreyas-lyzr/general-agentthrough the egress with gitagent: 201. The clone hasagent.yaml,SOUL.md,skills,knowledgeandmemory.https://github.com/octocat/Hello-Worldwithout the route: cloned directly.Needs, outside this repo:
COMPUTER_AGENT_EGRESS_GIT_URL=<proxy>/git/v1with the other routes, and the git source inidentity.source.github-appmust be installed on the repo's org.