diff --git a/internal/agent/piagent.go b/internal/agent/piagent.go index 3cd7e765..e3d6c20d 100644 --- a/internal/agent/piagent.go +++ b/internal/agent/piagent.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "log" "net/http" "os" "os/exec" @@ -191,6 +192,7 @@ func probeRunnerDataRoot(ctx context.Context, runnerURL string) (string, bool) { return "", false } runnerDataRoots.Store(runnerURL, root) + log.Printf("pi runner data_dir check passed") return root, true } @@ -205,6 +207,7 @@ func workDirWithinRunnerRoot(workDir, root string) bool { func (p *PiAgentBackend) executeRemote(ctx context.Context, runnerURL string, req Request, workDir string, timeout time.Duration) (*Result, error) { if root, ok := probeRunnerDataRoot(ctx, runnerURL); ok && !workDirWithinRunnerRoot(workDir, root) { // Do not include either path: the caller classifies this phrase, and paths leak host layout. + log.Printf("pi runner data root mismatch; refusing /v1/run") return &Result{Success: false, ErrorReason: "pi runner data root mismatch"}, nil }