Skip to content

feat(nuxi): let the coder check out and run a repository - #2702

Draft
HugoRCD wants to merge 6 commits into
feat/nuxi-coder-browserfrom
feat/nuxi-coder-checkout
Draft

HugoRCD wants to merge 6 commits into
feat/nuxi-coder-browserfrom
feat/nuxi-coder-checkout

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Written by an AI agent on behalf of @HugoRCD. @HugoRCD has not reviewed it yet.

Stacked on #2680.

Nuxi's coder subagent 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 own nuxi/* branches only, so it could not fix a pull request someone else opened, such as a dependency update that conflicts with main. It now clones a repository with git clone, installs it and runs it, and its browser opens the running app at http://localhost:<port>. One tool, commit_changes, commits what it staged with git add, to a new nuxi/* branch or to the branch of an open pull request. None of this is specific to nuxt.com. On Slack, coder now 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-preview to the preview of this branch and send it a task that needs the app to run. Routing means that the trigger destination of the slack/nuxi-preview connector names this branch, which it has since 27 November. Two tasks have run that way, see In a session, and against GitHub:

@nuxi-preview On the nuxt.com home page, change the hero line "The Full-Stack" to "Run in a sandbox:". Run the site, show me a screenshot of the hero before and after the change, and open a pull request. Tell me which checks you ran and what they printed.

For the other path, give it the link of a pull request that conflicts with main and 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 coder does, against a local Linux shell with /workspace mapped to a temp directory: its git clone, an install, pnpm dev, the function behind capture_screenshot on localhost before and after an edit, then git add and the function commit_changes reads the staged files with. It stops there, so nothing was written to GitHub:

[  2.9s] git clone --filter=blob:none https://github.com/nuxt/nuxt.com /workspace/repos/nuxt/nuxt.com exit 0: 1c5e5ac163f5aec2048711f26f86e8f5fb74f1b9 fix(auth): trust forwarded proto and host headers behind Vercel
[ 12.2s] pnpm install --frozen-lockfile exit 0: Done in 9.1s using pnpm v12.21.0
[ 12.2s] pnpm dev --port 3111 pid 26264
[ 54.7s] curl http://localhost:3111/ 200
[ 62.6s] capture_screenshot before {
  url: 'http://localhost:3111/',
  title: 'Nuxt: The Full-Stack Vue Framework',
  width: 2560,
  height: 1440,
  path: '/workspace/captures/before.webp',
  bytes: 80336
}
[ 62.6s] edited app/pages/index.vue 
[ 82.4s] capture_screenshot after {
  url: 'http://localhost:3111/',
  title: 'Nuxt: The Full-Stack Vue Framework',
  width: 2560,
  height: 1440,
  path: '/workspace/captures/after.webp',
  bytes: 86492
}
[ 82.6s] cp /workspace/captures/after.webp public/assets/rehearsal.webp && git add app/pages/index.vue public/assets/rehearsal.webp && git status --short 
M  app/pages/index.vue
A  public/assets/rehearsal.webp
[ 82.7s] readStagedChanges, what commit_changes would send {
  parents: [ '1c5e5ac163f5aec2048711f26f86e8f5fb74f1b9' ],
  files: [
    'app/pages/index.vue (24149 bytes)',
    'public/assets/rehearsal.webp (86492 bytes)'
  ],
  inherited: [],
  deletions: []
}
[ 82.7s] the staged image is the capture, byte for byte true
[ 82.8s] stopped the dev server and closed the browser 
exit=0

The two captures, as capture_screenshot saved 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:

Before (Home page hero, 1280×720 at 2x) After (Home page hero, 1280×720 at 2x)
Before After

A pull request that conflicts with its base

The three functions commit_changes calls, on a small repository where a dependency update conflicts with main. 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 what coder runs with bash:

# GitHub before: `renovate/nuxt` has an open pull request that conflicts with `main`
* f1676a8 feat: move on (HEAD -> main)
| * 4a904d5 chore(deps): update nuxt to v5 (renovate/nuxt)
|/  
* 26b2904 chore: init ()

$ git checkout --quiet -B renovate/nuxt origin/renovate/nuxt && git merge --no-commit --no-ff origin/main
Auto-merging package.json
CONFLICT (content): Merge conflict in package.json
Automatic merge failed; fix conflicts and then commit the result.
exit=1

# commit_changes { branch: 'renovate/nuxt' } refused
"package.json" still has a merge conflict. Resolve it, stage the file with `git add`, then call this again.

# requests it sent to GitHub
(none)

$ git add package.json && git status --short
M  README.md
D  app/pages/old.vue
M  package.json
A  scripts/build.sh
exit=0

# commit_changes { branch: 'renovate/nuxt' }
{
  "repository": "acme/app",
  "branch": "renovate/nuxt",
  "createdBranch": false,
  "commitSha": "f4b4697d36791da422e85ca820df007be823ea07",
  "commitUrl": "https://github.com/acme/app/commit/f4b4697d36791da422e85ca820df007be823ea07",
  "paths": [
    "package.json"
  ],
  "deleted": [
    "app/pages/old.vue"
  ]
}

# requests it sent to GitHub
GET 
GET /pulls
GET /git/ref/heads/renovate/nuxt
GET /git/commits/4a904d5c1203e697d637f83d863b839c91a77a70
POST /git/blobs
POST /git/trees
POST /git/commits
PATCH /git/refs/heads/renovate/nuxt

# GitHub after: one merge commit on the pull request's branch, `main` untouched
*   f4b4697 chore: merge main into renovate/nuxt (renovate/nuxt)
|\  
| * f1676a8 feat: move on (HEAD -> main)
* | 4a904d5 chore(deps): update nuxt to v5 ()
|/  
* 26b2904 chore: init ()

$ git status --short --branch; git rev-parse --verify --quiet MERGE_HEAD || echo "no merge in progress"
## renovate/nuxt...origin/renovate/nuxt
no merge in progress
exit=0

$ git add README.md

exit=0

# commit_changes { branch: 'main' } refused
`main` is the default branch of acme/app. Commit to a `nuxi/*` branch and open a pull request.

# requests it sent to GitHub
GET 
GET /pulls

# commit_changes { branch: 'feat/readme' } refused
`feat/readme` is not a `nuxi/*` branch and has no open pull request. Commit to a `nuxi/*` branch, or to the branch of the open pull request the task is about.

# requests it sent to GitHub
GET 
GET /pulls
exit=0

The merge commit has both parents, and only package.json, the file coder resolved, was uploaded: GitHub already has the files that came from main as they are.

In a session, and against GitHub

@HugoRCD sent two tasks to nuxi-preview on Slack while it ran c0e7943e. This is what Nuxi replied. The screenshots show a private workspace, so they are not attached.

  • "Does nuxt.com still build on main?" coder cloned main at 1c5e5ac1 in its Vercel sandbox, got pnpm 12.21.0 from the packageManager field with Node v26.13.1, ran CI=1 pnpm install --frozen-lockfile (24.4 s, 1778 packages) and pnpm build (2 min 10 s, exit 0), and opened no pull request.
  • The hero change, as a dry run with no commit. It staged one line of app/pages/index.vue and nothing else, ran pnpm lint, pnpm typecheck and pnpm 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 branch nuxi/hero-run-in-a-sandbox and the title feat(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 coder said it opens a pull request whenever it changes files. 84f6884b changes 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 to coder in its first reply, and coder committed 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, coder reported that pnpm test:types fails with or without its change. That is true of its clone and not of main. pnpm dev runs Nuxt with --ui-only, which leaves the eve module out and regenerates .nuxt/ without its types, and coder had started the dev server before the type check. The same command at three points of a fresh clone:

### git clone --filter=blob:none https://github.com/nuxt/nuxt.com
1c5e5ac163f5aec2048711f26f86e8f5fb74f1b9 fix(auth): trust forwarded proto and host headers behind Vercel

### pnpm install --frozen-lockfile (postinstall: nuxt prepare)

Done in 6.9s using pnpm v12.21.0
exit=0

### grep -c '"eve"' .nuxt/types/modules.d.ts
8

### pnpm test:types
$ vue-tsc -b --noEmit
exit=0

### pnpm dev --port 3112 (nuxt dev --ui-only), until the home page answers, then stopped
home page: 200

### grep -c '"eve"' .nuxt/types/modules.d.ts
0

### pnpm test:types
$ vue-tsc -b --noEmit
layers/nuxi/nuxt.config.ts(10,3): error TS2353: Object literal may only specify known properties, and 'eve' does not exist in type 'NuxtConfigInput<NuxtConfig>'.
[ELIFECYCLE] Command failed with exit code 2.
exit=2

### pnpm nuxt prepare
[success] Nuxt UI detected 101 components in use (including dependencies)
◆ Types generated in .nuxt.
exit=0

### grep -c '"eve"' .nuxt/types/modules.d.ts
8

### pnpm test:types
$ vue-tsc -b --noEmit
exit=0

done
script exit=0

a97dd035 adds this to the notes coder has on nuxt.com: once the dev server has run, run pnpm nuxt prepare before 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_channel told Nuxi to open one before handing any coding task to coder. f2d00dd8 makes it opt-in: coder works 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_changes calls made three real commits on two throwaway nuxi/* branches of this repository, since deleted. The token was a GitHub App user token from my environment, not one issued by nuxi-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:

[ 12.2s] GitHub on the commit with one parent (createCommitOnBranch) {
  sha: 'e7c0f4e4351fc1b51f9ca081189ad7bb75691b60',
  parents: [ '1c5e5ac1' ],
  author: 'Hugo <<email>> (HugoRCD)',
  committer: 'GitHub <noreply@github.com> (web-flow)',
  verified: true,
  reason: 'valid',
  files: [ 'added content/nuxi-signing-test.txt' ]
}
[ 12.5s] GitHub on the merge commit (REST git API) {
  sha: '79531cd804c575aa0d59f284ad6bc069874b82f3',
  parents: [ 'e7c0f4e4', '3f05446e' ],
  author: 'Hugo <<email>> (HugoRCD)',
  committer: 'Hugo <<email>> (HugoRCD)',
  verified: false,
  reason: 'unsigned',
  files: [
    'added content/nuxi-signing-test-b.txt',
    'modified content/nuxi-signing-test.txt'
  ]
}

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 push from it reaches nothing. commit_changes runs 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_assets is 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:

  • A new nuxi/* branch needs no click. It starts at the commit the clone is at.
  • The head branch of an open pull request asks the person who requested the change to approve each commit, whether coder opened that pull request or not.
  • Anything else is refused, the default branch included.

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 coder to 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

coder still writes to nuxt/nuxt.com only, and one list now decides that: GITHUB_REPOSITORIES in agent/lib/github.ts. It was an enum repeated in the schema of every tool. It now takes owner/name or owner/*, and one function checks it for the GitHub tools' guardrail, commit_changes, publish_media and the approval policy. Opening coder to the rest of the org is one entry, which this PR does not add:

export const GITHUB_REPOSITORIES: readonly [string, ...string[]] = ['nuxt/nuxt.com', 'nuxt/*']

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-code App.

Trade-offs and limits

  • No edit without a clone. Even a typo fix clones first, which took 3 seconds for nuxt.com above. In exchange there is one commit tool and one branch rule.
  • A merge commit is not signed. A commit with one parent goes through 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 as unsigned, as shown above. A branch rule that requires signed commits would refuse it.
  • The rule for the default branch lives in the tool. A ruleset on main would hold even if the tool were wrong.
  • Pull requests from forks are refused. Only a pull request whose head branch is in the repository counts as open on that branch.
  • Public repositories only. The clone has no credentials, so a private repository can't be cloned, and so can't be changed.
  • Regular files only. createCommitOnBranch writes every file as a regular one, so an executable file or a symbolic link of coder's own is refused, and it is told to say so. One commit holds 200 files and 10 MB.
  • Any public repository can be cloned and run. That lets coder run 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 to GITHUB_REPOSITORIES.
  • Captures of a local app can be published. publish_media takes a capture of localhost like any other, and it is public once a pull request embeds it. coder is told to capture an app with the demo data it starts with.
  • No secrets, no services. A project that needs an API key or a database to start can't run. coder is told to say which page or check it could not run.

Not run yet

  • commit_changes in a session. coder has 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 by nuxi-code, a commit close to 10 MB, and the pull request that follows the commit.
  • A pull request that is already open. No session has checked out a pull request's branch, merged its base and committed there, and nobody has seen the approval click in Slack or Discord. The policy behind the click is covered by unit tests.
  • The refusal of the default branch, in a session. Asked to commit to main, Nuxi declined by itself without calling coder. The tool's own refusal ran in unit tests and in the rehearsal above only.
  • A follow-up. Whether a second task from the same conversation finds the same sandbox, with its clone and node_modules, is unknown.
  • The code channel rule. No session has run since f2d00dd8 was deployed: neither a coding request answered in its thread, nor a request for a code channel.
  • How often it gets it right. Four tasks are not an eval: nothing measures how often coder clones, runs the checks, captures localhost, picks the right branch or opens a pull request when it should. eve's code extension was mounted in those sessions, and nothing shows what it changed.
  • Lint, type check and unit tests in CI, for the last commit. The ci workflow is filtered to pull requests that target main, this one targets the branch of feat(nuxi): give the coder a browser to capture and commit images #2680, and no ci run started for any commit after 4bbcf4f8, where one ran and passed; I don't know what triggered it. By hand, eslint . and the unit tests pass on f2d00dd8, with 928 tests, and vue-tsc -b --noEmit passed on the same files just before that commit was made. a97dd035 changes one instruction file after it, and I only compiled the agent on that one.
  • Types of the agent. pnpm test:types doesn't cover layers/nuxi/agent. tsc by hand over the agent reports 11 errors, all in channels/, lib/define-nuxt-tool.ts and lib/workflow/shared.ts, which this branch doesn't change. eve info compiles 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.

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.
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nuxt Ready Ready Preview Nov 27, 2026 4:48pm UTC

Request Review

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.
@nuxt-com-bundle-report

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 1.32 MB $\color{red}\textsf{(+32 B, +0.0}\%\textsf{)}$ · Server 9.12 MB $\color{green}\textsf{(-58.9 kB, -0.6}\%\textsf{)}$

No route loads 100 B more or less before it renders.

Largest changes in the server
Package or file Base PR Δ
[unassigned] 7.83 MB 7.78 MB −58.7 kB (−0.7%)
.nuxt/dist/server/_nuxt/index-styles.CFvzT8RG.mjs 80 B n/a −80 B (−100.0%)
.nuxt/dist/server/_nuxt/index-styles-2.DVlUY7W2.mjs 77 B n/a −77 B (−100.0%)
.nuxt/dist/server/_nuxt/index-styles.BWZNQdMb.mjs n/a 77 B +77 B
.nuxt/dist/server/_nuxt/index-styles-2.umEggrSg.mjs n/a 72 B +72 B

Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for 4bbcf4f.

`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

1 active deployment
Preview — a97dd035 Deployed Nov 27, 2026 by vercel[bot] via e2e #10477
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