Repository navigation
refactor(setup): simplify agent setup and stop blocking on strictness - #82
Open
cooper (czxtm) wants to merge 1 commit into
Open
cooper (czxtm) wants to merge 1 commit into
cooper (czxtm) wants to merge 1 commit into
Conversation
The agent may now edit any repository file the setup needs; the user reviews the result in Git. Removed: the Git guard that protected dirty files and aborted on index/HEAD changes, saved malformed-reply recovery, strict reply and plan validation, fatal permission denials and provider warnings, the separate flake-lock step, retained required checks, and 15-minute stage limits. Replies are parsed leniently (first usable JSON object, truncated or fenced JSON, unusable entries dropped); prose becomes the plan summary or a completed turn. Doctor still checks the result with one repair turn, skipped checks are not failures, and remaining problems are reported instead of blocking runtime setup. New files and Nix inputs are still exposed to flakes with intent-to-add.
Contributor
|
Preview deployed to |
Contributor
|
Docs preview deployed to |
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 #81.
Why
Every reported
stack setup --experimental-agentrun failed. None of them failed because the setup itself was broken. They stopped on host-side strictness: protected user files, fixed reply formats, permission denials, and saved-reply recovery loops. Because the user asked for the setup and can revert anything from Git, this PR removes those blockers. Doctor is kept as the check.What changed
Removed
.stack/config.nixandflake.nix. Setup still never commits, stages content, or reverts anything.setup_agent_reply.go): pending replies, formatting retries, and their manifest fields.DisallowUnknownFields, exact-one-object parsing, the 1–8 question rule, and plan or prepare validation that rejected a whole reply.errorevents (also sent for reconnects), and Claude permission denials for any tool. These are now warnings.nix flake lockstep and--no-update-lock-fileon setup shells. Entering the devshell locks normally.doctorreconciler-presence gate, and 15-minute stage limits (now a one-hour hang guard).--version.Lenient instead
ParseReplytakes the first usable JSON object in a reply. This covers prose and Markdown fences, cut-off JSON (it closes strings, brackets, and braces), bare plan objects, and status synonyms. It drops unusable entries, such as paths outside the repository or duplicate IDs, instead of rejecting the reply. A mistyped value, for example"exists":"yes", is not decoded partially.blockedis shown as a warning before the changes are checked.--template,--flake,--agent-model, or addon flags on a rerun starts a new plan instead of erroring. A manifest that can't be read starts a new setup.Kept
doctor --onboarding.Net change: −1,232 lines across 23 files. The setup docs (
apps/docs/content/docs/cli/setup.mdx) were rewritten to match.Test plan
go vet ./cmd/... ./internal/...andgo test ./cmd/... ./internal/...pass.tests/test-agent-setup.shpasses all 18 scenarios against the real CLI and doctor. New scenarios: the agent editing dirty and tracked user files, prose replies, a devshell failure followed by a repair turn, and Claude Bash/Glob denials.pkg/nixdataTestSetKeyalso fails on the base branch.pkg/nixevalTestNixEvalrequiresSTACKPANEL_ROOTfrom the devshell. Neither package is touched here.