Skip to content

fix(hud): stop heal_stale_state leaking stale sessionStartTimestamp (Wave 1-B)#1487

Merged
JeremyDev87 merged 1 commit into
masterfrom
fix/hud-heal-timestamp-leak
Apr 11, 2026
Merged

fix(hud): stop heal_stale_state leaking stale sessionStartTimestamp (Wave 1-B)#1487
JeremyDev87 merged 1 commit into
masterfrom
fix/hud-heal-timestamp-leak

Conversation

@JeremyDev87
Copy link
Copy Markdown
Owner

Summary

  • heal_stale_state preserved sessionStartTimestamp for "audit / forensics", but resolve_duration reads the same field as a fallback when stdin has no 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:

$ echo '{}' | python3 codingbuddy-hud.py
◕‿◕ CB v5.6.0 | Ready 🟢 | 0m | ~\$0.00 | Ctx:0%

Test plan

  • 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)
  • Manual CLI reproduction confirmed 322h52m → 0m

Relates 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.

…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).
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 11, 2026 3:37pm

@JeremyDev87 JeremyDev87 added fix plugin packages/claude-code-plugin labels Apr 11, 2026
@JeremyDev87 JeremyDev87 self-assigned this Apr 11, 2026
@JeremyDev87 JeremyDev87 merged commit cd2c9d3 into master Apr 11, 2026
29 checks passed
@JeremyDev87 JeremyDev87 deleted the fix/hud-heal-timestamp-leak branch April 11, 2026 15:44
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)
@JeremyDev87 JeremyDev87 mentioned this pull request Apr 11, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix plugin packages/claude-code-plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant