fix: stream docker helper logs inline

This commit is contained in:
Pi Web Agent
2026-07-10 20:50:26 +00:00
parent 410242aae8
commit 8f1b6b91ab
5 changed files with 150 additions and 5 deletions
+19 -1
View File
@@ -309,7 +309,9 @@ describe("Docker command assets", () => {
const result = await runDockerCommand(["restart-sessiond"], runtimeEnv(fakeDocker, installDir));
expect(result.stdout).toContain("Started detached PI WEB Docker helper");
expect(result.stdout).toContain("Follow progress with: docker logs -f pi-web-docker-restart-sessiond-");
expect(result.stdout).toContain("Streaming detached PI WEB Docker helper logs inline.");
expect(result.stdout).toContain("Reconnect with: docker logs -f pi-web-docker-restart-sessiond-");
expect(result.stdout).toContain("fake helper log");
const log = await readFile(fakeDocker.logPath, "utf8");
expect(log).toContain("container inspect");
expect(log).toContain("run -d");
@@ -518,6 +520,22 @@ case "\${1:-}" in
printf 'fake-helper-container-id\n'
exit 0
;;
logs)
printf 'fake helper log\n'
exit 0
;;
inspect)
for arg in "$@"; do
case "$arg" in
*State.ExitCode*)
printf '0\n'
exit 0
;;
esac
done
printf '{}\n'
exit 0
;;
esac
printf 'unexpected fake docker args: %s\n' "$*" >&2
exit 9