From b07381d4436a22ae0c26418f996ea7d31e43a14a Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Fri, 28 Aug 2026 20:35:22 +0200 Subject: [PATCH] port: read the session link from the container log, not the transcript `sylph-port remote` never returned. Two bugs, one behind the other. The glob `/sylph-home/port/.claude/**/*.jsonl` ran under `sh`, which has no globstar, so it stayed literal and matched nothing -- the lookup could not have succeeded however long it waited. Fixing that exposed the real problem: the session transcript records every command run inside the container, including this lookup, so grepping it matched our own pattern string back and returned a truncated URL. The container log is the right source and has no such feedback loop. Co-Authored-By: Claude Opus 5 --- docker/sylph-port | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/sylph-port b/docker/sylph-port index 8d75691..e0c94aa 100755 --- a/docker/sylph-port +++ b/docker/sylph-port @@ -145,9 +145,12 @@ case "${1:-}" in remote) echo "waiting for the session to register" >&2 for _ in $(seq 60); do - url=$(docker exec "$NAME" sh -c \ - 'grep -ho "https://claude.ai/code/session_[A-Za-z0-9]*" \ - /sylph-home/port/.claude/**/*.jsonl 2>/dev/null | tail -1' 2>/dev/null || true) + # Read the container LOG, not the session transcript. The transcript + # records every command run inside the container -- including this + # lookup -- so grepping it matched our own pattern string back. + url=$(docker logs "$NAME" 2>&1 \ + | grep -aoE 'https://claude\.ai/code/session_[A-Za-z0-9]+' \ + | tail -1 || true) [ -n "$url" ] && { echo "$url"; exit 0; } sleep 2 done