Repository navigation
fix(setupagent): unprotect .stack config files and clear stale pending replies - #81
Merged
Merged
Conversation
cooper (czxtm)
had a problem deploying
to
pr-81
November 8, 2026 10:18 — with
GitHub Actions
Failure
cooper (czxtm)
had a problem deploying
to
docs-preview
November 8, 2026 10:18 — with
GitHub Actions
Failure
cooper (czxtm)
had a problem deploying
to
docs-preview
November 8, 2026 10:38 — with
GitHub Actions
Failure
cooper (czxtm)
had a problem deploying
to
pr-81
November 8, 2026 10:38 — with
GitHub Actions
Failure
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.
Summary
Fixes two failure modes in
stack setup --experimental-agentand resolves the CInix-bunfailure:Preexisting untracked/modified
.stack/config files blockingclaudesetup (apps/stackpanel-go/cmd/cli/setup_agent.go,setup_agent_state.go):.stack/config.nix,.stack/data.nix, or.stack/reconcile.jsonon disk (e.g. from running non-agentstack setupornix flake initfirst),captureSetupGittreated them as protected user edits (ProtectedPaths) and flagged edits to.stack/config.nixas aGitViolation.allowStackpanelConfignow excludes.stack/config.nix,.stack/data.nix,.stack/reconcile.json, and.stack/addons.jsonfromgitGuard.protectedandGitViolation.Protected, and clears stalePreviousErrormessages referencing.stack/config.nix/.stack/data.nixso resumingstack setup --experimental-agent claudecan immediately write the agreed.stack/config.nix.Stale/unrecoverable
PendingReplyacross runs & agents (apps/stackpanel-go/cmd/cli/setup_agent_reply.go,setup_agent.go):AgentonsetupReplyRecovery. When switching--experimental-agentduringinspectionor whenPendingReply.Messageis plain-text prose (not starting with{), discardsstate.PendingReplyimmediately so the selected agent runs a fresh inspection.ReplyCorrectionPromptreturns{"status":"blocked",...}, always clearsstate.PendingReply = niland saves the manifest; if resuminginspection(read-only phase), falls back immediately to a fresh inspection turn instead of failing.Prevent
zshread-only temp file failures undercodex(apps/stackpanel-go/internal/setupagent/agent.go,prompt.go):SHELL=/bin/sh(and stripsZDOTDIR) incodex's environment so shell tool calls do not invoke interactivezshstartup scripts orzshtemp-file heredocs on a read-only sandbox filesystem.--yolofromcodex execargs so--sandbox read-only/workspace-writeremain enforced.Restore cached
flake.lockinputs and hardennix-bunCI action (flake.lock,nix/flake/integrations/prelude/flake-module.nix,.github/actions/nix-bun/action.yml):flake.lockto the revision cached indarkmatter.cachix.org(reverting an unintended lockfile bump from feat(flake): add devenvModules.default and disable unused Prelude workspace #77 that caused uncached GitHub tarball downloads to hit HTTP 504 timeouts onarc-ubunturunners) and guardsoptions.prelude.workspace.enableso it evaluates cleanly across both cached and newerpreluderevisions.--accept-flake-config,GITHUB_TOKENaccess-tokensconfiguration, and retry backoff to.github/actions/nix-bun/action.yml.Test Plan
go test ./cmd/cli/... ./internal/setupagent/...inapps/stackpanel-go./tests/test-agent-setup.sh(all 23 end-to-end scenarios pass)nix eval .#bun.outPathand GitHub Actions CI (CI Checks/typecheck,Deploy Web,Deploy Docs,CodeQL)