Merge branch 'main' into codex/configurable-auto-compact-threshold
3 files · +12 -1
M packages/agent/modes/swarm_slash_test.go +4 -0
| @@ -2,6 +2,7 @@ package modes | |||
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "context" | |
| 5 | + | "runtime" | |
| 5 | 6 | "testing" | |
| 6 | 7 | "time" | |
| 7 | 8 | ||
| @@ -100,6 +101,9 @@ func TestRunSwarmNewSpawnsAgent(t *testing.T) { | |||
| 100 | 101 | // then asserts the /swarm send <id> <text...> path routes through | |
| 101 | 102 | // Swarm.SendUserTurn and lands at the agent verbatim. | |
| 102 | 103 | func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) { | |
| 104 | + | if runtime.GOOS == "windows" { | |
| 105 | + | t.Skip("swarm inbox transport uses Unix-domain sockets") | |
| 106 | + | } | |
| 103 | 107 | root := t.TempDir() | |
| 104 | 108 | recv := make(chan string, 4) | |
| 105 | 109 | ready := make(chan error, 1) | |
| @@ -2,6 +2,7 @@ package modes | |||||
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "context" | 4 | "context" | ||
| 5 | + | "runtime" | |||
| 5 | "testing" | 6 | "testing" | ||
| 6 | "time" | 7 | "time" | ||
| 7 | 8 | ||||
| @@ -100,6 +101,9 @@ func TestRunSwarmNewSpawnsAgent(t *testing.T) { | |||||
| 100 | // then asserts the /swarm send <id> <text...> path routes through | 101 | // then asserts the /swarm send <id> <text...> path routes through | ||
| 101 | // Swarm.SendUserTurn and lands at the agent verbatim. | 102 | // Swarm.SendUserTurn and lands at the agent verbatim. | ||
| 102 | func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) { | 103 | func TestRunSwarmSendDeliversToAgentInbox(t *testing.T) { | ||
| 104 | + | if runtime.GOOS == "windows" { | |||
| 105 | + | t.Skip("swarm inbox transport uses Unix-domain sockets") | |||
| 106 | + | } | |||
| 103 | root := t.TempDir() | 107 | root := t.TempDir() | ||
| 104 | recv := make(chan string, 4) | 108 | recv := make(chan string, 4) | ||
| 105 | ready := make(chan error, 1) | 109 | ready := make(chan error, 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 | ||