Skip to content

fix: run native Windows commands in Git Bash - #1909

Closed
AbirAbbas wants to merge 4 commits into
devfrom
abir/windows-shell-dev
Closed

AbirAbbas wants to merge 4 commits into
devfrom
abir/windows-shell-dev

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

What this fixes

On native Windows, codeaf ran every command through C:\Windows\System32\bash.exe. That is the WSL launcher, and it parses the line a second time inside Linux. Any PATH holding Program Files (x86) broke every command with syntax error near unexpected token '(', and $VARs came back empty.

This ports the Windows fixes of #1882, which landed on app/v3, to dev:

  • Shell choice. internal/shell picks, in order: CODEAF_BASH, then Git for Windows, then other standard install roots, then a non-WSL bash on PATH. It never picks the WSL launcher. Every door that starts a shell uses it: !, the model's bash, jobs, services, automations, task checks and verify.
  • No bash installed. The shell tool is absent, and a new manual page says to install Git for Windows. WSL keeps using Linux bash.
  • Paths and logs. Paths bash reads are spelled /c/..., while PLANDB_* stay native. Job and service logs open writable at their end, because Git Bash exits silently on an append-only stdout handle.
  • Plan-store file URIs. These now share fix: correct SQLite file URIs on Windows #1868's formatter on Windows. Unix plan readers keep the writer's raw bytes.

Left out because it exists only on app/v3: the factory checkstage/processgroup move, the desktop sidecar target, and app/v3-only readers and fixtures.

How it was checked

  • Native Windows (test binaries cross-built here and run on a real Windows 11 host with Git for Windows): the full internal/shell suite, the new session, exec, bare, plandb, verify and automation Windows tests, and the sqliteuri suite pass. Five manual retrieval probes pass on Linux and Windows.
  • Linux: focused proofs plus the full internal/session suite (4,403 tests) and internal/store pass, and the Darwin build passes. Unix argv, log flags, PATH exports and raw plan-writer bytes are pinned unchanged.
  • Failures this change doesn't cause (they fail without it too):
    • internal/workspace's eighty-handle writer test and internal/plandb's TestPlandbCliConcurrentWritersLandEveryTask hit SQLITE_BUSY under load on unchanged dev as well.
    • Several older Windows suites aren't portable: fake .exe-less tool stubs, POSIX path assertions, open-handle rename assumptions. Those are out of scope here.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits October 23, 2026 00:15
On native Windows codeaf's bash resolved to System32\bash.exe, the WSL
launcher, which parsed every line a second time inside Linux: a PATH holding
Program Files (x86) broke every command and $vars came back empty. The
shell now resolves CODEAF_BASH, then Git for Windows, then other standard
roots, then a non-WSL bash on PATH, and every door that starts a shell uses
it. Background job and service logs open writable at their end, because Git
Bash exits silently on an append-only handle. With no usable bash the shell
tool is absent and the manual says to install Git for Windows.

This ports the Windows fixes of #1882, which landed on app/v3, to dev.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas added a commit that referenced this pull request Oct 23, 2026
…ndows

Every command door runs through the executor with the shell internal/shell
resolves, so both branches hold: the new command runner and Git Bash on
Windows. Moving chats is present on Windows like on Linux and macOS: the
engine daemon starts without a console window on a short AF_UNIX socket,
persisted paths use '/', replacements retry transient Windows file locks,
names Windows refuses arrive under not brought along with the reason, and
task copies keep line endings. A chat sealed on Linux continues natively on
Windows and comes back with the same bytes and modes. GOOS=windows go vet
./... is clean. Windows pin hashes wait for the furrow v0.2.0 tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas added a commit that referenced this pull request Oct 23, 2026
…'s Git Bash

The WAL's compaction keeps the group-commit flush before its rename and
renames through fsreplace so a held file on Windows is retried. The change
entry and the manual keep both branches' lines.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas and others added 2 commits October 23, 2026 06:06
The environment registry law found it unregistered; a path to a program is
plumbing, like CODEAF_FURROW.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… door

dev's #1910 opens every plan store through sqliteuri.FromPath with an
escaped address on every platform, which already covers Windows drive
paths, so this branch's StoreURI (raw bytes on Unix, escaped on Windows) and
its tests go and every plan reader and writer uses dev's door.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas added a commit that referenced this pull request Oct 23, 2026
…ep dev's one URI door

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

Folded into #1888, which already carries every commit here (merged with today's dev). One feature branch, one pull request.

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