fix: resolve resume workflow ID in logs command

Strip _resume_* suffix to find the original workspace log file when
tailing logs for a resumed workflow.
This commit is contained in:
ezl-keygraph
2026-02-14 02:56:57 +05:30
parent 1b696cac1b
commit 2cf237d638
+6
View File
@@ -253,6 +253,11 @@ cmd_logs() {
if [ -f "./audit-logs/${ID}/workflow.log" ]; then if [ -f "./audit-logs/${ID}/workflow.log" ]; then
WORKFLOW_LOG="./audit-logs/${ID}/workflow.log" WORKFLOW_LOG="./audit-logs/${ID}/workflow.log"
else
# For resume workflow IDs (e.g. workspace_resume_123), check the original workspace
WORKSPACE_ID="${ID%%_resume_*}"
if [ "$WORKSPACE_ID" != "$ID" ] && [ -f "./audit-logs/${WORKSPACE_ID}/workflow.log" ]; then
WORKFLOW_LOG="./audit-logs/${WORKSPACE_ID}/workflow.log"
else else
# Search for the workflow directory (handles custom OUTPUT paths) # Search for the workflow directory (handles custom OUTPUT paths)
FOUND=$(find . -maxdepth 3 -path "*/${ID}/workflow.log" -type f 2>/dev/null | head -1) FOUND=$(find . -maxdepth 3 -path "*/${ID}/workflow.log" -type f 2>/dev/null | head -1)
@@ -260,6 +265,7 @@ cmd_logs() {
WORKFLOW_LOG="$FOUND" WORKFLOW_LOG="$FOUND"
fi fi
fi fi
fi
if [ -n "$WORKFLOW_LOG" ]; then if [ -n "$WORKFLOW_LOG" ]; then
echo "Tailing workflow log: $WORKFLOW_LOG" echo "Tailing workflow log: $WORKFLOW_LOG"