Skip to content

Prevent gx doctor from hijacking the active checkout during sandbox startup#83

Merged
NagyVikt merged 3 commits intomainfrom
agent/codex/pia-edix-hu-dup-2-gx-doctor-keep-local-branch
Apr 13, 2026
Merged

Prevent gx doctor from hijacking the active checkout during sandbox startup#83
NagyVikt merged 3 commits intomainfrom
agent/codex/pia-edix-hu-dup-2-gx-doctor-keep-local-branch

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by scripts/agent-branch-finish.sh (PR flow).

NagyVikt and others added 3 commits April 13, 2026 23:04
…tartup

Some repos may still carry a legacy or custom scripts/agent-branch-start.sh that performs in-place branch checkout. doctor now treats that as unsafe, restores the protected base branch when needed, and falls back to internal git worktree sandbox creation so the user-visible checkout stays on main.

Constraint: doctor must preserve the protected base checkout while still repairing drift automatically

Rejected: Trust repo-local agent-branch-start output unconditionally | can switch the base worktree to an agent branch

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Keep doctor sandbox startup tolerant of legacy starter scripts and always verify base checkout remained unchanged

Tested: node --check bin/multiagent-safety.js; node --test test/install.test.js; npm test
@NagyVikt NagyVikt merged commit c7d26a8 into main Apr 13, 2026
7 checks passed
@NagyVikt NagyVikt deleted the agent/codex/pia-edix-hu-dup-2-gx-doctor-keep-local-branch branch April 13, 2026 21:30
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