t2602: Fix issue-sync-helper.sh dirname failure in headless pulse#2604
t2602: Fix issue-sync-helper.sh dirname failure in headless pulse#2604marcusquinn wants to merge 1 commit intomainfrom
Conversation
…2602) issue-sync-helper.sh fails in headless pulse sessions because dirname (a coreutils binary) is not in PATH in restricted MCP environments. Replace $(dirname "${BASH_SOURCE[0]}") with ${BASH_SOURCE[0]%/*} (POSIX parameter expansion — no external binary required) in both issue-sync-helper.sh and issue-sync-lib.sh. Also add defensive PATH export at script entry to ensure sed, grep, awk, jq, and gh are available in headless environments. Closes #2602
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
WalkthroughThe PR fixes headless MCP environment failures by replacing the external Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Feb 28 05:50:08 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
dirname(external binary) with pure-bash${BASH_SOURCE[0]%/*}parameter expansion inissue-sync-helper.shandissue-sync-lib.sh— fixes "dirname: command not found" in headless/MCP environmentsPATHexport at script entry to ensure coreutils (sed,grep,awk,jq,gh) are available in restricted environments${var%/*}is POSIX and works on bash 3.2+Root Cause
In headless pulse sessions (Claude Code MCP shell),
/usr/binand/usr/local/binmay not be inPATH.dirnameis a coreutils binary, not a shell builtin, so$(dirname "${BASH_SOURCE[0]}")fails with "command not found". This caused TODO sync to silently fail on every pulse cycle across all 6 repos.Testing
bash -nsyntax check: passshellcheck: no new warnings (only pre-existing SC1091 info)issue-sync-helper.sh helpruns successfully${BASH_SOURCE[0]%/*}produces identical output todirnameCloses #2602
Summary by CodeRabbit