detached 0c5f8d5

Merge pull request #80 from bnema/fix/ci-flaky-tests

fix(subagents): skip directory sync on Windows
commit
0c5f8d503bab14dc5f593f9c0e3533c04c81b024
author
bnema · · 2026-08-08 10:11 UTC
committer
GitHub · · 2026-08-08 10:11 UTC
merge of
4bf48bc + f0a524b · diff against the first parent
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
refs
tag: v0.12.0
3 files · +29 -11
M packages/agent/subagents/persist.go +3 -11
@@ -226,19 +226,11 @@ func writeAgentMeta(stateDir string, a *Agent) error {
226226 return fmt.Errorf("subagent meta rename: %w", err)
227227 }
228228 removeTemp = false
229- // Sync the containing directory so the rename itself survives a host
230- // crash, not just the bytes in the temporary file.
231- dir, err := os.Open(stateDir)
232- if err != nil {
233- return fmt.Errorf("subagents meta directory open: %w", err)
234- }
235- if err := dir.Sync(); err != nil {
236- _ = dir.Close()
229+ // Sync the containing directory where the platform supports it so the
230+ // rename itself survives a host crash, not just the temporary file bytes.
231+ if err := syncDirectory(stateDir); err != nil {
237232 return fmt.Errorf("subagents meta directory sync: %w", err)
238233 }
239- if err := dir.Close(); err != nil {
240- return fmt.Errorf("subagents meta directory close: %w", err)
241- }
242234 return nil
243235 }
244236
@@ -226,19 +226,11 @@ func writeAgentMeta(stateDir string, a *Agent) error {
226 return fmt.Errorf("subagent meta rename: %w", err)226 return fmt.Errorf("subagent meta rename: %w", err)
227 }227 }
228 removeTemp = false228 removeTemp = false
229- // Sync the containing directory so the rename itself survives a host229+ // Sync the containing directory where the platform supports it so the
230- // crash, not just the bytes in the temporary file.230+ // rename itself survives a host crash, not just the temporary file bytes.
231- dir, err := os.Open(stateDir)231+ if err := syncDirectory(stateDir); err != nil {
232- if err != nil {
233- return fmt.Errorf("subagents meta directory open: %w", err)
234- }
235- if err := dir.Sync(); err != nil {
236- _ = dir.Close()
237 return fmt.Errorf("subagents meta directory sync: %w", err)232 return fmt.Errorf("subagents meta directory sync: %w", err)
238 }233 }
239- if err := dir.Close(); err != nil {
240- return fmt.Errorf("subagents meta directory close: %w", err)
241- }
242 return nil234 return nil
243 }235 }
244 236
A packages/agent/subagents/syncdir_unix.go +17 -0
@@ -0,0 +1,17 @@
1+//go:build !windows
2+
3+package subagents
4+
5+import "os"
6+
7+func syncDirectory(path string) error {
8+ dir, err := os.Open(path)
9+ if err != nil {
10+ return err
11+ }
12+ if err := dir.Sync(); err != nil {
13+ _ = dir.Close()
14+ return err
15+ }
16+ return dir.Close()
17+}
@@ -0,0 +1,17 @@
1+//go:build !windows
2+
3+package subagents
4+
5+import "os"
6+
7+func syncDirectory(path string) error {
8+ dir, err := os.Open(path)
9+ if err != nil {
10+ return err
11+ }
12+ if err := dir.Sync(); err != nil {
13+ _ = dir.Close()
14+ return err
15+ }
16+ return dir.Close()
17+}
A packages/agent/subagents/syncdir_windows.go +9 -0
@@ -0,0 +1,9 @@
1+//go:build windows
2+
3+package subagents
4+
5+// Windows does not support syncing a directory handle through os.File.Sync.
6+// The metadata file itself is synced before the atomic rename.
7+func syncDirectory(string) error {
8+ return nil
9+}
@@ -0,0 +1,9 @@
1+//go:build windows
2+
3+package subagents
4+
5+// Windows does not support syncing a directory handle through os.File.Sync.
6+// The metadata file itself is synced before the atomic rename.
7+func syncDirectory(string) error {
8+ return nil
9+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close