Preserve Windows swarm construction
- commit
- 1eeff3afef5b3fc177be1ea2c7376e48fded27bf
- author
- patriceckhart · · 2026-07-28 11:18 UTC
- parent
- 6b2855e
- signature
- unsigned
2 files · +8 -1
M packages/agent/swarm/persist_test.go +4 -0
| @@ -6,6 +6,7 @@ import ( | |||
| 6 | 6 | "errors" | |
| 7 | 7 | "os" | |
| 8 | 8 | "path/filepath" | |
| 9 | + | "runtime" | |
| 9 | 10 | "strings" | |
| 10 | 11 | "sync" | |
| 11 | 12 | "sync/atomic" | |
| @@ -344,6 +345,9 @@ func TestResumeRestartsRunnerOnSameSession(t *testing.T) { | |||
| 344 | 345 | } | |
| 345 | 346 | ||
| 346 | 347 | func TestResumeRecalculatesLegacyStateInboxPath(t *testing.T) { | |
| 348 | + | if runtime.GOOS == "windows" { | |
| 349 | + | t.Skip("swarm inbox runtime relocation applies to Unix sockets") | |
| 350 | + | } | |
| 347 | 351 | root := t.TempDir() | |
| 348 | 352 | f := New(Config{ | |
| 349 | 353 | Root: root, RepoRoot: root, | |
| @@ -6,6 +6,7 @@ import ( | |||||
| 6 | "errors" | 6 | "errors" | ||
| 7 | "os" | 7 | "os" | ||
| 8 | "path/filepath" | 8 | "path/filepath" | ||
| 9 | + | "runtime" | |||
| 9 | "strings" | 10 | "strings" | ||
| 10 | "sync" | 11 | "sync" | ||
| 11 | "sync/atomic" | 12 | "sync/atomic" | ||
| @@ -344,6 +345,9 @@ func TestResumeRestartsRunnerOnSameSession(t *testing.T) { | |||||
| 344 | } | 345 | } | ||
| 345 | 346 | ||||
| 346 | func TestResumeRecalculatesLegacyStateInboxPath(t *testing.T) { | 347 | func TestResumeRecalculatesLegacyStateInboxPath(t *testing.T) { | ||
| 348 | + | if runtime.GOOS == "windows" { | |||
| 349 | + | t.Skip("swarm inbox runtime relocation applies to Unix sockets") | |||
| 350 | + | } | |||
| 347 | root := t.TempDir() | 351 | root := t.TempDir() | ||
| 348 | f := New(Config{ | 352 | f := New(Config{ | ||
| 349 | Root: root, RepoRoot: root, | 353 | Root: root, RepoRoot: root, | ||
M packages/agent/swarm/socketpath.go +4 -1
| @@ -33,7 +33,10 @@ const maxUnixSocketPath = 100 | |||
| 33 | 33 | // stable path across parent and child processes and across Resume calls. | |
| 34 | 34 | func inboxSocketPath(root, agentID string) (string, error) { | |
| 35 | 35 | if runtime.GOOS == "windows" { | |
| 36 | - | return "", fmt.Errorf("swarm inbox: unix sockets are not supported on %s", runtime.GOOS) | |
| 36 | + | // Keep swarm construction usable for callers with custom runners. | |
| 37 | + | // The production listener still reports that its unix transport is | |
| 38 | + | // unavailable, as it did before runtime-directory probing was added. | |
| 39 | + | return filepath.Join(root, "agents", agentID, "in.sock"), nil | |
| 37 | 40 | } | |
| 38 | 41 | ||
| 39 | 42 | var bases []string | |
| @@ -33,7 +33,10 @@ const maxUnixSocketPath = 100 | |||||
| 33 | // stable path across parent and child processes and across Resume calls. | 33 | // stable path across parent and child processes and across Resume calls. | ||
| 34 | func inboxSocketPath(root, agentID string) (string, error) { | 34 | func inboxSocketPath(root, agentID string) (string, error) { | ||
| 35 | if runtime.GOOS == "windows" { | 35 | if runtime.GOOS == "windows" { | ||
| 36 | - | return "", fmt.Errorf("swarm inbox: unix sockets are not supported on %s", runtime.GOOS) | 36 | + | // Keep swarm construction usable for callers with custom runners. |
| 37 | + | // The production listener still reports that its unix transport is | |||
| 38 | + | // unavailable, as it did before runtime-directory probing was added. | |||
| 39 | + | return filepath.Join(root, "agents", agentID, "in.sock"), nil | |||
| 37 | } | 40 | } | ||
| 38 | 41 | ||||
| 39 | var bases []string | 42 | var bases []string | ||