ci / vet-and-test (pull_request) Successful in 1m1s
Why: RDM starts the server through extension.Main, which dropped ExecDepsDir, ExecWorkspace, and ExecEnvRoot, so a deployed product ignored the layered Python environment. Evidence: go test ./pkg/extension/link/ passed on this worktree (SELF). Impact: a product binary reads the same AGENT_SYSTEM_EXEC_* variables as the base CLI when its own flags are empty; explicit Options still win. Refs: Agent-System-Dev PR 570 Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package link
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"agent-system-backend/pkg/extension"
|
|
)
|
|
|
|
func TestAppOptionsPrefersExplicitExecPaths(t *testing.T) {
|
|
t.Setenv("AGENT_SYSTEM_EXEC_DEPS_DIR", "/from/env/deps")
|
|
t.Setenv("AGENT_SYSTEM_EXEC_WORKSPACE", "overlay")
|
|
t.Setenv("AGENT_SYSTEM_EXEC_ENV_ROOT", "/from/env/root")
|
|
got := appOptions(extension.Options{
|
|
ExecDepsDir: "/explicit/deps",
|
|
ExecWorkspace: "direct",
|
|
ExecEnvRoot: "/explicit/root",
|
|
})
|
|
if got.ExecDepsDir != "/explicit/deps" || got.ExecWorkspace != "direct" || got.ExecEnvRoot != "/explicit/root" {
|
|
t.Fatalf("explicit paths lost: %+v", got)
|
|
}
|
|
}
|
|
|
|
func TestAppOptionsReadsExecEnvWhenUnset(t *testing.T) {
|
|
t.Setenv("AGENT_SYSTEM_EXEC_DEPS_DIR", "/from/env/deps")
|
|
t.Setenv("AGENT_SYSTEM_EXEC_WORKSPACE", "overlay")
|
|
t.Setenv("AGENT_SYSTEM_EXEC_ENV_ROOT", "/from/env/root")
|
|
got := appOptions(extension.Options{ExecBackend: "sandbox"})
|
|
if got.ExecBackend != "sandbox" || got.ExecDepsDir != "/from/env/deps" || got.ExecWorkspace != "overlay" || got.ExecEnvRoot != "/from/env/root" {
|
|
t.Fatalf("env fallback: %+v", got)
|
|
}
|
|
}
|