fix(footer): read the thinking level from pi's ExtensionAPI #63

Merged
owlburtoe merged 1 commit from fix-effort-source into master 2026-07-25 20:15:32 -04:00
Owner

Blocks the 2.5.1 publish — found by the mandated live smoke, exactly the class of bug the smoke exists for.

The bug

The effort suffix read ctx.getThinkingLevel(). That method is on pi's ExtensionAPI, not the per-event ExtensionContext the footer's other sources read (ctx.model, ctx.getContextUsage, ctx.modelRegistry, ctx.sessionManager). In a real session it returned undefined, so the suffix silently never rendered — the footer read GPT-5.6 Sol with no level.

The unit test faked getThinkingLevel on the context object, so it agreed with the implementation and proved nothing.

The fix

installClaudeFooter(ctx, pi) now takes the extension API as a second argument (both call sites in index.ts already have pi in scope) and reads the level from it. Omitting the argument simply drops the suffix.

The test's fake context now carries a decoy getThinkingLevel: () => "decoy" while the fake API returns the real level, so reading the wrong object fails the assertion instead of passing.

Validation

Re-smoked in a live pi 0.80.10 session, claudify loaded from this checkout, running in a git worktree named smoke-2-5-1:

claudify │ ⎇ smoke-2-5-1 │ GPT-5.6 Sol · xhigh │ Ctx: 0% │ Week: 21% ▓▓░░░░░░░░ → Reset: 04:00 PM
  • Project name resolves to claudify, not the branch-named folder — the duplicate segment is gone.
  • Effort renders the live level (· xhigh).
  • /claudify → Footer → Effort → false drops the suffix from the running footer immediately, back to true restores it, and footerEffort persists to ~/.pi/settings.json.
  • Slash-autocomplete renders and pi stays alive (the 2.3.0 overflow-crash reproducer).

bun run test 15/15 green, tsc --strict clean. Version stays 2.5.1 — nothing has been published yet.

Blocks the 2.5.1 publish — found by the mandated live smoke, exactly the class of bug the smoke exists for. ## The bug The effort suffix read `ctx.getThinkingLevel()`. That method is on pi's **`ExtensionAPI`**, not the per-event **`ExtensionContext`** the footer's other sources read (`ctx.model`, `ctx.getContextUsage`, `ctx.modelRegistry`, `ctx.sessionManager`). In a real session it returned `undefined`, so the suffix silently never rendered — the footer read `GPT-5.6 Sol` with no level. The unit test faked `getThinkingLevel` on the context object, so it agreed with the implementation and proved nothing. ## The fix `installClaudeFooter(ctx, pi)` now takes the extension API as a second argument (both call sites in `index.ts` already have `pi` in scope) and reads the level from it. Omitting the argument simply drops the suffix. The test's fake context now carries a **decoy** `getThinkingLevel: () => "decoy"` while the fake API returns the real level, so reading the wrong object fails the assertion instead of passing. ## Validation Re-smoked in a live pi 0.80.10 session, claudify loaded from this checkout, running in a git worktree named `smoke-2-5-1`: ``` claudify │ ⎇ smoke-2-5-1 │ GPT-5.6 Sol · xhigh │ Ctx: 0% │ Week: 21% ▓▓░░░░░░░░ → Reset: 04:00 PM ``` - Project name resolves to `claudify`, not the branch-named folder — the duplicate segment is gone. - Effort renders the live level (`· xhigh`). - `/claudify` → Footer → Effort → false drops the suffix from the running footer immediately, back to true restores it, and `footerEffort` persists to `~/.pi/settings.json`. - Slash-autocomplete renders and pi stays alive (the 2.3.0 overflow-crash reproducer). `bun run test` 15/15 green, `tsc --strict` clean. Version stays 2.5.1 — nothing has been published yet.
fix(footer): read the thinking level from pi's ExtensionAPI
All checks were successful
Plane Sync / Close referenced Plane work items (pull_request) Successful in 2s
da5cf6ce18
The effort suffix read ctx.getThinkingLevel(), but that lives on pi's
ExtensionAPI, not the per-event ExtensionContext the footer's other sources
use — so in a real session it always returned undefined and the suffix never
appeared. The unit test faked the method on ctx and missed it; the live smoke
for 2.5.1 caught it.

installClaudeFooter now takes the ExtensionAPI as a second argument, and the
test's fake context carries a decoy getThinkingLevel so reading the wrong
object fails the assertion.
owlburtoe merged commit c40667e8a0 into master 2026-07-25 20:15:32 -04:00
owlburtoe deleted branch fix-effort-source 2026-07-25 20:15:32 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
owlburtoe/pi-claudify!63
No description provided.