7be7aede8b
Codex was the only agent that bind-mounted its host home into the
container via an explicit `Mounts: [{home}/.codex → /root/.codex]`
entry, while every other ACP agent uses `SessionConfig.SessionDirTemplate`
+ `SessionDirTarget`. Move codex onto the same surface so the
host-state isolation work in the next commit covers it uniformly.
This change alone does not stop the host-state leak — the bind mount
still resolves to the host's ~/.codex for now — but it removes the
last agent-specific branch in the runtime config so the docker
container manager can apply one rule for all agents.
30 lines
688 B
Go
30 lines
688 B
Go
package agents
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestCodexACPRuntimeNoLongerBindMountsHostHome(t *testing.T) {
|
|
a := NewCodexACP()
|
|
rt := a.Runtime()
|
|
|
|
for _, m := range rt.Mounts {
|
|
if strings.Contains(m.Source, "{home}") {
|
|
t.Fatalf("codex Mounts unexpectedly references {home}: %+v", m)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestCodexACPSessionDirTemplate(t *testing.T) {
|
|
a := NewCodexACP()
|
|
cfg := a.Runtime().SessionConfig
|
|
|
|
if cfg.SessionDirTemplate != "{home}/.codex" {
|
|
t.Fatalf("SessionDirTemplate = %q, want %q", cfg.SessionDirTemplate, "{home}/.codex")
|
|
}
|
|
if cfg.SessionDirTarget != "/root/.codex" {
|
|
t.Fatalf("SessionDirTarget = %q, want %q", cfg.SessionDirTarget, "/root/.codex")
|
|
}
|
|
}
|