Repository navigation
feat(mod): hide the Ping button while an automatic ping fires before the cache expires - #773
Merged
Merged
Conversation
…the cache expires (#771) The cachestate answer now carries next_ping_ms (metadata only). The band and the pane use one rule, showPing: hide the button when pings_left > 0 and the next ping fires before the cache expires. The band shows "next ping m:ss" in its place. An old proxy that sends no next_ping_ms keeps the old rule. Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
…ead (#771) - Remove the /ping slash command and its mentions. The Ping button and cg.py ping stay. - A thread the keeper stopped (a miss, a refused ping, a route failure) keeps its copy until the hold ends. A press now works on it, and the server reports it pingable. After the keeper lets go, the reason is still "stopped". Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
commented
Oct 29, 2026
amiddavid
left a comment
Collaborator
Author
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.312 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | 524b7da6f360 |
approve |
Verdict: approve
Findings
None.
Non-blocking
context-guru-plugin/hooks/register.tsx:519— the pane's↻ next ping m:ssdoes not tick. The pane render never readstick, so only the band redraws once a second (register.tsx:316). The pane refreshes its countdown only when the snapshot orpaneDatachanges, about once a minute. The band is right; the pane can lag up to ~60 s. The pane already shows coarse times ("about 4m left"), so this is a small mismatch, not wrong data.keepalive/manual.go:88— a press on a thread stopped for a tripped route or a dead credential now sends. The sweep stops a thread when the route breaker trips or the credential is marked dead (keeper.go:1198-1201).PingNowdoes not re-check either, so a press sends one request on a failing route. It is bounded: one request, the 30-second gap, the cost ceiling, and the user sees the failure toast. The PR names this behavior ("the refusal may not repeat"), so I read it as accepted.context-guru-plugin/hooks/register.test.tsx:174— no plan test case setsheld_until_ms. A real document always carriesheld_until_mstogether withpings_left. The rule's key choice — comparenext_ping_msagainst the entry's own expiry (remS), not the plan horizon — is only pinned without the horizon present. One extra case with both fields would lock it in.
What I checked
- Read the full diff of both commits and the code around every change:
model.ts,register.tsx,register.test.tsx,dash/cachestate.go,keepalive/manual.go,keepalive/manualhold.go, and their tests. - Traced the hiding rule end to end.
Plans(keeper.go:1886) excludes stopped entries and manual-only holds, so a stopped or manual-hold thread sends nonext_ping_msand the button shows.nextPingIncompares the next ping against the entry's own expiry, which is the right bound: a ping that fires after it misses, and a press would miss the same way. - Checked fail-open on old data: an old proxy sends no
next_ping_ms,nextPingInreturns undefined, and the old rule (button shows) applies.next_ping_ms: 0andpings_left: 0also fail open to the button. - Checked the redraw chain: the
anchornow includespings_leftandnext_ping_ms, so a plan change replaces the stored clock;signatureincludes the hint's presence;tickedredraws the band once a second whenevernextPingSis defined (a definednextPingSimplies a definedcacheClock, so the tick fires). - Traced the stopped-thread change.
PingStatesreports a held stopped entry as pingable; after the sweep or the hard timer releases it, the reason map answersstoppedand the button hides. A press that reads movesstartedAt, which delays only the sweep's eager release; the one-shot hard timer(K+1) x Idle(keeper.go:920) still bounds how long the body and credential are held. A press cannot revive the schedule (duerequires!e.stopped). - Checked the
/pingremoval: no leftover references in the mod, the install text,settings.py, or the skills.cg.py pingstays and serves the button. - Checked the docs and process rules:
docs/dashboard.mdanddocs/data-dependence.mdmatch the new behavior; the PR names the three behavior changes at the top with the owner's decision and the data-dependence statement. - Did not run tests (not approved). The PR's test table covers the mod,
dash, andkeepaliveruns on the box, plus mutation checks on the new conditions.
amiddavid
commented
Oct 29, 2026
amiddavid
left a comment
Collaborator
Author
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.312 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | 524b7da6f360 |
approve |
Verdict: approve
Findings
None blocking. I traced every changed line and could not prove a wrong behavior. See Non-blocking for the edges I did find.
Non-blocking
- keepalive/manual.go:80 — a press does not re-check the route breaker or the dead-credential mark. The scheduled path checks both again right before it sends (
keepalive/keeper.go:1205-1208), because they can trip while an entry sits idle. The press path (PingNow) now runs on a stopped entry, and "stopped" is often exactly a tripped route or a dead credential. So a press can send one ping into a route the keeper itself marked failing. The press fails cleanly (UpstreamError, no breaker effect, no stop), and the 30-second gap plus the per-ping ceiling bound the cost. Worth a guard in a later PR, not a merge blocker. - proxy/manualping.go:132 — a 409 "not held" carries no
ping_reason, so a press that races the release of a stopped thread's copy can toast a wrong reason. The keeper releases a stopped entry atstartedAt + Idle(240 s), while the cache stays warm torefresh + ttl(300 s). In that tail the button can still show from a poll up to 15 s old. A press then gets 409 "not held";cg.py pingreads the reason from the shared cachestate cache, which serves a copy up to 10 s old (CACHESTATE_TTL_SECONDS), still sayspingable: true, so the toast falls back to "keep-alive is off for this account" — false. The same race existed before this PR for "pings used" threads, so I do not count it as new. The next poll corrects the button. - context-guru-plugin/hooks/model.ts:128 — after a planned ping's moment passes, the band shows
↻ next ping 0:00with the button hidden until the next poll (up to 15 s) brings the new plan. The PR names this as a known limit. Cosmetic. - context-guru-plugin/hooks/register.tsx:349 — the 60-column row fit is tested with a ~100 s hint (
↻ ping 1:40). A 1-hour-tier plan can show↻ ping 59:59, one character wider. Row 1 can then wrap at exactly 60 columns.flexWraphandles the wrap, so nothing breaks.
What I checked
- Read the full diff of both commits (16 files) and the code around each hunk:
model.ts,register.tsx,register.test.tsx,dash/cachestate.go,keepalive/manual.go,keepalive/manualhold.go, and their tests. - Traced
next_ping_msend to end:Keeper.Plans→proxy/keepalive.go(KeepAlivePlans) →dash.KeepAlivePlan→CacheState/ThreadCache→cg.py cachestate→ the mod. Both dash loops (threads and session level) read the same plan key (""= main thread), so the two fields cannot disagree. - Checked the mod's rule
nextPingInagainst all six plan cases in the new tests, including the old-proxy andnext_ping_ms: 0fail-open cases. Units are right:atandnowin ms,remin seconds. - Checked the per-second redraw:
tickedbumps the tick whilecacheClockis defined, and a definednextPingSimplies a definedcacheClock, so the↻ next ping m:sscountdown counts. Thesignatureandanchorchanges force a snapshot update when the plan appears, changes or disappears. - Checked
mainEntry:pings_leftandnext_ping_mscome from the main thread or the session entry, which the dash fills from the same plan, so the merge cannot keep a stale plan. - Verified that keep-alive pings that read the cache move the thread's
last_tsin the dash DB (withKeepAliveincludes ping rows incacheThreadsQuery), so the mod'sremSadvances with the plan. Without this, the button would show while a ping is planned. - Checked the stopped-thread change:
Plansexcludes stopped entries, so a stopped thread sends nonext_ping_msand the button shows;PingStatesmarks a live stopped entryPingable; after the sweep releases it,k.reasonsgivesstoppedand the button hides. The hard deadline(MaxPings+1) × Idle, set at record time and not moved by a press, bounds how long presses can keep a stopped entry's body and credential held. - Checked that the removed
/pingslash command leaves nothing behind: no doc, skill, or code reference remains; thecg.py pinghelper subcommand stays (both buttons call it) and thecommand.runhandler for it is gone with its registration. - Checked the behavior-change rules in CLAUDE.md: the PR names all three behavior changes at the top, says who they affect, old and new behavior, and cites the owner's decision of 2026-10-29 with the owner's own words.
docs/data-dependence.mdgains the one-sentence metadata note fornext_ping_ms; nothing new is stored. - Did not run Go builds or tests (not approved for this review). The PR reports
go test -raceon./dash/...,./keepalive/...and./context-guru-pluginon the box, plus mod tests, all passing.
…59:59 hint width (#771) Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
One conflict, in docs/data-dependence.md: #770 added the session state row next to the Keep-alive row. Both changes stay. Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Collaborator
Author
|
Merged
|
…credential first (#771) The scheduled ping checks the route breaker and the dead-credential mark right before it sends. A press on a stopped thread now runs the same two checks. If either holds, the press is refused and the thread is reported not pingable, reason "unavailable", so the button stays hidden. When the mark clears, the thread is pingable again while its copy is held. A thread stopped by a miss or a refused ping is not blocked. Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
…show "pinging" at 0:00 (#771) - The pane reads the band's tick, so its "next ping m:ss" counts each second. - A 409 "not held" now carries ping_reason (the keeper's own, read at the press). cg.py ping prefers it over the cache-state copy, which can be 15 s old. - When the planned ping time has passed and no new plan came, the hint reads "pinging…" instead of 0:00. The button stays hidden. Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
amiddavid
commented
Oct 29, 2026
amiddavid
left a comment
Collaborator
Author
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.312 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 32ae313fa860 |
approve |
Verdict: approve
Findings
None blocking. Every fix commit is correct, and I could not prove a wrong behavior in the new code. One new non-blocking note below.
Earlier findings
Mine (round 1):
- A press does not re-check the route breaker or the dead-credential mark — fixed by 0bfa968.
stoppedAndBlockedLocked(keepalive/manualhold.go:170) runs the same two checks the sweep runs, in bothPingStatesandPingNow, underk.mu. A blocked thread answersunavailable, so the button hides and the toast says why. I checked the empty-credential case:credIsDeadLockedreturns false for""(keepalive/breaker.go:92), so a server-held key is never blocked. A miss- or refusal-stopped thread stays pressable, pinned by the new test. - A 409 "not held" with no
ping_reasoncan toast a wrong reason — fixed by aa0f82f. The proxy now reads the keeper's own reason at the press (proxy/manualping.go:138-140), andcg.py pingprefers the 409 body's reason over the cachestate copy, which can be 10 s old. The newTestPingPrefersTheReasonInThe409pins the preference with a fake server that disagrees with the cache. ↻ next ping 0:00after the planned time passes — fixed by aa0f82f.nextPingWordsreturns↻ pinging…whennextPingS < 1, and the button stays hidden. The narrow and wide band and the pane are all pinned by the new test.- The 60-column fit was untested for the 59:5x hint — fixed by 3bcb805. The new case uses the 1-hour tier (
ttl_s: 3600, ping at +3,599 s) and asserts the row still fits 56 columns with↻ ping 59:5x.
Reviewer 2 (round 1), checked myself:
- The pane's hint does not tick — fixed by aa0f82f (
register.tsx:472, the pane render readstick), pinned by 41b8a6c's test that keeps the pane mounted across one tick. See my new non-blocking note for the one case it does not cover. - Press on a tripped-route or dead-credential thread — fixed, same commit as my finding 1.
- No plan test case with
held_until_msset — fixed by 3bcb805. The new case (held_until_ms: NOW + 3_600_000, ping after the entry's own expiry) pins that the rule usesremS, not the plan horizon.
The author rejected nothing.
Non-blocking
- context-guru-plugin/hooks/register.tsx:139 — the pane's
↻ next ping m:ssfreezes while the band is hidden.tickedreturns early whenisHiddenis set, so thetickatom stops bumping, and the pane (which now readstick) re-renders only when the snapshot signature changes — at best once a minute, when the coarseleftword moves. The user must hide the band and keep the pane open to see it. The button state itself stays correct: it follows the poll, not the tick. Cosmetic. - keepalive/manualhold.go:170 —
stoppedAndBlockedLockedguards only stopped entries. A live, not-yet-stopped entry on a route that just tripped stays pressable until the next sweep marks it stopped. That window is one sweep, the failure is clean, and the state before this PR was the same for every entry. Residual of the fix, not a regression.
What I checked
- Last review: round 1, 524b7da, 2026-10-29T14:26:16Z.
- New commits read: 6 — 3bcb805 (test: held_until case, 59:5x width), bf8a9c3 (merge of origin/main), 0bfa968 (press checks route and credential), aa0f82f (pane tick, 409 reason, "pinging…"), 41b8a6c (test tweaks), 32ae313 (codex cg.py copy). 8cc5b84 is main's own #770, which the merge brought in; I did not re-review it here.
- Read in full: 2 reviews, 1 comment, 0 inline comments (from
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt). - New items since my last review, and what I did about them:
- Reviewer 2's round-1 review (posted before mine, unread in round 1 by rule): read it, checked each of its three non-blocking notes myself, confirmed all three are fixed.
- The author's merge comment: verified its claims.
git diffof the merge against each parent shows the merge kept both sides whole; the only hand-resolved file isdocs/data-dependence.md, where the #770 row and this PR'snext_ping_mssentence both stay. Nothing else changed in the merge. - The six commits above: read every changed line and the code around it.
- Checked
stoppedAndBlockedLockedfor lock discipline (called underk.muin both callers, plain map reads inside) and for the empty-credential and manual-only cases (both can never be blocked). - Checked the 409 reason end to end:
PingStates(...).For(thread)uses the same tenant and scoped session as thePingNowkey; a nil keeper or an empty reason degrades to the old body withoutping_reason, andcg.pythen falls back to the cachestate copy.PingStateMap.Foris nil-map safe. - Checked the pane tick fix: the pane render reads
tick, so it re-renders on the band's once-a-second bump; the test keeps the pane mounted across one tick and sees the hint change. Found the hidden-band gap noted above. - Checked the new tests for what they pin: the plan case with
held_until_ms(mutation target: usinguntilColdSinstead ofremS), the 59:5x row width at 60 columns, the "pinging…" text in band and pane, the unavailable round trip (hide, then show again after the mark clears, through a mutated poll document), and the 409-reason preference in both the Go helper test and the proxy test. - Checked the codex copy:
codex-marketplace/plugins/context-guru/scripts/cg.pyis byte-identical tocontext-guru-plugin/scripts/cg.pyafter 32ae313. - Did not run Go builds or tests (not approved). The author reports mod tests 93 pass and
go test -raceon./keepalive/...and./context-guru-pluginok on the box after each fix.
amiddavid
commented
Oct 29, 2026
amiddavid
left a comment
Collaborator
Author
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.312 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 32ae313fa860 |
approve |
Verdict: approve
Findings
None.
Earlier findings, all fixed
- Mine, pane does not tick (
register.tsxpane render): fixed in aa0f82f. The pane now readstick(register.tsx:472), and 41b8a6c strengthens the test to one mount that redraws on the tick, not a re-mount. - Mine and reviewer 1's, a press on a thread stopped for a tripped route or a dead credential sends: fixed in 0bfa968.
stoppedAndBlockedLocked(keepalive/manualhold.go:170) runs the same two checks the sweep runs, in bothPingNow(refuses withErrNotHeld) andPingStates(reasonunavailable, so the button hides and the band saysping off: upstream failing). A miss-stopped or refused-ping-stopped thread stays pingable. Both call sites holdk.mu, which the breaker helpers require. Tests cover route, credential, both cleared, and miss-stopped. - Mine, no plan test case with
held_until_ms: fixed in 3bcb805. The new case pins the choice to the entry's own expiry, not the plan horizon. - Reviewer 1's, a 409 "not held" carries no
ping_reasonso the toast can lie: fixed in aa0f82f. I checked it myself.proxy/manualping.go:140reads the keeper's own reason at the press, with the same tenant, session and thread the press used.cg.py pingprefers it over the cache-state copy, and the copy in the Codex plugin is synced (byte-identical;TestCGScriptsAreVendoredIntoCodexenforces it). The fallback chain stays sound: the server's own reason, then the cached copy, then none. - Reviewer 1's,
0:00after the planned time passes: fixed in aa0f82f.nextPingWordsreturns↻ pinging…below one second, and the button stays hidden. Tested in band and pane. - Reviewer 1's, the 60-column row was not tested at
59:59: fixed in 3bcb805. The test pins the 1-hour-tier hint width at 60 columns. - No earlier finding was rejected by the author.
Non-blocking
context-guru-plugin/hooks/register.tsx:140— with the band hidden, the pane's↻ next pingstill does not tick.tickedreturns early whenisHiddenis set, so no tick reaches the pane. The pane then refreshes its countdown only from snapshot orpaneDatachanges, about once a minute. Edge case: the band is hidden while the pane is open. The value shown is correct at render time and self-corrects.context-guru-plugin/hooks/model.ts:145—↻ pinging…can appear up to one second early. The branch iss < 1, so a hint at 0.6 s readspinging…before the planned moment. Cosmetic.
What I checked
- Last review: round 1, 524b7da, 2026-10-29T14:25:03Z.
- New commits read: 6 — 3bcb805 (test: held_until_ms case, 59:59 width), bf8a9c3 (merge of origin/main), 0bfa968 (route and credential guard on a stopped-thread press), aa0f82f (pane tick, 409 ping_reason,
pinging…), 41b8a6c (test: same-mount pane tick, 409 test alignment), 32ae313 (sync cg.py to the Codex plugin). - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files).
- New items since my last review: the author's merge comment (14:36) — verified the merge resolution:
git show bf8a9c3e --statlists only #770's files plus thedocs/data-dependence.mdconflict, and both rows (Session state table, Keep-alive pings) are present and correct in the merged file. The updated PR body — verified it names behavior changes 4 and 5 at the top with the owner's decision, and reportsgo test -raceon./keepalive/...,./proxy/...,./context-guru-plugin,./dash/...plus 96 mod tests and mutation checks. - Traced the route/credential guard:
stoppedAndBlockedLockedrequirese.stopped, so a live entry with a tripped route is untouched (the sweep stops it, then the guard applies). Manual-only entries are never stopped, so the manual hold is unaffected. - Traced the 409 reason end to end:
PingNow's threeErrNotHeldcauses each have a matching reason inPingStatesat the same moment —manualExpiredgivesexpired, stopped-and-blocked givesunavailable, a released entry gives its recorded reason, and an unknown thread givesno entry.For()never returns an empty reason, so thest.Reason != ""gate always passes and the client always gets a reason. - Checked
cg.py's new precedence: the server's ownping_reasonfirst, the cached copy only when the server sent none, and the fixture path unchanged. The JSON merge order keeps the resolved reason on top of the raw document. - Checked the
pinging…rule against the hiding rule:showPingstill requiresnextPingS === undefined, so the button stays hidden while the hint showspinging…. - Did not run tests (not approved). The PR body's test table covers the new code on the box, with mutation checks on each new condition.
amiddavid
added a commit
that referenced
this pull request
Oct 29, 2026
Main moved ahead through #773 (the mod's Ping-button change), which conflicted with this branch in one place: docs/data-dependence.md, where #773 grew the keep-alive row next to the row this branch edits. The resolution keeps both: main's keep-alive row (the sentence about the cache-state answer carrying the next planned ping) and this branch's session-state row (an eviction or an archive can end a row before its 30 days). Nothing else was changed; every other file merged cleanly. No behavior change: the merge only combines docs text and already-merged main code. Written by GLM (rits/zai-org/glm-5-3) through Claude Code Assisted-By: GLM Signed-off-by: DAVID AMID <[email protected]>
amiddavid
added a commit
that referenced
this pull request
Oct 29, 2026
fix(dash): session-state follow-ups from #770 Five follow-ups from the session-state change (#770), none blocking: 1. The janitor's "could not archive, so delete" branch now has a test (TestEvictFallbackDeletesSessionAndAliasState), mutation-checked. 2. Deleting or archiving a session now removes the state rows under its content-derived alias too (cg:seen:, cg:ttl: are keyed by the alias), so they no longer outlive the session until the 30-day retention. An alias another live session still uses — by its session_alias column or by a headerless session whose own id IS the alias — is kept. 3. DropOldestSessions picks its victims once and removes exactly that set. The delete used to re-run the ordering subquery itself, so a request landing between the pick and the delete could change the order, and the state cleanup then acted on a set other than the one deleted. 4. DeleteSessionState checks rows.Err(): a scan that fails midway now returns the error instead of silently deleting less. 5. docs/data-dependence.md: extract_llm_sweep removed from "Rows to confirm"; both confirmations are recorded on #770. Data dependence: no change (this deletes more, it stores nothing new). Behavior change: none that a user sees, apart from fewer leftover rows. Written by GLM (rits/zai-org/glm-5-3) through Claude Code Assisted-By: GLM Signed-off-by: DAVID AMID <[email protected]> fix(dash): state cleanup on every session-delete path (#775 review) Both round-1 reviews on #775 were blocking; this answers them. 1. A victim's own id gets the same in-use guard as its aliases. A headerless session (its session_id IS an alias) evicted while the header session sharing that alias is live used to lose cg:seen: and cg:ttl: that the live session still reads. Now both halves are checked before any state key goes: rows carrying it as session_alias, or a live session whose own id IS it. 2. DropOldestSessionsOfTenant deletes state with the rows, through the same guard. The tenant row-quota trim was the one session-delete path that left state behind. 3. The in-use check is no longer one full-table scan per alias on the writer goroutine. idx_requests_session_alias is added on open (old databases get it too, like idx_requests_project), and one pass answers all its in-use checks with TWO queries over the whole key list, not one query per key. 4. Every IN (...) list is bound in batches of 500 ids: the disk rule can ask for a tenth of all sessions at once, past SQLite's 32,766-variable statement limit. 5. A failed victim pick or alias read now returns its error instead of reading as "nothing left to evict", and stateRowsFor-style checks match exact keys. docs/data-dependence.md says an eviction or an archive can end a state row before its 30 days. Data dependence: no change (this deletes more, it stores nothing new). Behavior change: none that a user sees, apart from fewer leftover rows. Written by GLM (rits/zai-org/glm-5-3) through Claude Code Assisted-By: GLM Signed-off-by: DAVID AMID <[email protected]> merge: origin/main into chore/session-state-followups Main moved ahead through #773 (the mod's Ping-button change), which conflicted with this branch in one place: docs/data-dependence.md, where #773 grew the keep-alive row next to the row this branch edits. The resolution keeps both: main's keep-alive row (the sentence about the cache-state answer carrying the next planned ping) and this branch's session-state row (an eviction or an archive can end a row before its 30 days). Nothing else was changed; every other file merged cleanly. No behavior change: the merge only combines docs text and already-merged main code. Written by GLM (rits/zai-org/glm-5-3) through Claude Code Assisted-By: GLM Signed-off-by: DAVID AMID <[email protected]> fix(dash): an unreadable in-use answer keeps all state (#775 round 2) Both round-2 reviews blocked on one finding: inUseIDs closed its rows without checking rows.Err(), and skipped a failed Scan silently. A scan that fails midway ends the loop early, so the keys it did not reach read as unused, and deleteSessionState then deleted state a live session still reads — the unsafe direction, and the one the function's own contract forbids. Both failure modes now take the same path as a query that fails to open: log once, mark every key in use, return. Two fake-driver tests cover them; each fails at 434b232 and catches its own mutation. Also: DropOldestSessions' comment no longer says "one statement, so one transaction" — the delete is chunked, and a failed chunk returns before the state cleanup, so earlier chunks' victims keep their state until retention (the safe direction). Left as is, said on the PR: the age-rule archiver runs on its own goroutine, so its delete can interleave with the janitor's in-use count. That window is old, self-healing within one turn, and state cleanup is best-effort by contract. Data dependence: no change (this deletes less on a failure, it stores nothing new). Behavior change: none that a user sees. Written by GLM (rits/zai-org/glm-5-3) through Claude Code Assisted-By: GLM Signed-off-by: DAVID AMID <[email protected]>
amiddavid
added a commit
that referenced
this pull request
Oct 30, 2026
…0.2.8) (#780) chore(plugin): bump the plugins for v0.6.4 (Claude Code 0.6.4, Codex 0.2.8) Both plugins changed since v0.6.3. - Claude Code plugin: 0.6.3 to 0.6.4. The Ping button hides while an automatic ping fires before the cache expires, and the /ping command is removed (#773). - Codex plugin: 0.2.7 to 0.2.8. Its vendored cg.py changed in #773 (the 409 reason for a refused ping). Assisted-By: Claude Opus 5.5 (1M context) Signed-off-by: DAVID AMID <[email protected]>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behavior change
noneand users whose thread the proxy stopped.↻ next ping m:ssin its place. Old: it showed whenever the cache was warm./pingslash command is removed. The Ping button andcg.py pingstay. Old:/context-guru:pingpressed the same ping from the prompt.stopped), the button shows while the cache is warm and the proxy still holds the request copy. Old: it was hidden.ping off: upstream failing. When the mark clears, the button shows again.↻ pinging…instead of0:00. The button stays hidden.Data dependence
next_ping_ms(a time). Nothing new is stored.docs/data-dependence.md: one sentence added to the Keep-alive row.Summary
The Ping button now shows only when no automatic ping keeps the cache warm.
What changed
dash/cachestate.go:next_ping_mson the session and on each thread with a plan (omitempty, additive).context-guru-plugin/hooks/model.ts: one rule,showPing, and one text helper,nextPingWords. Hide whenpings_left > 0 && next_ping_ms > 0 && next_ping_ms < cache expiry. The expiry is the one the cache clock uses (remS).register.tsx: the band and the pane both call these 2 helpers, so they cannot disagree.next_ping_ms: the old rule applies (fail open).pingable: falseis unchanged: theping offtext wins.cg.py ping: no change. They show no Ping hint./pingremoved fromregister.tsx,install.sh,settings.pyand comments.docs/dashboard.md,docs/data-dependence.md.Decided by the owner (2026-10-29)
/pingcommand. "no. and remove that command. too many commands to maintain is a nightmare." Removed from the mod, the install text and the comments.cg.py pingstays (both buttons call it).stoppedshows the button when the cache is about to expire. "the fact it was refused might not mean it will be refused again". A held copy is still required.stopped), andPingNowrefused it.stoppedand the button stays hidden.PingStatesreports reasonunavailable(the existing reason; the mod already words it asping off: upstream failing). A miss-stopped or refused-ping-stopped thread still shows the button. Change:keepalive/manualhold.go(PingStates) andkeepalive/manual.go(PingNow).Small points fixed with it (owner, 2026-10-29)
↻ next ping m:ssnow counts each second, like the band.ping_reason(the keeper's own, read at the press).cg.py pingprefers it over the cache-state copy, which can be 15 s old. The Codex copy ofcg.pyis updated.How it was tested
claude plugin teston the mod, before the changeclaude plugin teston the mod, after<to>in the expiry checkpings_left > 0checknextPingScheck inshowPingnext_ping_ms > 0checkgo test -race ./dash/...(box)go test -race ./context-guru-plugin ./keepalive/...(box)go veton those packages,gofmt -lNextPingMSassignmentTestCacheStateShowsTheKeepAlivePlanfailsclaude plugin testafter commit 2context-guruis registered; stopped with a copy shows the button; stopped after release does not)go test -race ./keepalive/...,./context-guru-pluginafter commit 2 (box)e.stoppedinPingNow, or thestoppedcase inPingStatesgo test -race ./keepalive/... ./context-guru-plugin ./dash/...after commit 4 (box)claude plugin testafter commit 4claude plugin testafter the small pointsgo test -race ./keepalive/... ./proxy/... ./context-guru-plugin ./dash/...(box)pinging…branch; removeping_reasonfrom the 409; makecg.pyignore itTest cases: ping before expiry (hidden), none left, keep-alive off, next ping after expiry,
next_ping_ms: 0, old proxy (all shown). Band and pane are checked together in each. Band row 1 fits 60 columns with the hint.Known limits
Fixes #771
🤖 Generated with Claude Code