fix(hud): stop heal_stale_state leaking stale sessionStartTimestamp (Wave 1-B)#1487
Merged
Conversation
…amp (Wave 1-B)
The self-heal path preserved sessionStartTimestamp for "audit / forensics",
but resolve_duration in codingbuddy-hud.py reads the same field as a fallback
when stdin lacks total_duration_ms. A manual-fix marker + week-old timestamp
therefore rendered enormous durations like "322h52m" for brand-new sessions.
Fix: relocate the original timestamp into _healedFromSessionStartTimestamp so
forensic/debug value is preserved while the render fallback path no longer
sees it. Idempotent — re-healing an already-healed state keeps the forensics
field stable because only non-empty timestamps are moved.
Reproduction (before):
echo '{}' | python3 codingbuddy-hud.py
◕‿◕ CB v5.6.0 | Ready 🟢 | 322h52m | ~\$0.00 | Ctx:0%
After:
◕‿◕ CB v5.6.0 | Ready 🟢 | 0m | ~\$0.00 | Ctx:0%
Test coverage:
- 3 new unit tests in test_hud_session.py (forensics move, no-op on empty,
idempotence)
- 2 new integration tests in test_hud.py (TestHealedStateDurationDoesNotLeak)
- Existing test_heal_preserves_session_id_and_timestamp renamed/updated to
assert the new forensics contract
1067 passed locally (full plugin test suite).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
added a commit
that referenced
this pull request
Apr 11, 2026
Bump the workspace version from 5.6.0 to 5.6.1 and publish the CHANGELOG entry for the HUD hotfix cycle. v5.6.1 is a hotfix closing the remaining gaps in the v5.6.0 HUD Statusbar Wave cycle: - Wave 1-B heal timestamp leak (#1487) — heal_stale_state preserved sessionStartTimestamp for "audit / forensics", but resolve_duration read the same field as a fallback when stdin lacked total_duration_ms. A manual-fix marker + stale timestamp therefore rendered enormous durations like 322h52m for brand-new sessions. The timestamp is now relocated into _healedFromSessionStartTimestamp. - Wave 3b — complete Wave 3 integration (#1488) — commit bd78195 wired Wave 2-B velocity and 2-C cache savings into format_status_line but left four sibling Wave modules as dead code: hud_buddy, hud_rainbow, hud_context_bar, and hud_layout. Their unit tests passed, but format_status_line never called them. v5.6.1 hoists all four as top-level imports and refactors format_status_line to build (name, priority, text) segments consumed by fit_segments, finally delivering the Wave 2-A breathing face, Wave 2-D rainbow coloring (opt-in via CODINGBUDDY_HUD_RAINBOW=1), Wave 2-E smart context bar, and Wave 1-D adaptive layout features that v5.6.0 advertised. Bump surface: - apps/mcp-server/package.json, src/shared/version.ts - packages/rules/package.json - packages/claude-code-plugin/package.json (+ peerDependencies), .claude-plugin/plugin.json, README.md, namespace-manifest.json - .claude-plugin/marketplace.json - yarn.lock - CHANGELOG.md (new [5.6.1] section)
7 tasks
JeremyDev87
added a commit
that referenced
this pull request
Apr 11, 2026
Bump the workspace version from 5.6.0 to 5.6.1 and publish the CHANGELOG entry for the HUD hotfix cycle. v5.6.1 is a hotfix closing the remaining gaps in the v5.6.0 HUD Statusbar Wave cycle: - Wave 1-B heal timestamp leak (#1487) — heal_stale_state preserved sessionStartTimestamp for "audit / forensics", but resolve_duration read the same field as a fallback when stdin lacked total_duration_ms. A manual-fix marker + stale timestamp therefore rendered enormous durations like 322h52m for brand-new sessions. The timestamp is now relocated into _healedFromSessionStartTimestamp. - Wave 3b — complete Wave 3 integration (#1488) — commit bd78195 wired Wave 2-B velocity and 2-C cache savings into format_status_line but left four sibling Wave modules as dead code: hud_buddy, hud_rainbow, hud_context_bar, and hud_layout. Their unit tests passed, but format_status_line never called them. v5.6.1 hoists all four as top-level imports and refactors format_status_line to build (name, priority, text) segments consumed by fit_segments, finally delivering the Wave 2-A breathing face, Wave 2-D rainbow coloring (opt-in via CODINGBUDDY_HUD_RAINBOW=1), Wave 2-E smart context bar, and Wave 1-D adaptive layout features that v5.6.0 advertised. Bump surface: - apps/mcp-server/package.json, src/shared/version.ts - packages/rules/package.json - packages/claude-code-plugin/package.json (+ peerDependencies), .claude-plugin/plugin.json, README.md, namespace-manifest.json - .claude-plugin/marketplace.json - yarn.lock - CHANGELOG.md (new [5.6.1] section)
This was referenced Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
heal_stale_statepreservedsessionStartTimestampfor "audit / forensics", butresolve_durationreads the same field as a fallback when stdin has nototal_duration_ms. A manual-fix marker + week-old timestamp therefore rendered enormous durations like 322h52m for brand-new sessions._healedFromSessionStartTimestampso forensic/debug value is preserved while the render fallback path no longer sees it.Reproduction
Before:
After:
Test plan
test_hud_session.py(forensics move, no-op on empty, idempotence)test_hud.py(TestHealedStateDurationDoesNotLeak)test_heal_preserves_session_id_and_timestamprenamed/updated to assert the new forensics contractRelates to
Companion PR: feat/hud-wave3b-completion (completes Wave 3 integration for modules that are still dead code in v5.6.0).
Target: v5.6.1 hotfix release.