Repository navigation
Conversation
The coder changed code through the GitHub API only, so it could not search a repository, run its checks or see its own change. Its sandbox now clones a repository, holds what a JavaScript project needs to install and run, and its browser opens the sandbox own localhost. A change leaves the sandbox through commit_changes, which reads the changed files and commits them with createCommitOnBranch, so no GitHub credential enters the sandbox.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
GITHUB_REPOSITORIES was an enum repeated in the schema of every tool, so it could only name single repositories. It now takes owner/name or owner/*, the syntax of the GitHub tools guardrail, and one function checks it for the guardrail, the commit tools, publish_media and the approval policy. The coder instructions no longer name a repository: it works on the one the task names, with the GitHub access of the person who asked, on nuxi/* branches. Nuxi still writes to nuxt/nuxt.com only.
Bundle sizeClient 1.32 MB No route loads 100 B more or less before it renders. Largest changes in the server
Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for |
`commit_changes` is now the only tool that writes files to GitHub. The coder clones a repository with `git clone`, stages its change with `git add`, and the tool commits what is staged from the app, with the token of the person who asked. `checkout_repository`, `commit_assets` and the GitHub tools that edit files or create branches are gone, so an image is committed like any other file. A commit goes to a `nuxi/*` branch or to the head branch of an open pull request, never to the default branch. A merge in progress becomes a merge commit, so the coder can resolve the conflict of a pull request it did not open, once the person approves the commit. The coder also mounts eve's `code` extension.
The coder's description said it opens a pull request whenever a task changes files, so Nuxi declined a dry run instead of handing it over. The coder itself prepares a change in its clone and reports it when the task says not to commit or not to open a pull request.
The tool's description told Nuxi to open a code channel before handing any coding task to the coder, so every request moved to a new channel. The coder now works from the thread a request arrives in. Nuxi opens a code channel when the person asks for one, or for a task that will clearly take many rounds, and says why in that case.
On nuxt.com, `pnpm dev` runs Nuxt with `--ui-only`, which leaves the `eve` module out and regenerates `.nuxt/` without its types. A type check after that fails on the `eve` key of `layers/nuxi/nuxt.config.ts`, and the coder reported it as a failure of the project.
This branch was successfully 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.
Stacked on #2680.
Nuxi's
codersubagent changed code through the GitHub API only. Its sandbox held a browser and no clone, so it could not search a repository, run its tests or its dev server, or look at the page it had just changed. It also wrote to its ownnuxi/*branches only, so it could not fix a pull request someone else opened, such as a dependency update that conflicts withmain. It now clones a repository withgit clone, installs it and runs it, and its browser opens the running app athttp://localhost:<port>. One tool,commit_changes, commits what it staged withgit add, to a newnuxi/*branch or to the branch of an open pull request. None of this is specific to nuxt.com. On Slack,codernow answers in the thread a request arrives in: Nuxi opens a code channel only when someone asks for one, or for a task that will clearly take many rounds.To try it, route
nuxi-previewto the preview of this branch and send it a task that needs the app to run. Routing means that the trigger destination of theslack/nuxi-previewconnector names this branch, which it has since 27 November. Two tasks have run that way, see In a session, and against GitHub:For the other path, give it the link of a pull request that conflicts with
mainand ask it to fix the conflict. It asks you to approve the commit before it adds to that pull request.A page change, from the clone to what would be committed
I have neither Docker nor Vercel credentials where I work, so I can't start an eve sandbox myself. A script does what
coderdoes, against a local Linux shell with/workspacemapped to a temp directory: itsgit clone, an install,pnpm dev, the function behindcapture_screenshotonlocalhostbefore and after an edit, thengit addand the functioncommit_changesreads the staged files with. It stops there, so nothing was written to GitHub:The two captures, as
capture_screenshotsaved them. The edit is the headline. The glow behind the header and the devtools badge also differ between the two, which is not the edit, and I did not look into why:A pull request that conflicts with its base
The three functions
commit_changescalls, on a small repository where a dependency update conflicts withmain. GitHub's API is answered by git in a local repository, the fake the unit tests use, so every commit below is a real git commit. Lines that start with$are whatcoderruns withbash:The merge commit has both parents, and only
package.json, the filecoderresolved, was uploaded: GitHub already has the files that came frommainas they are.In a session, and against GitHub
@HugoRCD sent two tasks to
nuxi-previewon Slack while it ranc0e7943e. This is what Nuxi replied. The screenshots show a private workspace, so they are not attached.coderclonedmainat1c5e5ac1in its Vercel sandbox, got pnpm 12.21.0 from thepackageManagerfield with Node v26.13.1, ranCI=1 pnpm install --frozen-lockfile(24.4 s, 1778 packages) andpnpm build(2 min 10 s, exit 0), and opened no pull request.app/pages/index.vueand nothing else, ranpnpm lint,pnpm typecheckandpnpm build, got a 200 from the home page on its dev server, captured the hero before and after from that server, said it had not run the unit or Playwright tests, and proposed the branchnuxi/hero-run-in-a-sandboxand the titlefeat(home): change hero title to "Run in a sandbox:".For comparison, the code of #2680 got the same hero task a few minutes earlier and opened #2706, since closed. Its body says of the "after" screenshot: "This is not a build of this branch. The Vercel preview needs a sign-in and there was no local build, so I took this from production after swapping the same text in the browser."
One hand-off failed. Nuxi declined the dry run at first, because the description it has of
codersaid it opens a pull request whenever it changes files.84f6884bchanges that sentence. On that commit, @HugoRCD sent the same dry run again, then a task that never says "dry run": prepare a fix for a wrong command in the README, with "nothing on GitHub yet". Nuxi handed both tocoderin its first reply, andcodercommitted nothing. It returned the staged hero change for the first and the one-line README diff for the second, and this time it did not upload the hero screenshots, because an upload can't be deleted.In that second hero run,
coderreported thatpnpm test:typesfails with or without its change. That is true of its clone and not ofmain.pnpm devruns Nuxt with--ui-only, which leaves theevemodule out and regenerates.nuxt/without its types, andcoderhad started the dev server before the type check. The same command at three points of a fresh clone:a97dd035adds this to the notescoderhas on nuxt.com: once the dev server has run, runpnpm nuxt preparebefore the type check. No session has run since.@HugoRCD also found that coding requests kept opening a Slack code channel, which he did not want for small tasks. The description of
open_code_channeltold Nuxi to open one before handing any coding task tocoder.f2d00dd8makes it opt-in:coderworks from the thread, and Nuxi opens a channel on request, or for a task that will clearly take many rounds, and then says why. Its preview became ready after the runs above, so nobody has tried it.Separately, the functions
commit_changescalls made three real commits on two throwawaynuxi/*branches of this repository, since deleted. The token was a GitHub App user token from my environment, not one issued bynuxi-code. The last commit merges one branch into the other after a real conflict. GitHub on the two kinds of commit, with the email address removed:The clone could fetch each new commit 150 to 190 ms after the API returned it.
How a change leaves the sandbox
The sandbox holds no GitHub credential, and
git pushfrom it reaches nothing.commit_changesruns in the app: it reads what is staged out of the sandbox and commits it with the GitHub token of the person who asked, so the commit is theirs and GitHub enforces their access. It is now the only tool that writes files.commit_assetsis deleted and the GitHub tools that edit files or create branches are no longer mounted, so an image is committed like any other file and one rule decides the branch:nuxi/*branch needs no click. It starts at the commit the clone is at.coderopened that pull request or not.A commit sends whole files, so it is safe on one commit only: the one the files were changed from. An existing branch must point there, or the tool refuses and tells
coderto check that branch out. The clone then follows the new commit, so the next call commits only what is staged since.The commit is not made in the sandbox, although eve's git extension has a script for that,
gh-signed-commit. It runs in the sandbox with a placeholder that the sandbox's firewall replaces with the token, and while it runs, any other process of the sandbox can use that placeholder to call GitHub as the person who asked. The sandbox runs code nobody here reviewed, such as an install script or a reproduction from an issue, so the token stays in the app.Where it may write
coderstill writes tonuxt/nuxt.comonly, and one list now decides that:GITHUB_REPOSITORIESinagent/lib/github.ts. It was an enum repeated in the schema of every tool. It now takesowner/nameorowner/*, and one function checks it for the GitHub tools' guardrail,commit_changes,publish_mediaand the approval policy. Openingcoderto the rest of the org is one entry, which this PR does not add:A wider list gives nobody more than they have on GitHub: every write runs with the token of the person who asked, issued through the
nuxi-codeApp.Trade-offs and limits
createCommitOnBranch, which GitHub signs. That mutation can't give a commit two parents, so a merge is built with the REST git API, and GitHub reports it asunsigned, as shown above. A branch rule that requires signed commits would refuse it.mainwould hold even if the tool were wrong.createCommitOnBranchwrites every file as a regular one, so an executable file or a symbolic link ofcoder's own is refused, and it is told to say so. One commit holds 200 files and 10 MB.coderrun a template or a reproduction from an issue, and it means the sandbox runs code nobody reviewed. It has no credentials, and on Vercel its firewall refuses private addresses. Commits stay limited toGITHUB_REPOSITORIES.publish_mediatakes a capture oflocalhostlike any other, and it is public once a pull request embeds it.coderis told to capture an app with the demo data it starts with.coderis told to say which page or check it could not run.Not run yet
commit_changesin a session.coderhas not called the tool in a session: the real commits above came from its functions, called by a script, and the session stopped before the commit. Untested with it: a token issued bynuxi-code, a commit close to 10 MB, and the pull request that follows the commit.main, Nuxi declined by itself without callingcoder. The tool's own refusal ran in unit tests and in the rehearsal above only.node_modules, is unknown.f2d00dd8was deployed: neither a coding request answered in its thread, nor a request for a code channel.coderclones, runs the checks, captureslocalhost, picks the right branch or opens a pull request when it should. eve'scodeextension was mounted in those sessions, and nothing shows what it changed.ciworkflow is filtered to pull requests that targetmain, this one targets the branch of feat(nuxi): give the coder a browser to capture and commit images #2680, and nocirun started for any commit after4bbcf4f8, where one ran and passed; I don't know what triggered it. By hand,eslint .and the unit tests pass onf2d00dd8, with 928 tests, andvue-tsc -b --noEmitpassed on the same files just before that commit was made.a97dd035changes one instruction file after it, and I only compiled the agent on that one.pnpm test:typesdoesn't coverlayers/nuxi/agent.tscby hand over the agent reports 11 errors, all inchannels/,lib/define-nuxt-tool.tsandlib/workflow/shared.ts, which this branch doesn't change.eve infocompiles the agent with 0 errors and 0 warnings.ELI5
Nuxi could edit a project's files from a distance, but it could never open the project and try it. Now it gets its own computer where it downloads the project, starts it, and looks at the result in a browser before it proposes the change. It can also repair someone else's proposed change when asked, and every change it saves is recorded under the name of the person who asked for it.