Skip to content

Conversation

@fayerman-source
Copy link
Contributor

Summary

Fixes several issues preventing the pai-statusline pack from working correctly on Linux/WSL systems.

Before / After

Before (Broken) After (Fixed)
Before After

Bug Fixes

1. Cross-platform stat command

The script used macOS-only stat -f %m syntax. Linux requires stat -c %Y.

Fix: OS detection at 3 locations:

if [[ "$OSTYPE" == "darwin"* ]]; then
    stat -f %m "$FILE"
else
    stat -c %Y "$FILE"
fi

2. jq not documented as dependency

The README stated dependencies: [] but the script uses jq 20+ times for JSON parsing. Without jq, all values silently fail to defaults.

Fix: Updated README to document jq as required dependency.

3. PWD has no fallback

When JSON input lacks directory info, PWD displays empty.

Fix: current_dir="${current_dir:-$PWD}"

UX Improvements

4. Icon spacing in MEMORY line

Before: 📁0 Work │ ✦2 Ratings
After: 📁 0 Work │ ✦ 2 Ratings

5. "No data" indicator changed from to -.-

Why: When bugs occurred (missing jq, failing stat), the display showed - identical to "no data available". This made debugging impossible since errors looked like missing data.

-.- is:

  • Visually consistent with decimal format (X.X)
  • Clearly intentional, not an error fallback
  • Self-documenting as "placeholder for number"

Test Environment

  • OS: Ubuntu (WSL2)
  • Kernel: 6.6.87.2-microsoft-standard-WSL2
  • Claude Code: 2.1.11

Test Plan

  • Verified location displays correctly (Queens, New York)
  • Verified PAI version displays (v2.3)
  • Verified PWD displays directory name
  • Verified weather displays
  • Verified context percentage and sparklines work
  • Verified MEMORY line spacing
  • Verified -.- shows for periods with no rating data

🤖 Generated with Claude Code

fayerman-source and others added 3 commits January 17, 2026 07:56
Fixes several issues preventing the statusline from working on Linux/WSL:

**Bug Fixes:**
- Cross-platform `stat` command: Use `stat -c %Y` on Linux vs `stat -f %m` on macOS
- PWD fallback: Add `${current_dir:-$PWD}` when JSON input lacks directory
- Document `jq` as required dependency (was unlisted but used 20+ times)

**UX Improvements:**
- Add spacing between icons and numbers in MEMORY line (📁0 → 📁 0)
- Change "no data" indicator from `—` to `-.-` for visual consistency with
  decimal format and to distinguish from error states (silent failures
  previously showed `—` making bugs look like missing data)

Tested on WSL2 (Ubuntu) with Linux kernel 6.6.87.2-microsoft-standard-WSL2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fayerman-source
Copy link
Contributor Author

CI Failure Analysis

The claude-review check is failing due to a GitHub Actions OIDC limitation for fork PRs, not a code issue.

Error

Could not fetch an OIDC token. Did you remember to add `id-token: write` to your workflow permissions?
Error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable

Root Cause

The claude-code-action@v1 uses OIDC authentication to obtain tokens. GitHub blocks OIDC token requests from forked repositories as a security measure to prevent secrets exposure to untrusted code.

Check Status
id-token: write permission ✅ Present in workflow
PR from fork ✅ Yes (fayerman-source)
OIDC available for forks ❌ Blocked by GitHub

This affects all fork-based PRs to this repo - the workflow has never had a successful run.

Merge Request

The code changes in this PR have been tested and verified working on Linux/WSL:

  • ✅ Cross-platform stat command (macOS/Linux)
  • jq dependency documented
  • ✅ PWD fallback working
  • ✅ Icon spacing improvements
  • -.- placeholder for debugging

Screenshots in PR description show before/after verification.

Suggested Workflow Fixes

Option A: Use github_token for fork PRs

- name: Run Claude Code Review
  uses: anthropics/claude-code-action@v1
  with:
    # For fork PRs, use github_token instead of OIDC
    github_token: ${{ secrets.GITHUB_TOKEN }}
    claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

Option B: Skip CI for fork PRs

jobs:
  claude-review:
    # Only run for PRs from the same repo
    if: github.event.pull_request.head.repo.full_name == github.repository

Option C: Manual workflow approval
Use GitHub's "Approve and run" for first-time contributors from the Actions tab.


Analysis performed via Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant