From 3ba15df8751bc216e69c1ede19511e95611cd445 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 28 Sep 2026 03:17:26 +0000 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E8=AE=B0=E5=BD=95=20PI=20runner?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=E6=A0=B8=E5=AF=B9?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 启动后第一次核对通过时打一条不含路径的日志,便于确认 test 没有再打到 dev sidecar。 --- internal/agent/piagent.go | 3 +++ 1 file changed, 3 insertions(+) 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 }