Skip to content

fix(hud): version resolution fallback to plugin.json (Wave 1-A) #1466

@JeremyDev87

Description

@JeremyDev87

Problem

StatusBar shows stale v5.2.0 when the actual plugin version is v5.5.0. Root cause: hud-state.json freezes the version at session-start and is never re-read when the plugin updates.

Fix (Wave 1-A)

Strengthen get_fresh_version() with a deterministic tier-2 fallback:

  1. tier 1: installed_plugins.json (global, authoritative after /plugin update)
  2. tier 2 (NEW): ../.claude-plugin/plugin.json (local, authoritative for dev installs) — resolved via __file__ relative path
  3. tier 3: hud_state.version (last resort, may be stale)

API

New plugin_json_file: Optional[str] = None parameter:

  • None (default) — tier-2 disabled, preserves backcompat
  • "" — use default dev-install path (production enables this via main())
  • non-empty string — test override

Tests

7 new behavior tests in test_hud_version.py:

  • Fallback ordering (3 tests)
  • Malformed plugin.json skipped
  • Missing version key skipped
  • Default path resolves to real repo file
  • 3 existing tests remain passing (Optional[str]=None default preserves compat)

Acceptance

Closes the version-display bug reported as "버전도 v5.5.0 인데 v5.2.0 으로 나오고 있어"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions