Skip to content

fix: correct jq path for PAI version in statusline script#461

Merged
danielmiessler merged 1 commit into
danielmiessler:mainfrom
pybe:fix/statusline-version-path
Feb 10, 2026
Merged

fix: correct jq path for PAI version in statusline script#461
danielmiessler merged 1 commit into
danielmiessler:mainfrom
pybe:fix/statusline-version-path

Conversation

@pybe

@pybe pybe commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixed jq path mismatch in statusline-command.sh that caused incorrect version display
  • Changed .pai.version to .paiVersion to match what install.ts writes

Problem

The statusline script was reading from .pai.version in settings.json, but install.ts writes the version to .paiVersion at the root level. This caused the statusline to always show the fallback version ("2.0" or "—") instead of the actual installed version.

Solution

Updated the jq query on line 94 in all three copies of the script:

  • .claude/statusline-command.sh
  • Releases/v2.3/.claude/statusline-command.sh
  • Packs/pai-statusline/src/statusline-command.sh

Verification

Tested locally by comparing jq queries:

# Old query returns fallback
jq -r '.pai.version // "2.0"' settings.json  # Returns: 2.0

# New query returns actual version
jq -r '.paiVersion // "2.0"' settings.json   # Returns: 2.3

Test plan

  • Verified settings.json has paiVersion at root level
  • Tested both jq queries against settings.json
  • Confirmed statusline displays correct version after fix

Fixes #446

🤖 Generated with Claude Code

The statusline script was reading `.pai.version` from settings.json,
but install.ts writes the version to `.paiVersion` at the root level.

This mismatch caused the statusline to always show the fallback version
instead of the actual installed version.

Fixes danielmiessler#446

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pybe

pybe commented Jan 26, 2026

Copy link
Copy Markdown
Contributor Author

Code Review (ran locally)

I noticed the Claude Code Review workflow was failing due to an OIDC token issue, so I ran the review locally in case it helps.


Files Changed: 3 files (same fix in 3 locations)

  • .claude/statusline-command.sh
  • Packs/pai-statusline/src/statusline-command.sh
  • Releases/v2.3/.claude/statusline-command.sh

The Change:

- PAI_VERSION=$(jq -r '.pai.version // "—"' "$SETTINGS_FILE" 2>/dev/null)
+ PAI_VERSION=$(jq -r '.paiVersion // "—"' "$SETTINGS_FILE" 2>/dev/null)

Review: ✅ APPROVED

Verification: I checked the settings.json structure in Releases/v2.3/.claude/:

{
  "$schema": "...",
  "paiVersion": "2.3",      // <-- Top-level key
  "env": { ... },
  "pai": {                  // <-- Nested object (no .version inside)
    "repoUrl": "..."
  }
}

The fix is correct. The version is stored at .paiVersion (top-level), not .pai.version (nested).

Assessment:

Criteria Status
Code correctness ✅ Correctly targets paiVersion
Consistency ✅ All 3 files updated identically
Fallback preserved ✅ Still falls back to "—" or "2.0"
No regressions ✅ Simple path correction

Recommendation: Merge. This is a straightforward bug fix.


Review performed by Val (AI Assistant) using Claude Code locally

@danielmiessler
danielmiessler merged commit 72a67d9 into danielmiessler:main Feb 10, 2026
1 check failed
catwhisperingninja pushed a commit to catwhisperingninja/pai that referenced this pull request Mar 11, 2026
ljubitje pushed a commit to ljubitje/Personal_AI_Infrastructure that referenced this pull request Apr 12, 2026
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.

Statusline pack reads PAI version from invalid settings.json field

2 participants