Repository navigation
feat(plugin): the mod draws the status line, dashboard link on the band - #735
Conversation
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 | fe2c9cb603fe |
blocking |
Verdict: blocking
Findings
-
context-guru-plugin/scripts/settings.py:3437 — uninstall leaves the new
statusline_askedrecord in the user's settings file- What fails:
install.sh --statusline(oradd --url … --statusline …), thensettings.py remove --url …. The file keeps"$context-guru": {"statusline_asked": true}. Our bookkeeping key outlives the uninstall. A file that context-guru created is not deleted, becausedatais not empty. - Proof:
apply_statusline(line 220) now writesmeta[STATUSLINE_ASKED_META] = True.remove_statusline_onlypops it (line 298). Butcmd_remove's routing branch has its own copy of the cleanup. It pops onlySTATUSLINE_METAandSTATUSLINE_PREV_META(lines 3437-3438). Thenif not meta: data.pop(META)(line 3439) does not run, becausestatusline_askedis still there.maybe_delete_if_empty(line 2471) returns False for a non-emptydata.TestUninstallRestoresTheBaseURLItReplacedasserts "no bookkeeping left behind", but it installs no status line.TestSettingsStatuslineRoundTripsinstalls one but does not check$context-guru. So no test catches this. - Fix: add
meta.pop(STATUSLINE_ASKED_META, None)beside line 3438. ExtendTestSettingsStatuslineRoundTripsto assert that$context-guruis absent afterremove.
- What fails:
-
context-guru-plugin/scripts/settings.py:269 — the migration also removes lines the user asked for and set up before 0.6.1, with no backup
- What fails: before 0.6.1, no writer recorded
statusline_asked. Soretire_statuslineremoves every line of ours, not only the lines that a default install wrote. Example: a user ran/context-guru:statuslinewith--layout=detailed --hide=tools(skills/statusline/SKILL.md:188), or set their ownrefreshInterval. At the first 0.6.1 SessionStart, the line is deleted./context-guru:statuslinebrings back a line, but not the flags the user chose. The PR text and docs/plugin/statusline.md:3 say only "a status line an earlier install wrote by default is removed". - Proof:
retire_statuslinereturns False only whenstatusline_asked is True(line 276). Then it callsremove_statusline_only, which removes any line that is ours by record.cmd_statusline_repointthen callssave(real, data)with nobackup().cmd_offtakes a backup before the same removal (line 3255). - Fix: retire only the exact default form. That is
python3 "<…>/statusline.py"with no flags, and norefreshIntervalother than the default that install wrote. Keep any other line and mark it as asked. Also take abackup()beforesavein the retire branch. Add a test with a flagged pre-0.6.1 line that must stay.
- What fails: before 0.6.1, no writer recorded
-
context-guru-plugin/scripts/cg.py:277 — the band says
cg ✕ proxy offlinewhen the proxy is up but answers with an error or is slow- What fails: the proxy runs without
--dashboard(a 404 on/api/cachestate), returns a 500, or takes more than 5 s. Each case gives{"error": "proxy not answering"}, and the band then shows "proxy offline". The status line uses those words only for an unreachable proxy (STATS_DOWN). It shows "stats loading…" for a timeout and shows no offline notice for an HTTP error (STATS_EMPTY). - Proof:
Api.get(cg.py:79-82) catchesOSError.urllib.error.HTTPErrorandTimeoutErrorare both subclasses ofOSError, so they also returnNone.cachestate_cachedturnsNoneinto"proxy not answering"(line 224). The backoff path also returns that error with no fetch. Line 277 maps this error to the offline notice. The new comment says "for an unreachable proxy", but the code cannot tell an unreachable proxy from the other cases. In statusline.py, lines 506-510 keep the three cases apart. - Fix: let
cachestate_cachedsay why it failed. UseApi.send, which keeps the status, or record the failure kind as_fetch_statsdoes. Set the offline notice only for a refused connection. Add a cg.py test for a 404 proxy that expects no offline notice.
- What fails: the proxy runs without
-
PR description — no data-dependence statement
- What fails: CLAUDE.md requires every PR that adds or changes a feature to state its data dependence and its behavior at each storage level. This PR adds band features: manual pings, the window's saved tokens, the ctx bar and the rotating row. The description has no such section.
- Proof: the PR body has Summary and Test plan only.
docs/data-dependence.mdis not touched. - Fix: add a short section. My reading is that every new figure is metadata (counts, $ totals, timestamps and token counts from
/api/cachestate,/api/stats?lean=1, and the local update-check file). So the dependence is probably unchanged, but the PR must say so.
Non-blocking
skills/statusline/SKILL.md:108-113still says "It is on by default./context-guru:install's own orchestrator … installs it". The model reads this skill, so it will tell users the wrong default. Update it to matchinstall/SKILL.md.start-proxy.sh:284-287: suppose the user later replaced our line by hand but ourinstalled_statuslinerecord stays. Then the grep matches at every SessionStart, and python3 starts each time, butretire_statuslinechanges nothing. The block's comment says "cheap by construction… once per update". This was true before this PR only for the plugin-cache branch. Consider dropping the stale record in that case.cmd_add, statusline-only path (settings.py:2903): when the line is already identical, the call returnsunchangedbeforeapply_statusline. Sostatusline_askedis not set for a pre-0.6.1 line that has not been retired yet. Rare, but the next SessionStart then removes a line the user just asked for.register.test.tsx"nothing ever read" test usesnotice: 'cg ✕ token refused · /context-guru:status'. cg.py never produces this text. Add a test through cg.py for theproxy offlinenotice that the code really makes.model.tscacheClock:critical && true ? '!' : ''—&& truedoes nothing.- The 1 s tick bumps
tickwhile the band is hidden too, and it does so forever while a cold clock shows. It does no reads, so the cost is small.
What I checked
- The full diff
ad87e369..fe2c9cb6, all 14 files, every changed line. I read both commits. settings.py:apply_statusline,retire_statusline,remove_statusline_only,repoint_statusline,cmd_statusline_repoint,cmd_off, both branches ofcmd_remove,cmd_add's statusline gate, andmaybe_delete_if_empty.start-proxy.shstep 0b: the new grep gate and its fall-through to the old repoint case.install.sh:--statusline/--no-statuslineparsing and thestatusline=offoutput, againstinstall/SKILL.md.cg.py:status_extrasagainst the statusline.py helpers it calls (_update_available_segment,_fetch_stats,_bg_json,_saved_tokens_text,WINDOW_TTL_SECONDS, thewin-cache tag),cachestate_cached,Api.get, and the doctor change. The Codex copy has nostatusline.py. Theimportfails inside thetry, so it fails open.model.ts:mainEntryagainst statusline.py_main_cs,clockOf/cacheClock,ctxNumbers,moneyPair's $0 floor, theanchorinsignature, and thewindow/sameModelrule.register.tsx:load(the window start in ms, matching_window_start_ms),ticked,engineFiguresagainst the 2.1.307SessionMeasureInput/SessionRateLimittypes,statusRow's width order, the row priority, the notice branch, the link, and the pane floor.dash/cachestate.gocacheState: thenonedocument,window/window_exact/keepalive.- The new and changed tests in
register.test.tsx,plugin_test.goandstatusline_repoint_test.go, and the docs indocs/plugin/statusline.mdanddoctor.md. - I did not run tests (not approved). Go is not installed.
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 | fe2c9cb603fe |
blocking |
Verdict: blocking
Findings
-
context-guru-plugin/scripts/settings.py:3437 — uninstall leaves
statusline_askedbehind, so a file context-guru created is no longer deleted- What fails:
install.sh --statusline(or/context-guru:statusline), then/context-guru:uninstall.cmd_removepopsinstalled_statuslineandprevious_statusline, but not the newstatusline_asked. The file keeps{"$context-guru": {"statusline_asked": true}}.maybe_delete_if_emptythen sees a non-empty dict and keeps the file. Uninstall used to delete a settings file that context-guru created. Now it leaves a stub. - Proof: I ran
settings.py add --file F --url http://127.0.0.1:8787/anthropic --statusline /opt/cg/statusline.py, thensettings.py remove --file F --url …, on a temp HOME.- Base
ad87e369:file_deleted=true, and the file is gone. - Head:
result=removed, and F still holds{"$context-guru": {"statusline_asked": true}}. With athemekey in the file, the stub sits next to it. remove_statusline_only(line 298) pops the key. The full-remove branch at lines 3436-3437 does not.
- Base
- Fix: add
meta.pop(STATUSLINE_ASKED_META, None)next to line 3437. Add a Go test:add --statuslinethenremoveon a new file givesfile_deleted=true(TestSettingsStatuslineRoundTripschecks onlystatusLine).
- What fails:
-
context-guru-plugin/scripts/settings.py:269 — the migration also removes lines the user asked for by name before 0.6.1
- What fails: before this PR,
apply_statuslinenever wrotestatusline_asked. So a line from/context-guru:statuslineon 0.6.0 or earlier looks the same on disk as a default install. That includes a custom one, for example--layout=detailed --hide=toolsfromskills/statusline/SKILL.md:188. At the next SessionStart,retire_statuslineremoves it. The docstring ("Never a line the user asked for by name") anddocs/plugin/statusline.md:3("A status line an earlier install wrote by default is removed") say this does not happen. The user also loses their layout flags. - Proof:
git show ad87e369:context-guru-plugin/scripts/settings.py.apply_statuslinethere writes onlyinstalled_statuslineandprevious_statusline.retire_statuslinereturns False only whenstatusline_asked is True.start-proxy.sh:284-287sends every file that hasinstalled_statuslineand nostatusline_askedtostatusline-repoint. - Fix: retire only the exact default command that
install.shwrote:python3 "<…>/scripts/statusline.py"with no flags (install.sh:1373). Keep any command that has flags. Or say in the docs and the SessionStart message that this also removes a line made by hand on an older version, and how to get it back.
- What fails: before this PR,
-
context-guru-plugin/scripts/cg.py:277 —
cg ✕ proxy offlineshows for a proxy that answers- What fails:
cachestate_cachedreturns{"error": "proxy not answering"}for anyApi.getfailure: refused, a 5 s timeout, 401, 404, 500, or a body that is not JSON. The new branch turns all of these intocg ✕ proxy offline. The status line keeps that text for an unreachable proxy only (statusline.py:28-37,STATS_DOWN). For slow or hung it sayscg? not respondingorstats loading…, and for a non-2xx answer it shows nothing (STATS_EMPTY). So a slow proxy, a dashboard that is off, or a refused token now shows "offline" on the band. - Proof: I started a local HTTP server that answers 404, then 401, and ran
cg.py cachestate --json --session sess-1 --port <p>against each. Both printed{"error":"proxy not answering","notice":"cg ✕ proxy offline"}with exit 1. - Fix: make
cachestate_cachedtell the cases apart, usingApi.send's status (0 = no answer, -1 = timeout, HTTP code). Setnoticeonly for 0. Optional:cg? not respondingfor a timeout.
- What fails:
-
context-guru-plugin/cg_test.go — the new
cg.py cachestateoutput has no test- What fails: nothing tests
status_extras(update,manual_pings,window_saved),--window-start-ms, ornotice. The TSX tests mock the helper's stdout. The offline-notice test (register.test.tsx, "nothing ever read, and the proxy is down") feedscg ✕ token refused · /context-guru:status, a stringcg.pynever makes. A rename instatusline.py(_fetch_stats,_bg_json,_saved_tokens_text,_update_available_segment) would silently blank these fields, becausestatus_extrascatches every exception. - Proof:
grep -n 'window-start-ms\|status_extras\|"notice"' context-guru-plugin/*_test.gofinds nothing. - Fix: add a
cg_test.gocase on the existing stub (statuslineCounting). It must checkmanual_pingsandwindow_savedwith--window-start-ms,updatefrom a fakeupdate-check.yaml, andnoticefor a dead port only (finding 3).
- What fails: nothing tests
-
Commits 5871cd9 and fe2c9cb — the commit rules in CLAUDE.md are not met
- What fails: CLAUDE.md says "DCO sign-off is mandatory" and "AI attribution uses
Assisted-By:— neverCo-Authored-By". - Proof:
git log --format=%B ad87e369..HEAD. 5871cd9 has noSigned-off-by:. Both commits useCo-Authored-By: Claude Opus 5.5 …. - Fix: reword both commits with
git commit -sand anAssisted-By:line.
- What fails: CLAUDE.md says "DCO sign-off is mandatory" and "AI attribution uses
Non-blocking
register.tsxticked: the tick runs once a second for the whole session, also while the cache is cold, while the band is hidden, and while a survey shows. Each tick reads the snapshot and redraws the band. Skip the tick whenisHiddenis true.model.ts: row 1 (isWarm, fromcoldAt) letsheld_until_mshold the cache warm even after the entry has expired. The new clock (clockOf) correctly does not. When a planned ping fails, row 1 can say warm with a Ping button while row 2 sayscache ○ cold. This is older code, but now both are on one band.cacheClock:critical && trueis the same ascritical.- The migration removes the status line for every user at the next session, including users on a host that cannot load the mod (
modulesin hooks.json). Is there a minimum Claude Code version for the band? If an older host shows no band, those users lose both displays. - The PR body does not state the data dependence, as CLAUDE.md asks. The band reads only metadata (money, counts, timestamps, token counts), so this is a sentence in the PR body, not a change to
docs/data-dependence.md. skills/statusline/SKILL.md:107still says "It is on by default./context-guru:install… installs it". This PR makes that text wrong.
What I checked
- CLAUDE.md, and
docs/design.mdfor the layout rules. The change stays in the plugin, and no library package changed. - Every changed line in all 14 files. Both commit messages. The PR body.
model.tsagainststatusline.py:remaining_seconds,held_seconds,_until_cold,_cache_segment,_main_cs,_ctx_numbers,_money_pair,_manual_ping_mark,_subscription/_window_start_ms. The clock, the colour bands,↻, the main-thread merge, the window-model rule and the cache tagwin-<s>match.dash/cachestate.go: the JSON field names the mod reads (window,window_exact,money.others.threads,held_until_ms,keepalive), and thenone: trueanswer before a first touch (the band then stays empty, no notice).- The mod API types (
SessionMeasureInput,SessionRateLimit,SessionContextUsage) forrateLimits,resetsAtandcontext.window. settings.pyapply_statusline,retire_statusline,remove_statusline_only,cmd_statusline_repoint,cmd_remove.start-proxy.shgrep gate.install.shflag parsing andstatusline=off.- The Codex copy of
cg.pyis the same file. Its folder has nostatusline.py, sostatus_extrasfails open there (ImportError is caught). - I ran Python only, on temp folders: findings 1 and 3. I ran no Go and no TSX tests.
fe2c9cb to
f2c5e16
Compare
|
Replies to round 1 (both reviewers). All fixes are in f2c5e16. The branch is now one commit with R1 #1, R2 #1: uninstall leaves R1 #2, R2 #2: the migration removes lines that the user asked for before 0.6.1. Fixed. R1 #3, R2 #3: R1 #4: no test for the new R1 #5: commit rules. Fixed: DCO sign-off, and R2 #4: data dependence. Added to the PR body: no change, metadata only. Non-blocking:
|
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.310 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 2 of 2 | f2c5e16dfc33 |
blocking |
Verdict: blocking
Findings
- docs/plugin/statusline.md:309 — the doc still says the install writes the status line by default
- What fails: a user reads the "Turn it on, off, or change it" section. It says "
/context-guru:statuslineinstalls it (the install also does this by default)". After this PR, the install writes no line unless asked. The sentence contradicts line 3 of the same file ("the install no longer writes a status line"), which this PR itself added, andskills/install/SKILL.md:192("offis the default"). - Proof:
docs/plugin/statusline.md:309. The PR edits this file (33 lines changed) and fixed the same stale claim inskills/statusline/SKILL.md, but missed this one. - Fix: delete "(the install also does this by default)", or replace with "(or
install.sh --statusline)". One line, doc only.
- What fails: a user reads the "Turn it on, off, or change it" section. It says "
Non-blocking
- The band shows nothing when the proxy times out (
failure: "timeout"). The status line sayscg? not respondingthere. The doc (statusline.md:201) promises the notice only for a proxy that is down, so this is a divergence in words, not a defect. cmd_addwith both--urland--statuslinefor a line already present: the full-unchanged return at settings.py:2943 still does not recordstatusline_asked.install.shnever combines the two flags and the skill uses the statusline-only path, so I found no caller that reaches it. Noted because the same gap in the statusline-only path was fixed this round.- The kept-line branch of
cmd_statusline_repoint(settings.py:3107) saves without a backup. It only adds thestatusline_askedrecord and removes nothing, so no backup is owed. Agree with the design.
What I checked
- Last review: round 1, fe2c9cb, 2026-10-26T17:19:45Z.
- New commits read: 1 —
f2c5e16d"feat(plugin): the mod draws the status line, dashboard link on the band". The branch was force-pushed: this one commit squashes the two round-1 commits (5871cd9d,fe2c9cb6) and adds the fixes.fe2c9cb6is not an ancestor of the new head, so I readgit diff fe2c9cb6..HEADin full (390 lines, 9 files) plus the changed code around each hunk. - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
- New items since my last review, and what I did about each:
- Reviewer 1's round-1 review (17:25:56Z). Findings 1-3 match mine. Finding 4 (no test for the new
cg.py cachestateoutput) and 5 (commit rules) — both checked as fixed, below. - The author's reply (17:31:41Z). Every fix claim in it checked against the code, line by line.
- The new head commit. Reviewed as a first review below.
- Reviewer 1's round-1 review (17:25:56Z). Findings 1-3 match mine. Finding 4 (no test for the new
- Earlier findings, both reviewers:
- R1#1 / R2#1, uninstall leaves
statusline_asked: fixed.cmd_removepops it (settings.py:3463); the statusline-only branch pops it throughremove_statusline_only(settings.py:310).TestSettingsStatuslineRoundTripsnow asserts no$context-gururecord stays and that a file we created is deleted (file_deleted=true). The assertion fails without the fix, as the author claims. - R1#2 / R2#2, the migration removes lines asked for before 0.6.1: fixed.
retire_statuslinenow retires only the exact default form:_DEFAULT_STATUSLINEfullmatch (the barepython3 "<…>/scripts/statusline.py"thatinstall.sh:1373writes) andrefreshInterval1 (settings.py:287). Any other line of ours is kept and marked asked;metais a dict whenever that branch runs, becauseis_ours_statuslinerequires the record. The retire branch takes abackup()before the removal (settings.py:3109), and the kept branch saves without one, which is right because it removes nothing.cmd_statusline_repoint's identity check (data.get(STATUSLINE_KEY) is kept) separates the two cases correctly: a removal either deletes the key or restores a different object. Tests:TestSessionStartKeepsACustomisedPre061StatusLine(flags, tuned interval) andTestRetiringTheDefaultStatusLineTakesABackup(glob matchesbackup()'s real path and name pattern). The non-blockingcmd_addunchanged case is fixed too (settings.py:2916-2922). - R1#3 / R2#3,
proxy offlinefor a proxy that answers: fixed.cachestate_cachedusesApi.send, which returns 0 for no answer, -1 for a timeout, the HTTP code otherwise; the failure kind is recorded and returned, and onlydownsets the notice (cg.py:286-287). The backoff path carries the recorded kind.TestCGCachestateSaysOfflineOnlyWhenNothingAnswerscovers 404, 500 and a dead port with fresh cache dirs, so no cross-run backoff pollution. - R1#4, no test for the cachestate extras: fixed.
TestCGCachestateCarriesTheStatusLinesExtrasdrives the realcg.pyagainst a stub proxy. I checked its expectations against the helpers it exercises:update-check.yamlwithanswer: askgives▲ update v0.6.9(_update_available_segment, noproxy-versionfile to suppress it);manual_pingscomes from the session-scoped/api/stats;saved 1.2M rd / 85.0k wrmatches_saved_tokens(read =replay_tokens, write =saved_unique) and_human's format.runCG/runCGCodeexist in cg_test.go and setCLAUDE_CODE_SESSION_ID=session-A, matching the stub. - R1#5, commit rules: fixed.
f2c5e16dcarriesSigned-off-by:andAssisted-By:, noCo-Authored-By. - R2#4, data dependence: fixed. The PR body now has a "Data dependence" section: no change, metadata only, same at every storage level.
- R1#1 / R2#1, uninstall leaves
- Rejections I checked and accept:
- Row 1 (
coldAt,held_until_ms) vs row 2 (clockOf): the author's reason holds. Row 1 prices the next message while a plan holds the cache; row 2 is the status line's clock. A follow-up is offered. Not a defect I can prove. start-proxy.shstarting python3 each SessionStart when the record stays but the line was replaced by hand: rare, one python3 start, fails open. The new kept-line marking shrinks this case further. Accept.- Older hosts with no mod support:
hooks.jsonalready needsmodulessince 0.5.x, and/context-guru:statuslineremains. Accept.
- Row 1 (
- New commit, first-review pass:
cachestate_cached's new shape against both other callers (cg.py:434, cg.py:1504 — neither passesfetch, so the changed injected-fetcher contract touches nothing in-tree); the codex copy ofcg.pyis byte-identical;model.ts(critical && trueremoved);register.tsxtickedreturns early while hidden; the two new Go test files' imports, helpers and package;skills/statusline/SKILL.mdnow says off by default; the PR body. - I did not run tests (not approved). Go is not installed.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.310 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 2 of 2 | f2c5e16dfc33 |
approve |
Verdict: approve
Findings
None. Every round-1 finding is fixed, and the fix code has no defect I can show.
Status of the round-1 findings
- Uninstall leaves
statusline_asked(R1 #1, R2 #1) — fixed.cmd_removepops it (settings.py:3463).remove_statusline_onlypops it too (settings.py:310). I ranadd --statuslinethenremoveon a fresh temp file:file_deleted=true, and the file is gone.TestSettingsStatuslineRoundTripsnow checks both: no$context-guruafterremove, andfile_deleted=truefor a file we created. - The migration removed lines asked for before 0.6.1 (R1 #2, R2 #2) — fixed.
retire_statusline(settings.py:273) now retires only the exact default form:_DEFAULT_STATUSLINEfullmatch, no flags,refreshInterval1. Anything else of ours stays and is marked asked. The retire branch takes abackup()first (settings.py:3109). I ran all six cases through the real function on temp data: flags kept, interval 5 kept, exact default removed, default with norefreshIntervalremoved, a recorded previous line restored, an asked line untouched. proxy offlinefor a proxy that answers (R1 #3, R2 #3) — fixed.cachestate_cachedusesApi.sendand recordsdown(status 0),timeout(-1) orempty(any other status). Onlydowngets the notice (cg.py:286). I readApi.send: connection refused gives 0, a read timeout gives -1, an HTTP error gives its code. So 404 and 500 giveempty, no notice.TestCGCachestateSaysOfflineOnlyWhenNothingAnswerscovers 404, 500 and a dead port.- No test for the
cachestateoutput (R1 #4) — fixed.TestCGCachestateCarriesTheStatusLinesExtraschecksupdate(fakeupdate-check.yamlinCONTEXT_GURU_STATE),manual_pingsandwindow_savedwith--window-start-ms. I checked the helpers it goes through (_update_available_segment,_fetch_stats,_bg_json,_saved_tokens_text) and the strings it expects: all match, and a duplicateCONTEXT_GURU_STATEin the child env resolves to the test's value (checked: Python keeps the last entry). - Commit rules (R1 #5) — fixed. One commit,
Signed-off-by:present,Assisted-By:instead ofCo-Authored-By:. - Data dependence (R2 #4) — fixed. The PR body has a Data dependence section: no change, metadata only.
Non-blocking items from round 1: SKILL.md now says off by default; critical && true removed; the tick does nothing while hidden; the real offline string is now tested in Go. The author declined three with reasons I checked and accept: the start-proxy.sh python3 start (rare, one start, retire_statusline returns False there), the row-1/row-2 warm wording (documented intent, follow-up offered), and older hosts without mod support (the mod has needed modules since 0.5.x, so those users had no band before either).
Non-blocking
- settings.py:2943 —
add --url … --statusline …on an already complete install does not recordstatusline_asked. The earlyunchangedreturn (line 2948) skipsapply_statusline, so a pre-0.6.1 default line re-asked for this way is still retired at the next SessionStart. I ran it:result=unchanged, nostatusline_askedwritten. No shipped caller passes both flags — install.sh's routing add passes no--statusline, its statusline add passes no--url, and the skill passes no--url— so only a hand-run command hits it, and the retire is backed up and reversible. Fix: the same marking the no---urlbranch now does (settings.py:2916). - settings.py:3111 — the retire message is wrong when a previous line was restored. If our default line had replaced a user line (recorded
previous_statusline), the retire restores it, but the print still says the status line "moved into the Context Guru band". The behavior is right; only the words mislead. - settings.py:2916 — the unchanged re-ask marking has no test. I verified it by hand (
result=unchanged,statusline_askedwritten). The round-trip test's re-add passes--url, so it goes around this branch.
What I checked
- Last review: round 1, fe2c9cb, 2026-10-26T17:25:56Z.
- New commits read: 1 — f2c5e16 "feat(plugin): the mod draws the status line, dashboard link on the band". The branch was force-pushed into this single commit;
fe2c9cbis not an ancestor, so I read the tree difffe2c9cb..f2c5e16d(390 lines, 8 files) as the change since my last review, and the round-1 diff for the rest. - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
- New items since my last review: the commit f2c5e16 (whole delta read, file by file below) and the author's reply comment (each claim checked against the code, as above).
settings.py:retire_statusline,_DEFAULT_STATUSLINEagainst install.sh's default command (python3 "<…>/scripts/statusline.py",refreshInterval1),remove_statusline_only,cmd_statusline_repoint's kept/removed identity split and its backup order,cmd_add's unchanged re-ask marking and the--urlearly return,cmd_remove's cleanup,backup()'s file naming against the new test's glob.cg.py(both copies are byte-identical):cachestate_cached's new status handling againstApi.send's contract (0 / -1 / HTTP code),record_failure/backoffkinds in cgcache.py,cmd_cachestate's notice gate,status_extrasagainst the statusline.py helpers it calls and their URLs, and the new Go tests' stubs against those URLs and strings.register.tsxticked(the hidden check and what happens on unhide),model.tscacheClock.- The new and extended tests:
cg_cachestate_test.go,statusline_repoint_test.go(both new tests, against therepointEnvhelpers),plugin_test.go's round-trip extension. - The PR body's data-dependence section,
skills/statusline/SKILL.md's new default, and the commit message's trailers. - I ran Python only, on temp folders: the six retire cases,
add --statusline+removeon a fresh file, the re-ask with and without--url, and the duplicate-env resolution. I ran no Go and no TSX tests.
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 | f2c5e16dfc33 |
blocking |
Verdict: blocking
Findings
- docs/plugin/statusline.md:309 — agree with reviewer 2 (round 2), finding 1
- What fails: the line says "
/context-guru:statuslineinstalls it (the install also does this by default)". Line 3 of the same file says the install no longer writes a status line.install.shnow emitsstatusline=offby default. - Proof: I read line 309 at
f2c5e16d. No new proof beyond reviewer 2's. - Fix: replace "(the install also does this by default)" with "(or
install.sh --statusline)". This is a doc-only fix. With it, I have no other finding.
- What fails: the line says "
Non-blocking
cmd_statusline_repoint(settings.py:3106-3108): a kept pre-0.6.1 line (it has flags or a tuned interval) is marked asked, and thencontinueskipsrepoint_statuslinefor this session. So the line points at the old plugin version for one more session. The next SessionStart repoints it, because thestart-proxy.shplugin-cache case still matches. The old version stays in the cache, so the line works. To fix it, fall through to the repoint instead ofcontinue._DEFAULT_STATUSLINEalso matches a bare line that a user made with/context-guru:statuslineand no flags. That skill writes the same string as the install. The two cannot be told apart on disk. The SessionStart message names the command that brings the line back, so I accept this.
What I checked
- Last review: round 1, fe2c9cb, 2026-10-26T17:25:56Z
- New commits read: 1.
f2c5e16dfeat(plugin): the mod draws the status line, dashboard link on the band. The author force-pushed. This one commit replaces 5871cd9 and fe2c9cb, sogit log fe2c9cb6..HEADlists it alone. I readgit diff fe2c9cb6 HEADin full (9 files) and the code around each hunk. The Codex copy ofcg.pyis still the same byte for byte. - Read in full: 3 reviews, 1 comment, 0 inline comments (from the three files).
- New items since my last review:
- The author's reply (17:31:41Z). I checked each fix claim against the code and with runs (below).
- Reviewer 2, round 2 (17:38:47Z, glm). I checked finding 1 myself: agree, see Findings. I checked its non-blocking points. The timeout case shows no notice, by design.
cmd_addwith--urland--statuslinehas no in-tree caller. The kept line saves with no backup, which is correct because nothing is removed. - The new head commit: reviewed as in round 1.
- Earlier findings:
- R1#1 / R2#1 (uninstall leaves
statusline_asked): fixed.cmd_removepops it (settings.py:3463).TestSettingsStatuslineRoundTripschecks that the record is gone and thatfile_deleted=true. - R1#2 / R2#2 (the migration removes lines asked for before 0.6.1): fixed. I ran
retire_statuslineon 6 temp documents:- the bare default: removed;
- the default that replaced a line: removed, and the old line comes back;
- with
--layout=detailed: kept, marked asked; - with
refreshInterval5: kept, marked asked; - already asked: no change;
- no
refreshInterval(pre-cbaa4041): removed. git tag --containsshows that no release ever wroterefreshInterval5. 11f465d and cbaa404 are in the same tags. So!= 1keeps only lines that a user tuned. The regex matches both forms that the install ever wrote:${CLAUDE_PLUGIN_ROOT}/scripts/statusline.pyand the resolvedroute_herepath. The retire takesbackup()first.cmd_addrecordsstatusline_askedwhen the same line is asked for again.
- R1#3 / R2#3 (
proxy offlinefor a proxy that answers): fixed. I rancg.py cachestate --jsontwo times against a 404 server:failure: empty, no notice, also on the second run inside the back-off. Two times against a dead port:failure: downandcg ✕ proxy offlineboth times.statusline.pywritestimeoutorerrorinto the samecs-back-off file. Neither isdown, so the band shows no offline notice for them. - R1#4 (no test for the new cachestate output): fixed.
cg_cachestate_test.gochecksupdate,manual_pings,window_savedwith--window-start-ms, and the notice for 404, 500 and a dead port. I checked the expected strings against_update_available_segment,_saved_tokens_textand_human. - R1#5 (commit rules): fixed.
f2c5e16dhasSigned-off-by:andAssisted-By:, and noCo-Authored-By. - R2#4 (data dependence): fixed. The PR body has a "Data dependence" section: no change, metadata only. I agree.
- My non-blocking points:
- Tick while hidden: fixed (register.tsx:140).
critical && true: fixed.skills/statusline/SKILL.md: fixed.- Row 1 against row 2: the author kept it and gave a reason. I accept it: row 1 shows what the next message costs, and it is older code.
- Hosts with no mod: I accept the reason.
moduleshas been inhooks.jsonsince 0.5.x, and/context-guru:statuslinestays.
- R1#1 / R2#1 (uninstall leaves
- I ran Python only, on temp folders. I ran no Go and no TSX tests (not approved).
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 | f2c5e16dfc33 |
approve |
Verdict: approve
Findings
None. All round-1 findings from both reviewers are fixed. The fixes add no new defect that I can show.
Status of the round-1 findings
- R2 #1 / R1 #1 (uninstall leaves
statusline_asked): fixed.cmd_removepops it now (settings.py:3463).TestSettingsStatuslineRoundTripschecks that$context-guruis gone. It also checks that a file context-guru created is deleted (file_deleted=true). - R2 #2 / R1 #2 (the migration removes lines the user asked for before 0.6.1): fixed.
retire_statuslinenow removes onlypython3 "<…>/scripts/statusline.py", with no flags andrefreshInterval1 or absent. It keeps any other line and marks it as asked. I checked the old releases: v0.4.0 and v0.4.2 wrote norefreshInterval, and v0.5.0 to v0.6.0 wrote 1 (git show vX:…/settings.py). The value 5 was only in commit 11f465d, between two tags, so no release wrote it. All default installs therefore match the rule, and a line with flags stays. The retire branch now callsbackup()beforesave(). New tests:TestSessionStartKeepsACustomisedPre061StatusLineandTestRetiringTheDefaultStatusLineTakesABackup. - R2 #3 / R1 #3 (
proxy offlinefor a proxy that answers): fixed.cachestate_cachednow usesApi.send. A refused connection givesURLError→ 0 →down. A timeout gives -1 →timeout. An HTTP error or a body that is not a JSON object givesempty. Onlydownsets the notice. The back-off path keeps the recordedkind. An old record withkind: "error"gives no notice, and that is the safe side.TestCGCachestateSaysOfflineOnlyWhenNothingAnswerscovers 404, 500 and a dead port. - R2 #4 (data dependence): fixed. The PR body has a Data dependence section: "No change", metadata only. I agree with it.
- R1 #4 (no test for the
cg.py cachestateextras): fixed.TestCGCachestateCarriesTheStatusLinesExtraschecksupdate,manual_pingsandwindow_savedwith--window-start-ms. Go'sexeckeeps the last duplicate env key, so the test'sCONTEXT_GURU_STATEreplaces the one inrunCGCode. - R1 #5 (commit rules): fixed. f2c5e16 has
Signed-off-by: Osher ElhadadandAssisted-By:, and noCo-Authored-By. - My round-1 non-blocking points:
SKILL.mdfixed.critical && truefixed. Thecmd_addre-ask now recordsstatusline_asked. The tick now stops while the band is hidden. The author did not change thestart-proxy.shpython3 start when the record is stale. The reason is that it is rare and costs one python3 start. I accept this.
Non-blocking
cmd_statusline_repoint(settings.py:3106-3108): when a customised pre-0.6.1 line is marked as asked, the loop runscontinue. Sorepoint_statuslinedoes not run in that session. The line moves to the new plugin version at the next SessionStart, when the grep's*plugins/cache*branch runs. One session runs the old script. This is harmless, but you can callrepoint_statusline(data, running)before thatsave.status_extrascalls statusline.py helpers. Their_http_getstops at_T0 + 0.36 s, counted from theimport. On a loaded machine the first_bg_jsonread forwindow_savedcan time out. That starts the detached refresher and leaves the field out for one poll. In the real band the next poll fills it in. InTestCGCachestateCarriesTheStatusLinesExtrasthe field is asserted on the first call, so the test can fail now and then under full-suite load.
What I checked
- Last review: round 1, fe2c9cb, 2026-10-26T17:19:45Z
- New commits read: 1. The author squashed the branch into one commit, f2c5e16 "feat(plugin): the mod draws the status line, dashboard link on the band".
git log fe2c9cb6..HEADlists only f2c5e16, and the merge base is ad87e36. So I readgit diff fe2c9cb6 f2c5e16d(9 files, +220/−25) in full as the new work. I also read the new commit message. - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
- New items since my last review:
- Reviewer 1's round-1 review (17:25:56Z). I checked each of its findings above, against the new code.
- The author's reply comment (17:31:41Z). I checked each claim against the diff. For the
refreshIntervalrule, I also checked the git history of the release tags.
- Changed files read around each change:
settings.py(retire_statusline,is_ours_statusline,_statusline_value,cmd_add's statusline-only path,cmd_statusline_repoint,cmd_remove,backup),cg.py(Api.send,cachestate_cached,cmd_cachestate; the Codex copy is the same),cgcache.py(backoff,record_failure),register.tsxticked,model.tscacheClock,skills/statusline/SKILL.md, and the new and changed Go tests (cg_cachestate_test.go,plugin_test.go,statusline_repoint_test.go, and therunCGCodehelper). start-proxy.sh:save()writesjson.dump(indent=2), so the result has"statusline_asked": true. The shell grep'"statusline_asked": *true'matches it.- The PR body: the Data dependence section and the updated test plan.
- I did not run tests (not approved). Go is not installed.
The dashboard link is back on band row 1, last: `dashboard ↗`, or `dash ↗` below 80 columns. 0.6.0 left it in the pane only. The band now carries what the status line drew, with the same rules: `▲ update`, `saved $x of $y session · saved $z of $q subagents ↻ $p pings` (on a subscription `5h 34% · saved … rd / … wr`), the cache clock that counts each second (dim `cache ○ cold m:ss` once cold) and `ctx`. Its last row rotates through /context-guru:insights, /context-guru:save-more and /context-guru:remove-mcp-and-skills with a few words each, unless the weekly tip applies. A saving never reads below $0.00. With nothing read and no proxy answering, the band says `cg ✕ proxy offline`; a proxy that answers with an error is not offline. install.sh writes the statusLine only with --statusline. At SessionStart, statusline-repoint retires the exact default line an earlier install wrote (ours by record, no flags, refreshInterval 1), after a backup, and restores what it replaced. A line with flags or a tuned interval, or one asked for by name, stays and is marked as asked. Uninstall removes the new record too. doctor checks the line only when it is installed. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Osher Elhadad <[email protected]>
|
Replies to round 2. Both changes are in the head commit. R1 #1 / R2 (first round-2 review) #1: R1 non-blocking: a kept pre-0.6.1 line was not repointed in the same run. Fixed. The kept branch now calls R1 non-blocking: a bare line made with The repoint, SessionStart and docs-golden tests pass on the new head. |
f2c5e16 to
bd7005d
Compare
…med by description (#739) * fix(plugin): three band and migration points from the #735 GLM review - `add --url … --statusline …` on a complete install now records `statusline_asked`, as the statusline-only path does. Before, a line installed before 0.6.1 and asked for again this way was still retired at the next SessionStart. - When the retire gives back the status line the install had replaced, it says so ("your own status line is back"), not "moved into the band". - With nothing ever read and the proxy too slow, the band says the status line's `cg: stats loading…`. It showed nothing before. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Osher Elhadad <[email protected]> * fix(plugin): name a general-purpose sub-agent by its description A sub-agent launched with no type of its own is `general-purpose`, and several often run at once, so the band showed a row of identical `general-purpose` chips. They are real sub-agents, not auto-mode (the classifier is a `p:` thread and was never shown). Such an agent is now named by its description, as Claude Code's agents list names it. A typed agent keeps its type and a teammate its name. A band chip name is cut to 24 characters with `…`. Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Osher Elhadad <[email protected]> --------- Signed-off-by: Osher Elhadad <[email protected]> Co-authored-by: Osher Elhadad <[email protected]>
…0.2.6) (#740) chore(plugin): bump the plugins for v0.6.1 (Claude Code 0.6.1, Codex 0.2.6) Both plugins changed since v0.6.0. - Claude Code plugin: 0.6.0 to 0.6.1. The mod band draws the status line's figures and a dashboard link, and the install writes no status line by default (#735, #739). - Codex plugin: 0.2.5 to 0.2.6. The vendored cg.py changed in #735 and #739 (the cachestate extras and the offline notice). Assisted-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Summary
dashboard ↗, ordash ↗below 80 columns. A terminal without OSC 8 prints the address after the label; the link is last in its own box, so then it wraps alone and row 1 stays whole._save_segment,_cache_segment,_ctx_numbers, the width order):▲ updateleads the row; on a Claude subscription5h 34% · saved 1.2M rd / 85.0k wrreplaces the money.cache ○ cold 1:07:04.⏳marks a copy older than a minute.ctxuses the engine's own figures ($.session.usage(),session.measure), and the proxy's while its copy is fresh.cg ✕ proxy offline.install.shwrites one only with--statusline. At SessionStart,statusline-repointretires only the exact default line that an earlier install wrote (ours by record, no flags,refreshInterval1, nostatusline_asked). It takes a backup first and restores what the line replaced. A line with flags or a tuned interval, or one asked for by name, stays, is marked as asked, and is still repointed. Uninstall removes the new record.doctorchecks the line only when it is installed.cg.py cachestatenow also returnsupdate,manual_pingsand the subscription window'swindow_saved, through the status line's own cache files and TTLs.Data dependence
No change. Every new band figure is metadata the plugin already read: dollar totals, counts, timestamps and token counts from
/api/cachestateand/api/stats?lean=1, the engine's context and rate-limit figures, and the localupdate-check.yaml. The band reads no request or response content, and it behaves the same at every storage level.Test plan
claude plugin test context-guru-plugin: 79 pass, 0 fail. New tests cover: the status row, the narrow form, the floor at $0, the per-second clock, the cold count-up,↻ pings,▲ update, the subscription view, the offline notice, the rotating row, a sub-agent not lending main its plan or prices, and the redraw check seeing a moved clock. The last two each fail without their fix.TestRouteInstallsStatuslineByDefault(default off,--statuslineon),TestSessionStartRetiresTheDefaultStatusLine,…KeepsAStatusLineTheUserAskedFor,…NeverRetiresAForeignStatusLine,…KeepsACustomisedPre061StatusLine,TestRetiringTheDefaultStatusLineTakesABackup,TestSettingsStatuslineRoundTrips(no record left, a created file deleted),TestCGCachestateCarriesTheStatusLinesExtras,TestCGCachestateSaysOfflineOnlyWhenNothingAnswers.go test ./.... Four save-more golden tests (TestCGGoldens/save-more,TestSaveMoreWidthASCIIAndColour,TestCostlySettingsGoldens,TestSaveMoreDefaultIncludesTheSettingsCard) fail onmainat ad87e36 too; this PR does not touch save-more.TestFeedbackMailCannotInjectHeadersfailed once under full-suite load and passes 5/5 alone;proxy/is not touched.↻ $0.03 pings).🤖 Generated with Claude Code