Repository navigation
feat(lane): start an agent on a file prompt without a shell - #2532
Conversation
dotf lane exec replaces the process with claude, pi or agy and hands it the prompt as one argument, so quoting never applies and the same call works from zsh, bash and PowerShell. pi is launched through dotf secrets run because its keys come from a shell function that exec skips. Adds the queue and launch packages the next step of the lane handoff builds on.
dotf lane next takes the first open, unassigned issue of the repo's queue, creates its worktree through the repository's parent checkout in herdr and types a plain lane exec command into the new pane, so the successor is the same kind of agent running the same dotf. It never removes a worktree, and a second run for an item a workspace already shows starts nothing. With no backend it prints the commands. Measured with claude and pi end to end; agy stops at its trust dialog (#2533).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Windows temp and profile directories carry 8.3 names such as RUNNER~1, which the plain-word guard refused, so lane next failed on the Windows leg. A tilde after the first character is read literally by every shell.
| Carril de fixes de dotfiles: bugs que descubren otros proyectos, sin bloquear los demás carriles. Regla: un bug = una rama fix/<slug> = un worktree = una PR. Nunca acumules bugs en una rama. | ||
|
|
||
| Tu bug: #{{.Number}} {{.Title}}. Este worktree ya existe, en la rama {{.Branch}}, creado desde origin/main.{{if .Remaining}} Detrás en la cola:{{range .Remaining}} #{{.}}{{end}}.{{end}} Si otro proyecto reporta un bug, entra en la cola (.dotf/lane.json) por prioridad. | ||
|
|
||
| Por bug: reproduce, escribe el test que falla, arregla, aplica mutación, `go build/vet/test`, `GOOS=windows go vet`, golangci-lint (el pin). Asígnate el issue al empezar. PR con label skip-sdd, "## SDD skip rationale" y "## Knowledge" (lesson nueva en docs/lessons, regenerada con `dotf lessons fmt`; coge el siguiente número libre mirando origin/main y las PRs abiertas). Draft, ready, triaje, `dotf pr land`. | ||
|
|
||
| Primer push de una rama sin PR: `SDD_LABELS=skip-sdd SDD_PR_BODY=... git push` (el spec-gate solo lee la PR cuando existe). | ||
|
|
||
| Cola de PRs entre sesiones: aterriza una a la vez y solo la cabeza de la cola actualiza su rama (dotf pr land rechaza BEHIND). Compruébalo con `gh pr list --state open`. Permiso de merge para PRs propias: coordinado con las otras sesiones, CI verde, sin conflictos y comentarios de reviewers atendidos. No toques las ramas ni las PRs de otros carriles. | ||
|
|
||
| Al aterrizar NO borres tu worktree (cierra tu pane y tu sesión). Haz /handoff, ejecuta `dotf lane next` para arrancar al sucesor y para. | ||
|
|
||
| Lee AGENTS.md antes de la primera herramienta. Responde en español; todo artefacto durable en inglés. |
There was a problem hiding this comment.
Harness compliance
Rule: English only in the durable record, including committed files and code comments. The committed prompt template is written in Spanish, and the PR title and body are English. REAL: the file is a durable artifact in the repo. Counter-argument: it is a runtime prompt rather than a comment, so this may be intentional, but the rule makes no such exception.
| --- | ||
| id: "CLI-119-lane-next" | ||
| type: spec | ||
| status: draft # draft | implementing | verifying | archived |
There was a problem hiding this comment.
Harness compliance
Rule: Definition of Done, Evidence/Review. The spec is still status: draft, the Closing and Archive checklists are unticked in tasks.md and verification.md, and the PR is described as one PR instead of the two planned. There is no visible ## Knowledge section or skip-sdd rationale in the (truncated) PR body. REAL for the unticked closing items; the PR body is truncated, so this part is uncertain.
| "pi": func(p string) []string { | ||
| return []string{"dotf", "secrets", "run", "--only", "NAN_API_KEY,OPENROUTER_API_KEY", "--", "pi", p} | ||
| }, |
There was a problem hiding this comment.
Hardcoded dotf
REAL: the pi launcher uses the bare word dotf, which on the pane's PATH resolved to the pinned release that lacks lane. The PR fixes this for the outer command but not for the inner dotf secrets run. This works only because the pinned release has secrets run. The pi key list is also duplicated (#2534). Impact: low.
| if !plainWord.MatchString(promptFile) { | ||
| return out, fmt.Errorf("lane: the prompt path %q has characters a pane's shell would read differently; use a PromptDir of letters, digits and _ . / : \\ ~ -", promptFile) | ||
| } |
There was a problem hiding this comment.
Possible Issue
THEORETICAL: Handoff calls Fetch only on the create path. In the reuse path (found && !Open), Open runs against a possibly stale branch with no fetch. Also, the plainWord check rejects any prompt directory containing spaces. For a repo path with spaces, lane next fails outright instead of falling back (the no-backend commands path also prints unquoted paths).
| func (h Herdr) Available() bool { | ||
| _, err := h.herdr("pane", "current") | ||
| return err == nil | ||
| } |
There was a problem hiding this comment.
Backend detection
THEORETICAL: Available() treats any error from herdr pane current (for example a transient failure) as "no backend". The command then silently degrades to printing commands and writing the prompt, even when herdr is installed. In that case the --agent default also fails with a different message. Low impact.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
The lane file and its prompt template are read by dotf lane next, so a diff that only touches them must not skip the tests.
Review triageReviewers: PR-Agent (github-actions, 5 findings, head
Also fixed during CI: Windows short paths ( |
# Conflicts: # docs/lessons/_index.md
CLI-119 (#2528): hand a finished lane to the next queued issue, in one deterministic command for any project, OS and agent.
Summary
dotf lane next [--agent] [--dry-run]takes the first open, unassigned issue of the repo's queue (.dotf/lane.json), creates its worktree off the base through the repository's parent checkout in herdr, writes the rendered prompt and types<this dotf> lane exec --agent <a> --prompt-file <f>into the new pane. The agent defaults to the one in the calling pane. It never removes a worktree, and a second run for an item a workspace already shows starts nothing. With no backend it prints the commands.dotf lane exec --agent <claude|pi|agy> --prompt-file <f>replaces the process with the agent's interactive command and passes the prompt as one argument: no shell, no quoting, same call from zsh, bash and PowerShell. On Windows dotf stays as the parent.lane.Backend(herdr first). The interface has no remove method, by design.dotf secrets run --only NAN_API_KEY,OPENROUTER_API_KEY: its keys come from a shell function that exec skips. The key list is now copied in four launchers: The pi and opencode key lists are copied into four launchers #2534.dotfon the pane's PATH, which resolved to the pinned release and answeredunknown command "lane"in the first real run.One PR instead of the two the spec planned: about 600 executable lines for one mechanism whose second half is useless without the first.
Evidence (details in
specs/CLI-119-lane-next/verification.md)lane nextruns on this Mac, successor started and answered: RESULT claude PASS, RESULT pi PASS, RESULT agy PASS (AC6 met).worktrees/*/*glob (agy ignores the worktrees/*/* trustedWorkspaces entry, so every successor session stops at a trust dialog #2533), fixed in its own PR fix(agy): trust the worktrees root, not a glob agy does not read #2536, which the owner lands. Without it, a machine's agy successor waits at a trust dialog.go build/vet/test,GOOS=windows go vet, golangci-lint 2.12.2 clean.Landing note
.dotf/lane-prompt.mdtells the successor to rundotf lane nexton landing. Until the release carryinglaneis theDOTF_VERSIONpin anddotf updateran, that command isunknown command "lane"(the same coupling as #2517). Run it from a build of this branch until then.SDD
Spec
CLI-119-lane-nextadded; WIP-limit exception recorded with--over-wip-limit(owner, 2026-10-14). The spec stays active until an independent review signs it.Knowledge