Skip to content

feat(plugin): calm band, sectioned pane and a status line that keeps the cold cache - #694

Merged
OsherElhadad merged 6 commits into
mainfrom
feat/ui-redesign
Oct 25, 2026
Merged

OsherElhadad merged 6 commits into
mainfrom
feat/ui-redesign

Conversation

@OsherElhadad

Copy link
Copy Markdown
Collaborator

Summary

The status line and the mod showed the same facts up to four times. This PR gives each fact one home. It also draws a cold cache instead of hiding it.

What changed

One home per fact

Fact Home
saved $x of $y (session, subagents) status line, line 1
main cache clock, ↻ status line
context fill status line
next message price, warm and cold mod band
Ping band, pane, /ping
sub-agent caches band row 2, pane
weekly tip band row 3, only when stale
spark, strip, heat, fill pane

Status line

  • A cold cache stays on the line, dim: cache ○ cold 3:12. minimal shows cache ○ cold. (Cold cache hides the cache clock, next cost, agents and Ping from the status line and mod #686)
  • Money and the context bar stay when the cache-state copy is old. They get ⏳. The clock is computed from the copy at any age. cg.py cachestate already returned the old copy with "stale": true; a test now pins it.
  • next, ka and the tip are gone from balanced. detailed shows keep-alive 3 pings · $0.04. No ka anywhere. --show=next|agents|ka|tip still work.
  • The layouts spark, strip, heat, fill, watch are retired. A flag or remembered choice that names one falls back to balanced, with no error.
  • One money format in Python and TypeScript: $12.34, $0.06, <$0.01, $123. Clocks use h:mm:ss from one hour.
  • Narrow terminals shed: spend and latency, keep-alive, update marker, subagents phrase, session label, context bar. The clock shortens last.

Mod band (at most 3 rows)

  • Row 1: ◆ next message $0.06 · $0.78 if cold [ Ping ] dashboard ↗ hide.
  • Cold: ◆ ○ cache cold · next message $0.78. No Ping.
  • The server says pingable: false: no button. A dim ping off: <reason, 40 characters at most> shows instead. No pingable field (older server): the button stays.
  • Row 2: sub-agent chips. On by default. Cold agents shown dim. The a key and a pane button turn it off. The choice is kept in $.store.
  • Row 3: the weekly tip, only when stale (cg.py tip, same rule as the status line). It does not rotate.
  • hide is reversible: /context-guru:context-guru or the pane button shows the band again.
  • Removed: gauge and time, saved money, rotating tip, brand text, and the $.ui.status copy of the clock.
  • Reworded not opted in: "Ping is not enabled for this install: run /context-guru:install again, then start a new session". (The header self-heal is in a separate PR for Ping says "restart Claude Code" but a restart never adds the x-context-guru-ping header #685.)

Pane (/context-guru:context-guru)

  • Header and one summary line (saved $22.80 of $81.90 this session), NEXT MESSAGE, AGENTS, SAVED LATELY, CACHE HITS, MISSES BY HOUR, CONTEXT, SAVE MORE.
  • A section with no data is left out. Data comes from the new cg.py panedata.

Other

  • Plugin version 0.5.4 to 0.6.0.
  • docs/plugin/statusline.md and the statusline skill are rewritten. The recordings in docs/statusline-live showed the old lines and no generator exists, so they are removed. Text renders replace them.

Before and after

Status line, cold cache.

Before:

saved $18.60 of $61.40 session · saved $4.20 of $20.50 subagents
ctx ███░░░░░ 41% │ ka 3 pings $0.04

After:

saved $18.60 of $61.40 session · saved $4.20 of $20.50 subagents
cache ○ cold 2:12 │ ctx ███░░░░░ 41%

Status line, warm.

Before:

saved $18.60 of $61.40 session · saved $4.20 of $20.50 subagents
cache ● █████░ 4:00 │ next $0.06 warm · $0.78 cold │ ctx ███░░░░░ 41% │ ka 3 pings $0.04
Tip: you haven't run /context-guru:save-more … for over a week — worth a shot.

After:

saved $18.60 of $61.40 session · saved $4.20 of $20.50 subagents
cache ● █████░ 4:00 │ ctx ███░░░░░ 41%

Band, warm, agents, stale tip.

Before:

◆ Context Guru │ ██████░░ 4m │ next $0.060 vs $0.780 if cold │ saved $22.80 │ [ Ping ] │ dashboard ↗ hide
└ agents  Explore ████ 5m  code-reviewer █░░░ <1m
save more: /context-guru:insights — see where the money goes

After:

◆ next message $0.06 · $0.78 if cold [ Ping ]   dashboard ↗ hide
└ agents  ● Explore 5m  ◐ code-reviewer <1m  ○ planner
tip: /context-guru:save-more hasn't run in 7+ days — finds a cheaper config

Band, cold, and ping off (short band):

◆ ○ cache cold · next message $0.78   dashboard ↗ hide
└ agents  ● Explore 5m  ◐ code-reviewer <1m  ○ planner

◆ next message $0.06 · $0.78 if cold   ping off: run /context-guru:install   dashboard ↗ hide

The full pane and the other status line states are in docs/plugin/statusline.md.

How it was tested

  • claude plugin validate .: passed.
  • claude plugin test .: 56 pass, 0 fail (33 before).
    • New cases: no clock, saved money, tip rotation, brand text or $.ui.status in the band; next cost warm and cold; ping-off reasons (40 characters at most) and no raw codes; agent chips including dim cold ones and the pinged ↻; weekly tip only when stale; hide reversible; pane sections present and omitted; ping button, ping-off and last result in the pane; money format table.
  • go test ./context-guru-plugin/... with a private TMPDIR: ok, 337 s, run on this commit's tree before the last small edits (a test import, gofmt, one docs table). A targeted run of the status line, ping, cache-state, panedata, tip and docs tests passed after them.
    • Goldens updated on purpose for each state above.
    • New tests: retired layouts fall back, an old cache-state copy keeps money and context (⏳), cachestate stale flag, panedata, tip, and the money table on both sides.
  • python3 -m unittest test_tv test_costly: 36 and 47 OK.

Test host note. On a host that exports CLAUDE_* and ANTHROPIC_* variables, 4 tests fail on unmodified origin/main: TestCGGoldens, TestCostlySettingsGoldens, TestSaveMoreDefaultIncludesTheSettingsCard, TestSaveMoreWidthASCIIAndColour. They pass with those variables removed. This PR does not cause them.

Technical notes

  • cg.py is vendored into codex-marketplace/plugins/context-guru/scripts/. The copy is updated, and cg.py tip returns an empty list there (no status line in that plugin).
  • statusline.py: stale_commands() is the one weekly-tip rule. _tip_segment and cg.py tip both use it. The tvlib mode rows moved to cg.py panedata; the math is the same.
  • _fetch_json takes max_age=None for the cache state, so an old copy is served. Other reads keep the 10 minute ceiling.
  • Text is an inline element in this engine. A Fragment inside a Text made the band tree invalid ("Box inside an inline element"), so the band uses plain conditional Text children.
  • The pane test cannot measure rendered width. It checks sections and text; the 60 column layout was judged from the dumped tree, not drawn on a real terminal.
  • Not done: the header self-heal for Ping (Ping says "restart Claude Code" but a restart never adds the x-context-guru-ping header #685, other PR). The offload-review was not run. I did not run the mod in a real Claude Code session.

🤖 Generated with Claude Code

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @OsherElhadad) Claude Code 2.1.310 offload-review skill, @OsherElhadad's session fresh 2 of 2 1 of 2 ccad9f97feea blocking

Verdict: blocking

Findings

  1. context-guru-plugin/scripts/statusline.py:1564 — a hung proxy with an old cache-state copy now shows cg: stats loading…, not the money and not cg? not responding

    • What fails: the stats cache is older than 600 s, /api/stats keeps timing out, and a cache-state file exists (any age, because max_age=None). _timeout_result returns (None, STATS_HUNG). Line 1564 changes status to STATS_TIMEOUT but leaves stats as None. Line 1571 then picks "cg: stats loading…", because status == STATS_TIMEOUT and stats is None. main() prints that and returns.
    • Result: the new rule does the opposite of its comment ("show them with ⏳"). No money, no clock, no context bar. Also the honest cg? not responding is replaced by "loading…", which tells the user the problem is about to go away. Before this PR the user saw cg? not responding.
    • Proof: trace of lines 1562-1574. No test covers it. TestStatuslineReportsNotRespondingOnceAStaleFetchHangsTooLong (plugin_test.go:2313) uses toggleStub, which has no /api/cachestate handler, so cs is None there. TestStatuslineStaleCachestateDocumentStillDrawsMoneyContextAndClock (statusline_golden_test.go:1443) has a working /api/stats, so the status is STATS_OK.
    • Fix: when you promote the status, also set stats = {} (the money comes from cs["money"], and ka already skips an empty stats). Add a test: an old stats file, /api/stats that hangs, and an old cache-state file. Expect saved $… of $… session, the cache clock and ⏳.
  2. context-guru-plugin/scripts/cg.py:1486 — cg.py tip ignores statusline.py --set-tips=off, so the band shows a tip the user turned off

    • What fails: a user ran --set-tips=off before this PR. After the update, the tip moves from the status line into the band (its new default home). cg.py tip calls sl.stale_commands() only. It never calls sl._tips_off(). So the band (row 3) and the pane SAVE MORE line show the tip again.
    • Proof: _tips_off() is only read at statusline.py:1606 ("tip" in on and not _tips_off()). stale_commands() (statusline.py:580) has no check. docs/plugin/statusline.md:169 says "The status line and the mod only read that file … Turn it off with statusline.py --set-tips=off", so the docs promise one switch for both. TestCGTipUsesTheStatusLineRule does not test the off switch.
    • Fix: in cg.py tip, return {"stale": []} when sl._tips_off() is true. Add a case to TestCGTipUsesTheStatusLineRule with XDG_CONFIG_HOME/context-guru/statusline-tips set to off.

Non-blocking

  • statusline.py:781 — a remembered retired layout (spark, …) now returns "balanced", and _config lets a saved layout outrank the installed flag. So a user whose installed command says --layout=detailed and who once ran --set-layout=spark gets balanced, not detailed. Returning None for a retired name falls back to the installed flag, which reads closer to "falls back, with no error".
  • cg.py pane_strip / pane_heat: the pane shows $x lost today also on a subscription. The old status line strip hid that money on a subscription (money=not sub). The mod does not know the plan, so the pane cannot hide it. Worth a note, or pass the plan to panedata.
  • cg.py pane_strip: the docstring says "the main thread", but the rows are not filtered by thread_id. Sub-agent requests are in the strip. This is the same as the old _strip_row; only the docstring is wrong.
  • Money format: for a small negative value the three sides differ. usd(-0.004) is -$0.00 in cg.py and model.ts, but _money(-0.004) is $0.00 in statusline.py. TestMoneyFormatTable has no negative case.
  • cg.py pane_get cache tags day, series14h, hourly and spend-today do not hold the date. For up to 60 s after midnight the pane can show yesterday's "today". Small.

What I checked

  • The full diff of the one commit ccad9f97: cg.py (and that the Codex copy is byte-identical), statusline.py, model.ts, register.tsx, types/index.d.ts, plugin.json, the Go tests (cg_test.go, plugin_test.go, ping_test.go, statusline_golden_test.go), the register.test.tsx test names, the statusline skill and the docs table. I read the deleted docs/statusline-live files only by name and size; nothing else references them.
  • statusline.py main(), _fetch_stats, _timeout_result, _stale_stats, _gather, _fetch_json with the new max_age, _cache_view, _ctx_numbers, _cache_segment cold branch, _save_segment levels against the new DEGRADE order and minimal (level 2).
  • cg.py panedata: reads go through cgcache with TTL, back-off and single flight; each read fails into a missing section; the session id is checked by regex; nothing writes to the proxy. tip in the Codex copy falls back to an empty list.
  • model.ts view(): sub-agent window (30 min by server time), pingable fallback to the older server, signature covers the new fields, short reasons are at most 40 characters.
  • register.tsx band and pane: Ping hidden when cold or pingable === false; hide is reversible; the agents switch is kept in $.store; the band has at most 3 rows.
  • Fail open: every new helper call in the mod is in try/catch and returns null; panedata catches each read. Data dependence: display only, metadata reads, no new stored data, no new component; I agree no row in docs/data-dependence.md is needed.
  • I did not run any test. Live tests are not approved and Go is not installed here.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @OsherElhadad) Claude Code 2.1.310 offload-review skill, @OsherElhadad's session fresh 1 of 2 1 of 2 ccad9f97feea blocking

Verdict: blocking

Findings

  1. context-guru-plugin/scripts/statusline.py:1564 — a hung stats read with a cache-state copy prints cg: stats loading…, not the figures

    • What fails: the stats copy is older than 10 minutes, /api/stats still times out, and a cache-state copy exists. The PR wants the money, the clock and the context bar with ⏳. The line shows cg: stats loading… and nothing else. Before this PR it showed cg? not responding. So the change makes the message less true, and the figures do not appear.
    • Proof:
      • _timeout_result (line 433) returns (None, STATS_HUNG), so stats is None.
      • Line 1564 changes status to STATS_TIMEOUT. stats stays None.
      • Line 1571: "cg: stats loading…" if status == STATS_TIMEOUT and stats is None. That is true, so notice is set. Line 1573 prints it and returns before any segment is drawn.
      • The same gate also hides the figures when stats was never cached but a cache-state copy exists. The docs say loading… shows "only when there never was a document" (docs/plugin/statusline.md, skills/statusline/SKILL.md).
      • No test covers this path. TestStatuslineStaleCachestateDocumentStillDrawsMoneyContextAndClock has a stats endpoint that answers. TestStatuslineReportsNotRespondingOnceAStaleFetchHangsTooLong has no /api/cachestate, so cs is None there.
    • Fix: when got["cs"][0] is not None, skip the loading… and not responding notices and set stale = True. _save_segment already reads its money from cs["money"]. Add a test: an old stats cache, a stalled /api/stats, a cache-state copy on disk. Expect saved … session, cache, ctx and ⏳.
  2. context-guru-plugin/scripts/cg.py:1483 — --set-tips=off does not turn off the mod's weekly tip

    • What fails: a user runs statusline.py --set-tips=off. The status line tip stops, but the band row 3 and the pane SAVE MORE line still show tip: /context-guru:save-more hasn't run in 7+ days. After this PR the band is the tip's default home, and the status line tip is opt-in. So the documented off switch now does nothing in the default setup.
    • Proof:
      • cg.py tip prints sl.stale_commands(). stale_commands (statusline.py:580) does not call _tips_off().
      • _tips_off() is checked only in statusline.py main() (line 1604, if "tip" in on and not _tips_off()).
      • docs/plugin/statusline.md:169 describes the tip for "the status line and the mod", then says: "Turn it off with … --set-tips=off". skills/statusline/SKILL.md:62 says the same.
    • Fix: in cg.py tip, print {"stale": []} when sl._tips_off() is true. Or check it in stale_commands. Add a case to the cg.py tip test.

Non-blocking

  • cg.py pane_strip docstring says "the last 20 requests of the main thread". The code does not filter on thread_id, so sub-agent requests are included. Filter them, as pane_fill does, or fix the docstring.
  • cg_test.go TestCGPanedata: port, _ := statuslineCounting(t, cache, nil); _ = port starts a server that the test never uses. Remove it.
  • docs/plugin/statusline.md state table: "Cold | dim ○ cache ○ cold 3:12" has the glyph two times. The line draws cache ○ cold 3:12.
  • statusline.py _money(x, approx=True) for 0 < x < 0.01 returns <$0.01 and drops the ≈ mark. No current caller passes a value that small with approx, so this is only a note.
  • The band row 1 shows the next-message price on a subscription too. The status line hides next there because "a subscription is not billed per request". This did not change in this PR, but the band is now the price's only default home.

What I checked

  • Read CLAUDE.md, docs/design.md (package map) and the commit message.
  • Read the full diff of scripts/cg.py (both copies; they are identical, and the Codex copy has no statusline.py, which the tip command handles with its except).
  • Read the full diff of scripts/statusline.py, and the code around _fetch_stats, _timeout_result, _stale_stats, _fetch_json, _gather, _cache_view, _cache_segment, _save_segment, _window_segment, main() and the DEGRADE loop. Traced the save levels (minimal = 2, DEGRADE 1 → 2 → 3) and the cold segment.
  • Read scripts/cgcache.py for the pane's cache, single flight and back-off in pane_get.
  • Read hooks/model.ts, hooks/register.tsx (all of it), types/index.d.ts, and the new and changed tests in register.test.tsx, cg_test.go, ping_test.go, plugin_test.go and statusline_golden_test.go.
  • Read the dash/cachestate.go thread fields (pingable, ping_reason, window, window_exact, next_*_usd) that the mod and panedata read.
  • Read the docs diffs: docs/plugin/statusline.md, skills/statusline/SKILL.md, skills/cache-strategy-picker/SKILL.md. Checked that no file still links to the deleted docs/statusline-live/* files.
  • Fail open: panedata catches each read, and a missing section is left out. The mod's helper returns null on any error. The status line still catches all errors in __main__. Display only: no change to data dependence.
  • I did not run any test. Live tests are not approved.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Round 1 is fixed in 9ca31f78. The branch is rebased on main (it has #691).

Both reviewers, finding 1: hung /api/stats printed cg: stats loading….

  • Fixed. When a cache-state copy exists, the line now sets stats = {} and marks the figures stale. The money comes from cs["money"].
  • The line shows saved … session, the cache clock, ctx and ⏳. Neither notice shows.
  • With no copy at all, the notices stay (cg? not responding and loading…).
  • New test: TestStatuslineHungStatsWithACachestateCopyKeepsTheLine. It uses an old stats file, an old cache-state file and a stalled server. It also checks the no-copy case.

Both reviewers, finding 2: cg.py tip ignored --set-tips=off.

  • Fixed. cg.py tip returns no stale command when tips are off.
  • New test: TestCGTipHonoursSetTipsOff. It has a control that shows a tip first.

Non-blocking, done

  • A remembered retired layout is now ignored, so the installed --layout flag wins. The test covers it.
  • pane_strip now keeps main-thread requests only, as pane_fill does.
  • Docs table typo fixed (cache ○ cold 3:12).
  • The unused server in TestCGPanedata is removed.
  • Negative money has one rule on all three sides: -$1.50, and $0.00 for a value above -$0.005. TestMoneyFormatTable and the TypeScript table have negative cases.

Non-blocking, not changed

  • Subscription: the mod cannot know the plan. Only the status line payload has rate_limits, and the mod does not get it. So the pane shows lost today and the band shows the next price on a subscription. A fix needs a plan flag from the proxy. That is a separate change.
  • Cache tags with the date (day, series14h, and so on): the stale window is 60 s after midnight. I left it.
  • _money(approx=True) under one cent: no caller uses it.

Merge with #691

Tests on the final tree

  • claude plugin test .: 56 pass, 0 fail.
  • go test ./context-guru-plugin/...: ok.
  • python3 -m unittest test_tv test_costly: 83 OK.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Fixed in the next commit, after a live session in a real terminal.

  • Band wrapped. The terminal draws a link's address after its label (LinkProps has no option to hide it). The band has no dashboard link now. Row 1 is ◆ next message … [ Ping ] hide. The link is in the pane, on its own line under the title.
  • ping off: extended thinking on a model with no thinking. unsupported also covers gateway routes. Band text is now not on this route. Full text: "this session's route or settings cannot be pinged (a gateway, or extended thinking)". Both cg.py copies, the mod and the tests use it.
  • Pane lines wrapped badly. $x lost today is now its own line and is never split. Legends shorten below 70, 56 and 40 columns. A test checks that every lost today line is exactly $x lost today at 140, 80 and 60 columns.
  • Spacing. The pane uses one gap between every section. In your first capture I see the blank row between the header and NEXT MESSAGE. I could not reproduce a missing gap.

Tests: claude plugin test . 59 pass; go test ./context-guru-plugin/... ok; unittest test_tv test_costly OK.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @OsherElhadad) Claude Code 2.1.310 offload-review skill, @OsherElhadad's session resumed 2 of 2 2 of 2 498fa514285a approve

Verdict: approve

Findings

None.

Earlier findings

  • Mine 1 / reviewer 1, finding 1 (hung /api/stats printed cg: stats loading…): fixed. statusline.py:1564 now promotes both STATS_HUNG and STATS_TIMEOUT to STATS_TIMEOUT and sets stats = stats or {} when a cache-state copy exists. So the loading… check on line 1571 is false, and stale is true, which adds ⏳. With stats = {}, ka skips (if stats), and _save_segment reads cs["money"]. The new test TestStatuslineHungStatsWithACachestateCopyKeepsTheLine reaches the real STATS_HUNG path. Trace: run 1 has no copies, and both reads time out and record a back-off. Run 2 has a 40-minute stats file, so _fetch_stats sees the back-off and _timeout_result returns (None, STATS_HUNG). The cache-state read is in back-off too, so it serves the 40-minute copy (max_age=None). The test expects money, cold 36:00, ctx and ⏳, with no notice.
  • Mine 2 / reviewer 1, finding 2 (cg.py tip ignored --set-tips=off): fixed. cg.py:1508 checks sl._tips_off(). TestCGTipHonoursSetTipsOff has a control run, then runs the real --set-tips=off with the same XDG_CONFIG_HOME. The Codex copy is byte-identical and still falls back to an empty list.
  • Non-blocking, fixed: a retired remembered layout now returns None (statusline.py:781), so the installed flag wins, and a test covers it. pane_strip filters on thread_id == "". Negative money: all three sides use x <= -0.005. I checked -0.004 → $0.00, -1.5 → -$1.50, -123.4 → -$123 in _money, cg.usd and model.ts usd. Both tables cover these values. The unused server in TestCGPanedata is removed.
  • Non-blocking, not changed, author's reason accepted:
    • Subscription money in the mod: the mod gets no rate_limits, so it cannot know the plan. A fix needs a proxy flag, which is a separate change.
    • The midnight cache tag: the window is 60 s.
    • approx under one cent: no caller uses it.

Non-blocking

  • context-guru-plugin/hooks/register.tsx:4: the header comment still lists "dashboard link" in band row 1. Commit 498fa514 removed the link from the band.
  • TestStatuslineHungStatsWithACachestateCopyKeepsTheLine, the step "No cache-state copy at all: the notice stays", checks only strings.Contains(out, "cg"). A tighter check (loading or not responding) would catch a wrong notice.

What I checked

  • Last review: round 1, ccad9f9, 2026-10-25T10:50:28Z
  • New commits read: 3.
    • bacc4048 feat(plugin): calm band, sectioned pane and a status line that keeps the cold cache. This is the rebase of ccad9f97 on 86c118ba, which brings in #691. I read it with git range-diff. The only changes are the #691 not opted in wording, which now comes from main, the short band reason turns on next session, and the docs typo cache ○ cold 3:12.
    • 9ca31f78 fix(plugin): keep the status line when stats hang, honour --set-tips=off in the mod. I read the full diff: cg.py (both copies), statusline.py, model.ts, register.test.tsx, cg_test.go and statusline_golden_test.go.
    • 498fa514 fix(plugin): keep the band on one row and make the pane text wrap cleanly. I read the full diff: register.tsx, register.test.tsx, model.ts, cg.py (both copies), ping_test.go and docs/plugin/statusline.md.
  • Read in full: 2 reviews, 2 comments and 0 inline comments, from the three files.
  • New items since my last review:
    • Reviewer 1, round 1 review (10:52:20Z). Its two findings match mine. For its non-blocking points, I checked these fixes: pane_strip, the unused server, and the docs typo. I accepted the author's answer on the subscription next price.
    • Author comment 11:03:32Z (round 1 replies). I checked each claimed fix in the code. The results are listed above.
    • Author comment 11:11:47Z (the live-session fixes):
      • Band link removed. The Link is gone from the band, and the test asserts that no Link and no dashboard text is in row 1.
      • unsupported reworded. The words are the same in both cg.py copies, model.ts and ping_test.go. The short reason not on this route has fewer than 40 characters.
      • lost today on its own line. The cols-based legends are in register.tsx, and the test runs at 140, 80 and 60 columns.
      • I found no defect.
  • Fail open: no new network call. The tip change keeps its try/except. The pane changes are display only. Data dependence does not change.
  • I did not run any test. Live tests are not approved, and Go is not installed here.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @OsherElhadad) Claude Code 2.1.310 offload-review skill, @OsherElhadad's session resumed 1 of 2 2 of 2 498fa514285a approve

Verdict: approve

Findings

None.

Earlier findings

  • Mine 1 and reviewer 2's 1 (the same defect): hung /api/stats printed cg: stats loading…. Fixed in 9ca31f78.
    • statusline.py:1564 now covers STATS_HUNG and STATS_TIMEOUT. When a cache-state copy exists, it sets status = STATS_TIMEOUT and stats = stats or {}. So the line 1571 test (stats is None) is false, and no notice prints.
    • With stats = {}: _save_segment reads the money from cs["money"]. ka skips an empty stats. _latency_segment returns None. An older proxy with no money block shows no saved, not $0.00. That is correct.
    • A stats copy that is still fresh enough is kept, because stats or {} keeps it.
    • STATS_DOWN with a copy still prints cg ✕ proxy offline. That is correct: the proxy refused.
    • Trace of TestStatuslineHungStatsWithACachestateCopyKeepsTheLine: in run 2 the cache-state read is in back-off, and _fetch_json serves the 40-minute copy (max_age=None). The stats read gets _timeout_result(cached, 2400 s), which returns HUNG, and the new code promotes it. The test expects the figures and ⏳, and no notice. The test matches the code.
  • Mine 2 and reviewer 2's 2 (the same defect): cg.py tip ignored --set-tips=off. Fixed in 9ca31f78.
    • cg.py:1508 checks sl._tips_off() first. The import and the call stay inside the try, so the Codex copy (no statusline.py) still prints {"stale": []}.
    • TestCGTipHonoursSetTipsOff has a control run that shows a tip, then runs --set-tips=off, then expects no tip.
  • Non-blocking, from round 1:
    • The pane_strip main-thread filter is fixed.
    • The unused server in TestCGPanedata is removed.
    • The docs ○ typo is fixed.
    • The negative-money rule is now the same in the three formatters. I traced -0.004 ($0.00), -1.5 (-$1.50) and -123.4 (-$123) on each side.
    • The retired remembered layout is now ignored, so the installed flag wins (reviewer 2's note).
  • Rejected by the author, with a reason:
    • The subscription price and lost today in the mod. The author says the mod does not get rate_limits, so the fix needs a plan flag from the proxy. I checked: register.tsx reads only cg.py cachestate, panedata and tip, and none of them has the plan. I accept this as a separate change.
    • The midnight cache tags. The window is 60 s. I accept.
    • _money(approx=True) under a cent. No caller uses it. I accept.

Non-blocking

  • docs/plugin/statusline.md:231 and :235: the pane example still shows · $1.40 lost today at the end of the legend line. Since 498fa514, register.tsx puts $x lost today on its own line. Update the example.
  • docs/plugin/statusline.md:154 and skills/statusline/SKILL.md:87 say that a remembered retired layout "falls back to balanced". Since 9ca31f78, _saved_layout ignores the name, and the installed --layout flag wins. That is balanced only when the flag is absent or is also retired. The comment at statusline.py:759 also still says "falls back silently". Reword: "is ignored; the installed layout applies".
  • TestStatuslineHungStatsWithACachestateCopyKeepsTheLine: the no-copy check is strings.Contains(out, "cg"), which almost any output passes. Checking for not responding or loading would prove that the notice stays.

What I checked

  • Last review: round 1, ccad9f97feeabe3ddb8388a73d9932b0e7326fa4, 2026-10-25T10:52:20Z.
  • New commits read: 3 on the rebased branch. ccad9f97 is not an ancestor of HEAD (the branch was rebased on 86c118ba, which has #691 and #692).
    • bacc4048 feat(plugin): calm band, sectioned pane and a status line that keeps the cold cache. This is the rebased ccad9f97. I read git range-diff 1953b47c..ccad9f97 86c118ba..bacc4048. The only changes are the #691 merge: not opted in keeps the #691 wording, the band short reason is turns on next session, the tests follow, and the docs ○ typo is fixed.
    • 9ca31f78 fix(plugin): keep the status line when stats hang, honour --set-tips=off in the mod. I read the full diff.
    • 498fa514 fix(plugin): keep the band on one row and make the pane text wrap cleanly. I read the full diff.
  • Read in full: 2 reviews, 2 comments, 0 inline comments (from the three files).
  • New items since my last review:
    • Reviewer 2's round-1 review (10:50:28Z, posted before mine; I read it for the first time now). Its 2 findings are the same as mine. Its non-blocking points: I checked each one against the fixes above.
    • Author comment 11:03:32Z (fix list for round 1). I checked each claim against 9ca31f78. All are true. I accepted the three rejections (see above).
    • Author comment 11:11:47Z (band link removed, unsupported reworded, pane wrapping). I checked each claim against 498fa514:
      • The band has no Link, and the test asserts that.
      • The pane link is on its own line under the title, and the test asserts the first 3 lines.
      • keepalive/manualhold.go:56 says unsupported covers "thinking enabled, an unsupported route", so the new wording is correct. Both cg.py copies are identical. model.ts and ping_test.go follow.
      • $x lost today is now its own Text in the strip and heat sections. The legends shorten by cols. The new width test checks 140, 80 and 60 columns.
  • Read the code around each change: statusline.py main(), _timeout_result, _stale_stats, _fetch_json, _save_segment, _latency_segment, _config and _saved_layout; cg.py usd, pane_strip and the tip branch; register.tsx band and pane.
  • Fail open: no new network path. The mod's helper still returns null on any error. cg.py tip still catches everything. Display only: no change to data dependence.
  • I did not run any test. Live tests are not approved.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Round 2 notes are fixed in the next commit.

  • Pane example in the docs: $x lost today is on its own line.
  • Docs, skill and code comment: a remembered retired layout is ignored and the installed layout applies. A flagged one falls back to balanced.
  • Header comment in register.tsx: no dashboard link in the band.
  • Hung-stats test: the no-copy step now asserts loading or not responding.

Tests: claude plugin test . 59 pass. The status line, cg and docs Go tests pass.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Live re-check items are fixed in the next commit.

  1. unsupported now says "this route cannot be pinged" everywhere (band: ping off: not on this route).
  2. Each pane section has its own top gap, so a page break keeps it at every width.
  3. 60 column context legend: ▒ fixed 20% · █ chat 21% · ░ free.
  4. The band reads the first cache-state document every second for 5 s after session start and after a turn. A test covers it.
  5. Status line width: it was taken from the terminal with no margin, and Claude Code pads the line. Now terminal width minus 4, and /dev/tty is used when no standard stream is a terminal. An explicit width is exact. I checked 140 and 80 columns in a pty: 136 and 76. I did not see it in a real Claude Code session.
  6. No dashboard link in the band.

Tests: plugin test 60 pass; full Go suite ok; unittest OK.

@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Third live check is fixed in the next commit.

  1. Band ping slot: no entry and unknown reasons draw nothing. Every other reason is 17 characters or fewer (ping off: <reason> is at most 27). On a narrow band the price reads next $0.06 · $0.78 cold. A test renders row 1 for every reason code at 60 columns and checks that it fits one line and ends with hide. The pane and the toast keep the full text.
  2. SAVE MORE under 80 columns: the description is on its own dim line under the command.

Tests: plugin test 63 pass; full Go suite ok; unittest OK.

Osher Elhadad added 6 commits October 25, 2026 12:04
…the cold cache

Give each fact one home. The status line keeps the money, the cache
clock and the context bar. The mod keeps the next-message price,
Ping, the sub-agent caches, the weekly tip and the five modes.

Status line:
- Draw a cold cache dim (`cache ○ cold 3:12`) and keep it on the line.
- Keep the money and the context bar when a cache-state copy is old.
  Mark them with a hourglass. The clock is computed from the copy.
- Remove `next`, `ka` and the tip from balanced. Detailed shows the
  keep-alive count in plain words.
- Retire the layouts spark, strip, heat, fill and watch. A retired
  name falls back to balanced, silently.
- Use one money format and `h:mm:ss` clocks from one hour.

Mod:
- Band: `next message $0.06 · $0.78 if cold`, Ping or `ping off:
  <reason>`, dashboard link, reversible hide. No clock, no saved
  money, no rotating tip, no `$.ui.status` copy.
- Agent row: on by default, cold agents dimmed, opt-out with `a`.
- Weekly tip row only when a command is stale (`cg.py tip`).
- Pane: header, NEXT MESSAGE, AGENTS, SAVED LATELY, CACHE HITS,
  MISSES BY HOUR, CONTEXT, SAVE MORE. A section with no data is
  left out (`cg.py panedata`).
- Reword the `not opted in` ping reason.

Display only: no change to data dependence.

Closes #686
Part of #687

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…off in the mod

- Hung or slow /api/stats with a cache-state copy now shows the money,
  the clock and the context bar with a marker. No loading notice.
- cg.py tip returns no stale command when tips are off.
- A remembered retired layout is ignored, so the installed flag wins.
- Pane strip counts main-thread requests only.
- One negative-money rule in Python and TypeScript.
- Keep the short band reason "turns on next session" beside the
  merged full wording of the ping header change.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…anly

- Remove the dashboard link from the band. The terminal draws a link's
  address next to its label, so row 1 wrapped. The link stays in the
  pane, on its own line under the title.
- Reword the `unsupported` ping reason. It also covers gateway routes,
  not only extended thinking. Band text: `not on this route`.
- Pane legends depend on the width. `$x lost today` is always on its
  own line, and legends shorten at narrow widths.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
… layout rules

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…s margin, tidy pane gaps

- Use one neutral text for an unpingable route: "this route cannot be pinged".
- Ask for the first cache-state document every second for five seconds,
  after session start and after a turn, so the band shows at once.
- Take the status line width from the terminal minus a 4 column margin,
  and from /dev/tty when no standard stream is a terminal. Claude Code
  cut the line at "subag…" before.
- Keep short labels in the 60 column context legend (fixed, chat, free).
- Give each pane section its own top gap, so a page break keeps it.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…MORE cleanly

- Draw nothing in the ping slot for `no entry` and for unknown reasons.
  Right after a reply `no entry` is a timing artefact the user cannot act on.
- Cut every band ping-off text to 17 characters or fewer, and use
  "next" and "cold" on a narrow band. A test walks every reason code.
- Put each SAVE MORE description on its own dim line under 80 columns.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
@OsherElhadad
OsherElhadad merged commit 6db6832 into main Oct 25, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 25, 2026
OsherElhadad pushed a commit that referenced this pull request Oct 25, 2026
…0.2.5)

Both plugins changed in this release, so installed plugins must update.

- Claude Code plugin: 0.6.0 was set in #694. No change here.
- Codex plugin: 0.2.4 to 0.2.5. The vendored cg.py and costly.py
  and one skill changed in #512, #681, #683, #691, #694 and #698.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
amiddavid pushed a commit that referenced this pull request Oct 26, 2026
…0.2.5) (#701)

chore(plugin): bump the plugins for v0.6.0 (Claude Code 0.6.0, Codex 0.2.5)

Both plugins changed in this release, so installed plugins must update.

- Claude Code plugin: 0.6.0 was set in #694. No change here.
- Codex plugin: 0.2.4 to 0.2.5. The vendored cg.py and costly.py
  and one skill changed in #512, #681, #683, #691, #694 and #698.

Assisted-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Cold cache hides the cache clock, next cost, agents and Ping from the status line and mod

1 participant