Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/declaration.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func discoverWithCheck(parent context.Context, options agent.DiscoveryOptions, i
for _, capability := range []*proto.CapabilitySupport{&caps.LocalEnvironment, &caps.WorkspaceReadPreparation, &caps.WorkspaceOutputExport, &caps.RetainedNativeHistory} {
agent.Narrow(capability, local)
}
runtime.Executor = NewExecutorFactory(options.StateRoot)
runtime.Executor = NewExecutorFactory(options.StateRoot, options.RuntimeRoot)
fmt.Fprintf(options.Stdout, "Codex preflight ok (%s)\n", version)
return runtime
}
4 changes: 2 additions & 2 deletions apps/daemon/internal/agent/codex/error_classification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestClassificationOnlyFromRootTerminalError(t *testing.T) {
for _, mode := range []string{"failed", "recovered", "notification-only"} {
t.Run(mode, func(t *testing.T) {
out := make(chan proto.Envelope, 16)
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t)), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s.registerHandlers()
s.setThreadID("root")
scopeNotification(t, s, "turn/started", `{"threadId":"root","turn":{"id":"turn"}}`)
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestProviderRejectionClassifiedOnce(t *testing.T) {
}
}
out := make(chan proto.Envelope, 16)
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t)), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s.registerHandlers()
s.setThreadID("root")
turnError, _ := json.Marshal(TurnError{Message: body, CodexErrorInfo: json.RawMessage(`"other"`)})
Expand Down
8 changes: 4 additions & 4 deletions apps/daemon/internal/agent/codex/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type Executor struct {
closeMu sync.Mutex
}

func PrepareExecutor(ctx context.Context, stateRoot string, req proto.PromptRequestPayload) (agent.Executor, error) {
return newExecutor(ctx, req, defaultSessionConfig(stateRoot))
func PrepareExecutor(ctx context.Context, stateRoot, runtimeRoot string, req proto.PromptRequestPayload) (agent.Executor, error) {
return newExecutor(ctx, req, defaultSessionConfig(stateRoot, runtimeRoot))
}

func newExecutor(ctx context.Context, req proto.PromptRequestPayload, cfg sessionConfig) (*Executor, error) {
Expand Down Expand Up @@ -172,8 +172,8 @@ func (e *Executor) Close(ctx context.Context) error {

var _ agent.Executor = (*Executor)(nil)

func NewExecutorFactory(stateRoot string) agent.ExecutorFactory {
func NewExecutorFactory(stateRoot, runtimeRoot string) agent.ExecutorFactory {
return func(ctx context.Context, req proto.PromptRequestPayload) (agent.Executor, error) {
return PrepareExecutor(ctx, stateRoot, req)
return PrepareExecutor(ctx, stateRoot, runtimeRoot, req)
}
}
4 changes: 2 additions & 2 deletions apps/daemon/internal/agent/codex/mcp_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ func TestWriteCodexMCPConfig_EmitsStreamableHTTPURL(t *testing.T) {

// TestWriteCodexMCPConfig_FreshHomeDropsStaleEntries documents the
// "fresh entries only" guarantee: callers allocate a brand-new
// CODEX_HOME per prompt (BuildSessionPlan does this via allocCodexHome
// CODEX_HOME per prompt (BuildSessionPlan does this via allocSessionDir
// + plan.Cleanup), so the previous run's mcp_servers can't leak.
//
// writeCodexMCPConfig itself is APPEND semantics now — the truncation
// guarantee lives in allocCodexHome's RemoveAll, not in the writer.
// guarantee lives in allocSessionDir's RemoveAll, not in the writer.
// Test that workflow explicitly so a future refactor that breaks the
// fresh-home contract fails here.
func TestWriteCodexMCPConfig_FreshHomeDropsStaleEntries(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions apps/daemon/internal/agent/codex/mcp_http_bearer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestMCPHTTPBearerPlanSeparatesServersAndProcesses(t *testing.T) {
req := proto.PromptRequestPayload{AgentStateKey: "retained-mcp", DisableExecutionEnvironment: true, MCPHTTPServers: &servers}
seen := map[string]bool{}
for range 2 {
plan, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t)))
plan, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t), t.TempDir()))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -58,7 +58,7 @@ func TestMCPHTTPBearerRejectsInvalidTokensWithoutPersistence(t *testing.T) {
for _, token := range []string{"", "=", " has-space", "has-space ", "has space", "line\r\ninjection", "nul\x00byte", "opaque中文", "middle=padding", "punctuation:invalid"} {
servers := []proto.MCPHTTPServer{{ConnectionOrigin: "service", ServerLabel: "tools", ServerURL: "https://tools.example/mcp", BearerToken: &token}}
req := proto.PromptRequestPayload{AgentStateKey: "invalid-bearer", DisableExecutionEnvironment: true, MCPHTTPServers: &servers}
if _, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t))); err == nil || err.Error() != "invalid HTTPS MCP bearer credential" {
if _, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t), t.TempDir())); err == nil || err.Error() != "invalid HTTPS MCP bearer credential" {
t.Fatal("invalid bearer value accepted or unsafe error returned")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestPublicMCPHTTPPreparationChecksBeforeNewAndResumedThread(t *testing.T) {
t.Fatal(err)
}
assertPreparationOnly(t, root)
home, err := allocCodexHome(testStateRoot(t), req.AgentStateKey)
home, err := allocSessionDir(testStateRoot(t), req.AgentStateKey)
if err != nil {
t.Fatal(err)
}
Expand Down
10 changes: 5 additions & 5 deletions apps/daemon/internal/agent/codex/mcp_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPublicMCPHTTPPlanOwnsConfigurationAndPreservesHistory(t *testing.T) {
{ConnectionOrigin: "service", ServerLabel: "blocked", ServerURL: "http://127.0.0.1:12345/mcp", AllowedTools: &denyAll},
}
req := proto.PromptRequestPayload{AgentStateKey: "public-mcp", DisableExecutionEnvironment: true, MCPHTTPServers: &servers}
plan, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t)))
plan, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t), t.TempDir()))
if err != nil {
t.Fatal(err)
}
Expand All @@ -31,7 +31,7 @@ func TestPublicMCPHTTPPlanOwnsConfigurationAndPreservesHistory(t *testing.T) {
!slices.Contains(plan.ExtraConfig, [2]string{"shell_environment_policy.exclude", `["OAC_RUNTIME_MCP_*"]`}) {
t.Fatal("native profile kept only credential isolation")
}
home, err := allocCodexHome(testStateRoot(t), req.AgentStateKey)
home, err := allocSessionDir(testStateRoot(t), req.AgentStateKey)
if err != nil {
t.Fatal(err)
}
Expand All @@ -56,7 +56,7 @@ func TestPublicMCPHTTPPlanOwnsConfigurationAndPreservesHistory(t *testing.T) {
t.Fatal(err)
}
servers = []proto.MCPHTTPServer{{ConnectionOrigin: "service", ServerLabel: "replacement", ServerURL: "https://new.example/mcp"}}
second, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t)))
second, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t), t.TempDir()))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestPublicMCPHTTPRejectsInvalidProfileAndStoredCredentials(t *testing.T) {
}
}
t.Setenv("OAC_RUNTIME_HOME", t.TempDir())
home, err := allocCodexHome(testStateRoot(t), "credentials")
home, err := allocSessionDir(testStateRoot(t), "credentials")
if err != nil {
t.Fatal(err)
}
Expand All @@ -101,7 +101,7 @@ func TestPublicMCPHTTPRejectsInvalidProfileAndStoredCredentials(t *testing.T) {
t.Fatal(err)
}
req := proto.PromptRequestPayload{AgentStateKey: "credentials", DisableExecutionEnvironment: true, MCPHTTPServers: &valid}
if _, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t))); err == nil {
if _, _, err := prepareSessionPlan(t.Context(), req, defaultSessionConfig(testStateRoot(t), t.TempDir())); err == nil {
t.Fatal("existing MCP credentials accepted")
}
if after, err := os.ReadFile(path); err != nil || !reflect.DeepEqual(after, stored) {
Expand Down
8 changes: 4 additions & 4 deletions apps/daemon/internal/agent/codex/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func BuildSessionPlan(stateRoot, agentStateKey string, opts map[string]any, cont
plan.Model = stringOpt(opts, "model")
plan.SystemPrompt = stringOpt(opts, "system_prompt")

codexHome, err := allocCodexHome(stateRoot, agentStateKey)
codexHome, err := allocSessionDir(stateRoot, agentStateKey)
if err != nil {
return plan, err
}
Expand Down Expand Up @@ -212,9 +212,9 @@ func applyExecutionControls(plan *SessionPlan, controls *proto.ExecutionControls
// helpers
// ---------------------------------------------------------------------------

func allocCodexHome(root, agentStateKey string) (string, error) {
func allocSessionDir(root, agentStateKey string) (string, error) {
if strings.TrimSpace(agentStateKey) == "" {
return "", fmt.Errorf("codex: agentStateKey required for CODEX_HOME allocation")
return "", fmt.Errorf("codex: agentStateKey required for a Session directory")
}
if !filepath.IsAbs(root) || filepath.Clean(root) != root {
return "", fmt.Errorf("codex: state root must be a clean absolute directory")
Expand All @@ -232,7 +232,7 @@ func allocCodexHome(root, agentStateKey string) (string, error) {
dirParts := append([]string{root, "daemon", "agent-sessions"}, safeParts...)
dir := filepath.Join(dirParts...)
if err := os.MkdirAll(dir, 0o700); err != nil {
return "", fmt.Errorf("codex: create CODEX_HOME %s: %w", dir, err)
return "", fmt.Errorf("codex: create Session directory %s: %w", dir, err)
}
return dir, nil
}
Expand Down
10 changes: 6 additions & 4 deletions apps/daemon/internal/agent/codex/permission_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestRuntimeUsesHostPermissions(t *testing.T) {
t.Setenv("OAC_RUNTIME_HOME", t.TempDir())
{
req := proto.PromptRequestPayload{AgentStateKey: "session", DisableSubagents: true, LocalEnvironment: &proto.LocalEnvironment{WorkspaceRoot: t.TempDir()}}
plan, _, err := prepareSessionPlan(t.Context(), req, sessionConfig{stateRoot: testStateRoot(t)})
plan, _, err := prepareSessionPlan(t.Context(), req, sessionConfig{stateRoot: testStateRoot(t), runtimeRoot: t.TempDir()})
if err != nil {
t.Fatal(err)
}
Expand All @@ -32,12 +32,13 @@ func TestSelfHostedToolEnvironmentCannotRedirectNativeHistory(t *testing.T) {
root := t.TempDir()
t.Setenv("OAC_RUNTIME_HOME", root)
config := filepath.Join(root, "tool-env.json")
if err := os.WriteFile(config, []byte(`{"CODEX_HOME":"wrong","HOME":"wrong","USERPROFILE":"wrong","USER_VALUE":"ready"}`), 0600); err != nil {
if err := os.WriteFile(config, []byte(`{"CODEX_HOME":"wrong","CODEX_SQLITE_HOME":"wrong","HOME":"wrong","USERPROFILE":"wrong","USER_VALUE":"ready"}`), 0600); err != nil {
t.Fatal(err)
}
t.Setenv("OAC_RUNTIME_TOOL_ENV_FILE", config)
req := proto.PromptRequestPayload{AgentStateKey: "session", DisableSubagents: true, LocalEnvironment: &proto.LocalEnvironment{}}
plan, _, err := prepareSessionPlan(t.Context(), req, sessionConfig{stateRoot: testStateRoot(t)})
runtimeRoot := t.TempDir()
plan, _, err := prepareSessionPlan(t.Context(), req, sessionConfig{stateRoot: testStateRoot(t), runtimeRoot: runtimeRoot})
if err != nil {
t.Fatal(err)
}
Expand All @@ -47,7 +48,8 @@ func TestSelfHostedToolEnvironmentCannotRedirectNativeHistory(t *testing.T) {
key, value, _ := strings.Cut(entry, "=")
values[key] = value
}
if values["CODEX_HOME"] == "" || values["CODEX_HOME"] == "wrong" || values["HOME"] == "wrong" || values["USERPROFILE"] == "wrong" || values["USER_VALUE"] != "ready" {
if values["CODEX_HOME"] == "" || values["CODEX_HOME"] == "wrong" || values["HOME"] == "wrong" || values["USERPROFILE"] == "wrong" || values["USER_VALUE"] != "ready" ||
values["CODEX_SQLITE_HOME"] != filepath.Join(runtimeRoot, "daemon", "agent-sessions", "session") {
t.Fatal("initialization changed native state identity")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func preparationFixture(t *testing.T) (proto.PromptRequestPayload, sessionConfig
if err := os.WriteFile(binary, []byte(body), 0o700); err != nil {
t.Fatal(err)
}
cfg := defaultSessionConfig(testStateRoot(t))
cfg := defaultSessionConfig(testStateRoot(t), t.TempDir())
cfg.codexBinary = binary
req := proto.PromptRequestPayload{
AgentKind: "codex", AgentStateKey: "prepared-session",
Expand Down
6 changes: 3 additions & 3 deletions apps/daemon/internal/agent/codex/provider_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func TestProviderCredentialOnlyInNativeLoopEnvironment(t *testing.T) {
func TestExplicitStateRootSurvivesRuntimeReplacement(t *testing.T) {
state := t.TempDir()
t.Setenv("OAC_RUNTIME_HOME", t.TempDir())
first, err := allocCodexHome(state, "stable-session")
first, err := allocSessionDir(state, "stable-session")
if err != nil {
t.Fatal(err)
}
Expand All @@ -272,7 +272,7 @@ func TestExplicitStateRootSurvivesRuntimeReplacement(t *testing.T) {
t.Fatal(err)
}
t.Setenv("OAC_RUNTIME_HOME", t.TempDir())
second, err := allocCodexHome(state, "stable-session")
second, err := allocSessionDir(state, "stable-session")
if err != nil || second != first {
t.Fatal("instance identity changed native history", err)
}
Expand All @@ -283,7 +283,7 @@ func TestExplicitStateRootSurvivesRuntimeReplacement(t *testing.T) {
if err = os.WriteFile(unavailable, nil, 0600); err != nil {
t.Fatal(err)
}
if _, err = allocCodexHome(unavailable, "stable-session"); err == nil {
if _, err = allocSessionDir(unavailable, "stable-session"); err == nil {
t.Fatal("unavailable explicit root fell back")
}
}
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestPreparedRecoveryCannotStartWithoutExistingHistory(t *testing.T) {
t.Run(environment, func(t *testing.T) {
req, cfg, root := preparationFixture(t)
req.RequireExistingNativeSession = true
cwd, err := allocCodexHome(testStateRoot(t), req.AgentStateKey)
cwd, err := allocSessionDir(testStateRoot(t), req.AgentStateKey)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/rpc_close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestJSONRPCClientCloseCanRetryUnreapedChild(t *testing.T) {
closeConcurrently(true)
ownerCtx, cancelOwner := context.WithCancel(t.Context())
s := &Session{rpc: client, cancelCtx: ownerCtx, cancelFn: cancelOwner,
cfg: defaultSessionConfig(testStateRoot(t)), bufs: NewItemBuffers()}
cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), bufs: NewItemBuffers()}
ctx, cancelWait := context.WithTimeout(t.Context(), 20*time.Millisecond)
defer cancelWait()
if err := s.Cancel(ctx); !errors.Is(err, context.DeadlineExceeded) {
Expand Down
4 changes: 3 additions & 1 deletion apps/daemon/internal/agent/codex/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ const terminalSendTimeout = 2 * time.Second
// defaultSessionConfig.
type sessionConfig struct {
stateRoot string
runtimeRoot string
codexBinary string
logger *slog.Logger
killTimeout time.Duration
}

func defaultSessionConfig(stateRoot string) sessionConfig {
func defaultSessionConfig(stateRoot, runtimeRoot string) sessionConfig {
return sessionConfig{
stateRoot: stateRoot,
runtimeRoot: runtimeRoot,
codexBinary: defaultBinary(),
logger: obslog.Bg(),
killTimeout: rpcKillTimeout,
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/session_cancel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func cancellationTestSession(t *testing.T) (*Session, *TestClient, ServerSide) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
s := &Session{rpc: client.JSONRPCClient, cancelCtx: ctx, cancelFn: cancel,
cfg: defaultSessionConfig(testStateRoot(t)), out: make(chan proto.Envelope, 8), bufs: NewItemBuffers()}
cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), out: make(chan proto.Envelope, 8), bufs: NewItemBuffers()}
return s, client, server
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func TestCancelReleasesBlockedNativeProcess(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
s := &Session{rpc: client, cancelCtx: ctx, cancelFn: cancel,
cfg: defaultSessionConfig(testStateRoot(t)), bufs: NewItemBuffers()}
cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), bufs: NewItemBuffers()}
s.setThreadID("native-thread")
s.onTurnStarted(json.RawMessage(`{"threadId":"native-thread","turn":{"id":"native-turn"}}`))
cancelDone := make(chan struct{})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestCommandOutputRequiresRootTurn(t *testing.T) {
out := make(chan proto.Envelope, 10)
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t)), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()), rpc: NewJSONRPCClient(JSONRPCConfig{})}
s.registerHandlers()
s.setThreadID("root")
s.beginRootTurn("root", "turn")
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/session_items_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestDispatchStartedItem_UnknownSilent(t *testing.T) {
func TestReasoningIsReportedOnlyWhenRequested(t *testing.T) {
for _, requested := range []bool{true, false} {
out := make(chan proto.Envelope, 16)
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t)),
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir()),
rpc: NewJSONRPCClient(JSONRPCConfig{}), bufs: NewItemBuffers(), reasoningSummary: requested}
s.registerHandlers()
s.setThreadID("root")
Expand Down
2 changes: 1 addition & 1 deletion apps/daemon/internal/agent/codex/session_messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestMessageObservationKeepsNativeBoundaries(t *testing.T) {
out := make(chan proto.Envelope, 16)
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), bufs: NewItemBuffers(), cfg: defaultSessionConfig(testStateRoot(t))}
s := &Session{runID: "run", out: out, cancelCtx: context.Background(), bufs: NewItemBuffers(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir())}
s.setThreadID("thread")
s.onTurnStarted(json.RawMessage(`{"threadId":"thread","turn":{"id":"turn"}}`))
s.onItemStarted(json.RawMessage(`{"threadId":"thread","turnId":"turn","item":{"type":"agentMessage","id":"a","phase":"commentary"}}`))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestRootRPCNotificationOrdering(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
out := make(chan proto.Envelope, 16)
s := &Session{runID: "run", out: out, rpc: client.JSONRPCClient, cancelCtx: ctx, bufs: NewItemBuffers(), cfg: defaultSessionConfig(testStateRoot(t))}
s := &Session{runID: "run", out: out, rpc: client.JSONRPCClient, cancelCtx: ctx, bufs: NewItemBuffers(), cfg: defaultSessionConfig(testStateRoot(t), t.TempDir())}
s.registerHandlers()
barrier := make(chan struct{}, 1)
client.OnNotification("test/barrier", func(json.RawMessage) { barrier <- struct{}{} })
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestThreadRPCResponseRequiresRootIdentity(t *testing.T) {
defer cleanup()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
s := &Session{rpc: client.JSONRPCClient, cancelCtx: ctx, cfg: defaultSessionConfig(testStateRoot(t))}
s := &Session{rpc: client.JSONRPCClient, cancelCtx: ctx, cfg: defaultSessionConfig(testStateRoot(t), t.TempDir())}
s.registerHandlers()
result := make(chan error, 1)
go func() { result <- s.resumeThread("root", SessionPlan{}) }()
Expand Down
Loading
Loading