Repository navigation
fix(plugin): tell the truth about unsupported pings and keep band row 1 on one line - #698
Conversation
… 1 on one line - Reword the `unsupported` ping reason. The server also sets it for extended thinking, so "not on this route" was false for most users. - Below 80 columns the band shows only `ping off`, and a test checks the row against width minus 4 for every reason, warm and cold. - Show `$x lost today` once in the pane, under CACHE HITS. - Retry the first cache-state read for about 15 s, not 5 s. Part of #687 Assisted-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
OsherElhadad
left a comment
There was a problem hiding this comment.
| 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 | db3df73e8ea2 |
approve |
Verdict: approve
Findings
None.
Non-blocking
cg.py:1393(both copies) — the "gateway route" text is narrower than the server rule.keepalive/keeper.go:754setsunsupportedwheneligible()is false. That also covers a provider that is not Anthropic, Bedrock, Vertex or OpenAI, and OpenAI on a route that is not/v1/responsesor a model before GPT-5.6 (keepalive/ping.go:82). Those are not gateways. The Codex copy is the same file, so a Codex user on chat completions sees "extended thinking, or a gateway route", and neither is true for them.docs/dashboard.md:144says "a route that cannot be pinged cheaply", which is more exact. You could write "(extended thinking, or a route Ping does not support)".register.tsx:63— more helper runs when the proxy is down. With nolast_ts(proxy not answering), eachturn.completenow starts 12cg.pyruns over about 18 s, not 6. If the pane is open, each run also loads the pane data. Turns closer than 18 s apart overlap the loops. The reads are local and fail open, so this is cost only. A guard that lets only onerefreshSoonrun at a time would fix it.cg.py:345—pane_heatstill computeslost. The pane no longer drawsheat.lost. The field is now unused. You can remove it, or keep it for other readers.
What I checked
- I read the full diff: 1 commit, 7 files, every changed line.
model.ts:unsupportedshort text isnot supported, 13 characters. That fits the 17-character test atregister.test.tsx:323.REASONSand bothPING_REASONScopies have the same full text. The twocg.pycopies are byte-identical (cmp).register.tsx:212,240-242:narrowisbodyColumns < 80. Below 80 the band shows onlyping off. At 80 or more it showsping off: <short reason>. The tests at 100 columns (register.test.tsx:303-331,:494) still cover the wide form.register.test.tsx:555-576: the fit test now runs warm and cold, limits row 1 to 56 characters, and checks that the reason is gone at 60 columns. For the cold cache it checks that neither Ping norping offshows, which matchesregister.tsx:230,240.register.tsx:369,380:lost todaynow shows only under CACHE HITS. The new test (:578) checks exactly one line, between CACHE HITS and MISSES BY HOUR.docs/plugin/statusline.mdmatches.register.tsx:63-72and the new slow-document test (:591): I traced the timing by hand. Old code (6 tries, 1 s apart) stops at about 5 s, so the band would not show at 12 s and the test fails. New code tries at 0, 1.5, … 9 s and 10.5 s. The try at 10.5 s sees the document, so the test passes. The test proves the change.ping_test.go:240: the Go test now expects the new words.- Fail open:
refreshSoonandrefreshkeep theirtry/catch. The change is display only. It adds no proxy path and no stored data, sodocs/data-dependence.mdneeds no change. - I ran no tests. Live tests are not approved.
OsherElhadad
left a comment
There was a problem hiding this comment.
| 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 | db3df73e8ea2 |
approve |
Verdict: approve
Findings
None.
Non-blocking
register.tsx:369—$x lost todaynow depends on the CACHE HITS section. Before, the figure also showed under MISSES BY HOUR (data.heat.lost).pane_strip(cg.py:318-333) returnsNonewhen/api/requestsfails or the session has no main-thread request yet. Then the pane drops the CACHE HITS section, and the day's lost dollars disappear too, althoughpane_heatstill has the same value. Proposal: show it under CACHE HITS, and fall back todata.heat.lostunder MISSES BY HOUR only whendata.stripis absent. A small test withstripremoved frompaneDocwould cover it.- Placement meaning. CACHE HITS says "last 20 requests" of this session.
lost_todayis the whole day, all sessions (/api/spend/explainsince midnight). MISSES BY HOUR is also day-wide, so it matches the figure better. This is a design choice. I note it only so the choice is deliberate. cg.py:345—heat.lostis now unused. Bothcg.pycopies still compute and send it. Remove it, or keep it for the fallback above.register.tsx:63-72— more processes when no document ever arrives. Eachturn.completestarts a newrefreshSoonloop. When the proxy is down, the loop never seeslast_ts, so each turn now runscg.py12 times over about 18 s (before: 6 times over about 6 s). The loops can overlap on fast turns. This is not new behavior, only twice the count. A guard so only one loop runs at a time would cap it.- Wording. The new reason text uses "can't". ASD-STE100 prefers "cannot". It is user-facing text, so this is optional.
What I checked
- Read the full diff
6db6832a..db3df73e(1 commit, 7 files) and the code around each change. model.tsREASONSandSHORT_REASONS: the newunsupportedtext matches inmodel.ts, bothcg.pycopies (I randiffon the two copies: identical),ping_test.go,register.test.tsxanddocs/plugin/statusline.md. The text matches the server meaning inkeepalive/manualhold.go:56(thinking enabled, or an unsupported route) anddocs/dashboard.md:144.register.tsx:240-242: below 80 columns the band showsping offwith no reason. At 80 columns and up the reason still shows. The tests atregister.test.tsx:303-332still check the wide form at the default 100 columns. At 80+ columns the longest row (17-character reason,if coldprices,hide) is about 71 characters plus padding, so it fits.- New band test (
register.test.tsx:555-576): it runs warm and cold, everyREASON_CODESentry,''and an unknown code. The assertions match the render logic: cold shows noping offand no Ping; warmno entryand unknown codes show nothing; other codes showping offthenhide. - New pane test (
register.test.tsx:578-589): it checks onelost todayline, betweenCACHE HITSandMISSES BY HOUR. The fixture hasstrip.lost: 1.4, so the line renders. - New slow-document test (
register.test.tsx:591-614): with the old loop (6 tries, 1 s apart, ending near 6 s), no document reaches the band before 12 s, so the test fails on old code and passes on new code (a try lands at 10.5 s at the latest). It proves the change. refreshSoonstays fail-open: the loop is intry/catch, andrefreshandhelpercatch their own errors.- Docs:
statusline.mddrops the duplicate$1.40 lost todayunder MISSES BY HOUR and the stale "27 characters" claim. Themodel.ts:172comment about 27 characters at 60 columns is now out of date (60 columns shows no reason), but it is harmless. - Data dependence: display only. No new reads or stored data. The PR states this. No
docs/data-dependence.mdchange is needed. - I did not run tests. Live tests are not approved, and Go is not installed.
…e ping text exact - Run only one first-document retry loop at a time. - Show `$x lost today` under MISSES BY HOUR when CACHE HITS has no data. - Say "Ping cannot hold this session (extended thinking, or a route Ping does not support)". It is true for Codex and OpenAI routes too. Part of #687 Assisted-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
|
The notes from both reviewers are done in the next commit.
Tests: |
OsherElhadad
left a comment
There was a problem hiding this comment.
| 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 | 4a40d6a1753f |
approve |
Verdict: approve
Findings
None.
Earlier notes (round 1, both reviewers; all were non-blocking)
- Reviewer 2: the "gateway route" text was too narrow. Fixed. All copies now say "Ping cannot hold this session (extended thinking, or a route Ping does not support)". This text is true for every case where
keepalive/keeper.go:754,775setsunsupported.model.ts:164, bothcg.py:1393copies (byte-identical),register.test.tsx:375,ping_test.go:240andstatusline.md:200agree. - Reviewers 1 and 2: overlapping retry loops. Fixed.
register.tsx:63-78has a module-levelsoonflag, andfinallyalways clears it. A second call while a loop runs returns at once. - Reviewer 2:
heat.lostwas unused. Fixed by use. It is now the fallback (next point). - Reviewer 1:
$x lost todaydisappeared when CACHE HITS had no data. Fixed.register.tsx:387showsheat.lostunder MISSES BY HOUR only whendata.stripis absent. When both sections are present, the line shows once. - Reviewer 1: placement meaning. The author kept the placement as a choice, and gave the reason (the figure covers the day). I accept it.
- Reviewer 1: "can't". Fixed ("cannot").
- Reviewer 1: stale comment at
model.ts:172(27 characters at 60 columns). Not changed. It is harmless and was not a finding.
Non-blocking
docs/plugin/statusline.md:229-236does not describe the new fallback. The pane sample shows$1.40 lost todayonly under CACHE HITS. One sentence could say that it moves under MISSES BY HOUR when CACHE HITS has no data.register.tsx:63— the guard can skip a quick refresh. This applies only while no document exists. Suppose a loop is near its last try and a turn completes. That turn starts no new loop, so the band can wait for the next 15 s poll. This is the intended trade, and the 15 s poll still runs, so nothing is lost.
What I checked
- Last review: round 1, db3df73, 2026-10-25T14:01:25Z
- New commits read: 1 (
4a40d6a1fix(plugin): run one retry loop, keep the day's lost dollars, make the ping text exact) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1, round 1 review (14:01:46Z): I checked each of its 5 notes against the new commit (see above).
- The author's reply comment (14:11:35Z): it says it fixed 3 points. I checked each one in the code and the tests. All 3 are fixed as stated.
register.tsx:63-78: thesoonflag is set before thetry, and thefinallyclears it on return, break and throw. Areturninside the loop (document found) also clears it. Fail-open does not change: errors still fall into thecatch.- New retry test (
register.test.tsx:640-658):session.startstarts the loop at time 0. The twoturn.completecalls return at once. In 14 s the loop makes about 10 reads. The 15 s poll does not fire yet. Without the guard, three loops would make about 30 reads, more than 12. So the test proves the guard. - New fallback test (
register.test.tsx:626-638):paneDochas nostrip. The test checks that there is no CACHE HITS, exactly one$1.40 lost today, and that it is under MISSES BY HOUR. It resetspaneDocat the end, as the other tests at:392,:428do. The earlier "shows once, under CACHE HITS" test (:578) still covers the case where both sections are present. - The long text appears only in the pane and the toast. The band short text (
not supported) did not change, so the band fit test still holds. - Data dependence: display only. No new reads and no stored data.
- I ran no tests. Live tests are not approved.
OsherElhadad
left a comment
There was a problem hiding this comment.
| 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 | 4a40d6a1753f |
approve |
Verdict: approve
Findings
None.
Status of earlier notes
Both reviewers approved in round 1, with non-blocking notes only.
- Reviewer 1:
lost todaydepends on CACHE HITS. Fixed.register.tsx:387shows the figure under MISSES BY HOUR only whendata.stripis absent. With strip present it shows once, under CACHE HITS (:374). The new test atregister.test.tsx:626-638removesstripand checks one line, belowMISSES BY HOUR. - Reviewer 1: placement meaning. The author kept the placement as a deliberate choice and gave the reason. I accept it.
- Reviewer 1 and reviewer 2:
heat.lostunused. Fixed by the fallback. The field is now in use. - Reviewer 1 and reviewer 2: more helper runs when the proxy is down. Fixed.
register.tsx:63-78adds asoonflag. A second call returns at once while a loop runs.finallyclears the flag on a normal exit, on the earlyreturn, and on a throw. - Reviewer 1: "can't". Fixed. The text now uses "cannot".
- Reviewer 2: "gateway route" too narrow. Fixed. The text is now "Ping cannot hold this session (extended thinking, or a route Ping does not support)". It is the same in
model.ts:164, bothcg.pycopies (byte-identical in the diff),ping_test.go:240,register.test.tsx:375anddocs/plugin/statusline.md:200. It matcheskeepalive/manualhold.go:56.
Non-blocking
register.test.tsx:652-653— the guard test can pass without the guard ifturn.completenever reaches the hook. The calls end in.catch(() => undefined). If the harness rejects the call before it runs theturn.completehook, only thesession.startloop runs. That gives 10 reads in 14 s, which also passes<= 12. When the hook does run, code without the guard gives about 30 reads (3 loops × 10), and the test fails, as it should. Proposal: remove the.catch, or record that the hook ran and assert it. This is test strength only. The guard code itself is correct.register.tsx:63—soonis module state. If a loop is still sleeping when a newsession.startcomes (for example after/clear), the new session's first loop returns at once. The new session then waits up to about 18 s for the old loop to end, or for the 15 s poll. This is small and fails open.
What I checked
- Last review: round 1,
db3df73e8ea28e8ad810fe3c07a28204a65b47ef, 2026-10-25T14:01:46Z - New commits read: 1 —
4a40d6a1fix(plugin): run one retry loop, keep the day's lost dollars, make the ping text exact (7 files, +46 −6) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Comment by OsherElhadad at 2026-10-25T14:11:35Z. It answers both reviewers' notes. I checked each answer against the commit (see "Status of earlier notes").
- Commit
4a40d6a1. I read every changed line and the code around it.
- Reviewer 2's round-1 review (14:01:25Z, before mine): I read it in full. Its notes are covered above.
refreshSoontrace: the flag is set beforetry, andfinallyclears it on all three exit paths.refreshandhelperstill catch their own errors, so the band stays fail-open.- Guard test timing: with the guard, one loop reads at 0, 1.5 … 13.5 s, which is 10 reads at most in 14 s. The 15 s poll does not fire. Without the guard, 3 loops give about 30 reads. So the test proves the guard when the hook runs (see the non-blocking note).
- Fallback test:
paneDocis set to{heat, spark}, and the test resets it at the end. This is the same pattern asregister.test.tsx:419-428. - Data dependence: no change. The changes are display text, one render condition, and a local retry guard. There are no new reads and no stored data.
- I did not run tests. Live tests are not approved, and Go is not installed.
A mod command has no plugin prefix. /context-guru:context-guru gives "Unknown command". Fix the comment, the skill, the retired-layout message and the docs. Part of #687 Assisted-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
|
The pane command is Tests: |
…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]>
…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]>
Summary
Four small fixes to the band and pane from #694. A live test found them. Part of #687.
Data dependence: none. Display only. No new reads, no new stored data.
What we found
unsupportedfor extended thinking, which real Claude Code sends. It also sets it for gateway routes. The band saidping off: not on this route. That is false for most users.$x lost todaytwice: under CACHE HITS and under MISSES BY HOUR.What changed
unsupportedreadsping off: not supportedin the band. The pane and the toast read "Ping can't hold this session (extended thinking, or a gateway route)".model.ts, bothcg.pycopies, tests and docs agree.ping off, with no reason.$x lost todayshows once, under CACHE HITS.cg.py, the on-disk cache).How it was tested
claude plugin validate .: passed.claude plugin test .: 66 pass, 0 fail.ping offbelow 80 columns.$x lost todayshows once, under CACHE HITS.go test ./context-guru-plugin/...with a privateTMPDIRandCLAUDE_*andANTHROPIC_*unset: ok, 358 s.python3 -m unittest test_tv test_costly: OK.🤖 Generated with Claude Code