Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesRelease retired sessions’ prompt-cache diagnostic baselines through existing session cleanup paths. Example: Reset a session holding two cache-affinity baselines measured at 8,000 cached tokens.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a source-confirmed diagnostic retention bug with a focused change; no introduced correctness or security defects were found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe embedded runner retains request fingerprints and cache telemetry for cross-turn diagnostics; session retirement now releases those process-local observations. flowchart TD
A[Model requests] --> B[Prompt diagnostic owner]
B --> C[Session affinity baselines]
D[Session reset or deletion] --> E[Existing cleanup paths]
F[Gateway shutdown] --> E
E --> B
Technical reviewBest possible solution: Keep this focused owner-held cleanup and complete its declared Gateway retention acceptance comparison. Do we have a high-confidence way to reproduce the issue? Current-main source confirms retained tracker entries survive retirement until count-based eviction; the author also reports a Gateway reproduction, which this read-only review did not rerun. Is this the best way to solve the issue? The patch restores the missing lifecycle invariant at the existing diagnostics owner and connects both retirement paths without unnecessary architecture. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18d7b2bf9be2. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +18, Tests +51, Docs 0. Total +69 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 3:21 PM ET / 19:21 UTC. |
Release every cache-affinity baseline when its session resets, is deleted, or shuts down; automatic reply-session rotation uses the same owner. Preserve cross-turn diagnostics for active sessions.
3430586 to
733da4b
Compare
|
Merged as All functional jobs passed. The two static-analysis failures in The final paired Gateway results are now in the body: five legitimate trackers, zero retired child generations or completed Workshop review trackers, and 91%/96% fewer sampled prompt-diagnostic survivors. Total heap growth was neutral; no RSS improvement or one-hour flatness claim is made. The older review's pending measurement note is superseded by these results, including the legitimate parent-session baseline. No production deployment or restart was performed. The native wrapper stopped before submission because its extra PR-review worktree was absent; the lane forbids additional worktrees, so the explicitly authorized exact-head REST fallback was used. Merge state and ancestry on main are verified. |
* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits) test(gateway): restore local probe deferred import fix(agents): release prompt diagnostics for retired sessions (#177614) fix(release): tag restart plugin cohorts consistently (#177725) refactor(ui): inline single-caller detail requests (#177705) chore(i18n): refresh native locales (#177721) refactor(codex): drop unread private runtime reports (#177689) refactor(ui): consolidate static artwork registries (#177692) refactor(ui): derive settings schema analysis in the view (#177624) refactor(media): consolidate capability defaults and compression grids (#177665) refactor(auth): bind OAuth managers to native provider operations (#177676) refactor(ui): remove redundant component rendering layers (#177607) fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082) fix(agents): report failed secret input prompt delivery (#177688) refactor(ui): share chat message render contracts (#177668) fix(ui): settle model status after overlapping publication (#177667) refactor(gateway): reuse native workspace and lifecycle facts (#177670) refactor(runtime): rely on canonical async lifecycle owners (#177635) refactor: fold private operation helpers into their callers (#177655) refactor(ui): remove unused chat leaf element adapters (#177582) perf(talk): use published authority for foreign voice writes (#177533) ...
#167350) * fix(pr): retain the admitted workflow across maintainer commands * fix: refresh the reviewed correction baseline Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163 * fix(pr): preserve cold workflow admission and repository identity * chore(pr): integrate canonical main CI repair * commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits) test(gateway): restore local probe deferred import fix(agents): release prompt diagnostics for retired sessions (#177614) fix(release): tag restart plugin cohorts consistently (#177725) refactor(ui): inline single-caller detail requests (#177705) chore(i18n): refresh native locales (#177721) refactor(codex): drop unread private runtime reports (#177689) refactor(ui): consolidate static artwork registries (#177692) refactor(ui): derive settings schema analysis in the view (#177624) refactor(media): consolidate capability defaults and compression grids (#177665) refactor(auth): bind OAuth managers to native provider operations (#177676) refactor(ui): remove redundant component rendering layers (#177607) fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082) fix(agents): report failed secret input prompt delivery (#177688) refactor(ui): share chat message render contracts (#177668) fix(ui): settle model status after overlapping publication (#177667) refactor(gateway): reuse native workspace and lifecycle facts (#177670) refactor(runtime): rely on canonical async lifecycle owners (#177635) refactor: fold private operation helpers into their callers (#177655) refactor(ui): remove unused chat leaf element adapters (#177582) perf(talk): use published authority for foreign voice writes (#177533) ... Co-authored-by: Vincent Koc <[email protected]>
…w#177614) * fix(agents): release prompt diagnostics for retired sessions Release every cache-affinity baseline when its session resets, is deleted, or shuts down; automatic reply-session rotation uses the same owner. Preserve cross-turn diagnostics for active sessions. * fix(skills): release completed review session resources
openclaw#167350) * fix(pr): retain the admitted workflow across maintainer commands * fix: refresh the reviewed correction baseline Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163 * fix(pr): preserve cold workflow admission and repository identity * chore(pr): integrate canonical main CI repair * commit '4f8617589b6c71d754171052b603fe534901bfa1': (52 commits) test(gateway): restore local probe deferred import fix(agents): release prompt diagnostics for retired sessions (openclaw#177614) fix(release): tag restart plugin cohorts consistently (openclaw#177725) refactor(ui): inline single-caller detail requests (openclaw#177705) chore(i18n): refresh native locales (openclaw#177721) refactor(codex): drop unread private runtime reports (openclaw#177689) refactor(ui): consolidate static artwork registries (openclaw#177692) refactor(ui): derive settings schema analysis in the view (openclaw#177624) refactor(media): consolidate capability defaults and compression grids (openclaw#177665) refactor(auth): bind OAuth managers to native provider operations (openclaw#177676) refactor(ui): remove redundant component rendering layers (openclaw#177607) fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (openclaw#166082) fix(agents): report failed secret input prompt delivery (openclaw#177688) refactor(ui): share chat message render contracts (openclaw#177668) fix(ui): settle model status after overlapping publication (openclaw#177667) refactor(gateway): reuse native workspace and lifecycle facts (openclaw#177670) refactor(runtime): rely on canonical async lifecycle owners (openclaw#177635) refactor: fold private operation helpers into their callers (openclaw#177655) refactor(ui): remove unused chat leaf element adapters (openclaw#177582) perf(talk): use published authority for foreign voice writes (openclaw#177533) ... Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Releases prompt-cache diagnostic history when its conversation retires or its one-off Skill Workshop review finishes.
User Impact
Session reset, deletion, automatic rotation, shutdown, and completed Workshop reviews release their diagnostic fingerprints. Active conversations keep cross-turn cache-hit and history-rewrite comparisons. No configuration or migration is required.
Why This Change Was Made
The diagnostic tracker map had a 512-entry count limit but no session-lifecycle cleanup. Its key includes the session ID, so a retired session's baseline could never be reused. Two hour-long synthetic Gateway snapshots contained 84 trackers each (14.52 and 14.55 MiB), despite only four active workload children. Identity analysis also identified the legitimate parent conversation and one-off Workshop reviews; at least two of three retained reviews were obsolete because the scheduler permits only one review at a time.
The existing diagnostics owner now clears every affinity for a retired session through the session-resource cleanup registry. Automatic reply-session rotation calls that same owner, and the Workshop terminal owner releases its session resources. Provider resources are selected by exact session ID, preserving other conversations that share provider affinity. Detached persistence alone does not imply a disposable identity, so ordinary reusable detached callers retain their existing contract.
The production delta is +20 lines: the missing retirement operation and three lifecycle connections. No cache, timer, option, index, or duplicate tracking owner was added. Removing the baseline itself would break active conversations' documented diagnostic comparisons.
Evidence
The session cleanup and automatic-rotation regressions fail on the base (old 8,000-token baseline instead of null); the Workshop success/failure cases fail without its terminal cleanup. With the complete fix, the previously run owner/history/reset files pass 78 tests, and the Workshop file passes 12 tests. The owner/history/reset runner took 28.39 seconds; Workshop took 55.05 seconds wall time (34.61 seconds Vitest, using the existing persistence/admission integration fixture). Changed-file formatting and type-aware lint pass. The two import-closure files pass 22 tests. No Testbox/Crabbox lease was used.
Fresh independent Codex review of the complete seven-file patch is clean through P2. In CI run 39320492713 for exact head
733da4b85a62d0274014ce8fc1c2d880be02960e, all functional jobs passed. Two static-analysis jobs failed on the unchangedsrc/gateway/local-http-probe.test.ts; the aggregate gate reports those failures. No CI rerun was requested.The inherited-failure exception is supported by the same diagnostics on the exact baseline
0548086d6a95525d7bad7f1905d2ae8c8d2de3efin scheduled main run 39320267109:check-test-types-core-4createDeferredCore(TS2304); line 178: implicitany(TS7006)check-lint-core-1typescript(prefer-promise-reject-errors)The affected test has identical blob
cb50eabba3e6638baad1a3860e8f602449757f75on the baseline, PR head, and inspected current main. The automatic summary labels these as new against the older completed run39311481040; the newer exact-parent run above independently reproduces both failures. All four job logs were fetched once and their diagnostics compared. The changed code and focused regression/import-closure proofs remain green.Gateway measurement
The committed memory-soak harness from #177548 runs a real Gateway, streamed responses from a synthetic provider, real tool execution, and eight viewers against a synthetic 5,000-session/6,000-run fixture. It uses synthetic transcript payloads, not production-sized transcript data, and Node 26.8.2. Each final pair uses one minute of warmup plus four measured minutes, four workload children, 100 streamed chunks at 10 ms, a three-second requested cohort cadence, and resets every two cohorts. Two baseline/candidate runs execute concurrently under an exclusive measurement lock; the CPU halves swap for pair two. The baseline is
0548086d6a95525d7bad7f1905d2ae8c8d2de3ef; candidate is733da4b85a62d0274014ce8fc1c2d880be02960e.Acceptance was recorded before these runs: equal completed turns/tool results, no retired workload generations, preservation of current child/parent baselines, and no completed Workshop review baselines. The initial exactly-four-total-trackers assumption was corrected after inspecting identities: the parent is legitimate, while completed one-off reviews require cleanup. A genuinely live review is allowed.
Both pairs completed equal work with zero errors: 61/60 cohorts per side, 244/240 turns and tool results, 156/152 resets, and 881/863 model requests. The request totals include equal foreground, tool continuation, and utility work within each pair.
The paired fixed-minus-baseline heap-growth differences are +1.45 and −4.77 MiB (mean −1.66 MiB): neutral overall. RSS growth increased by 32.55 and 77.57 MiB; final RSS was 0.5% and 2.3% higher, so this is not an RSS improvement. Process CPU moved +0.7%/+5.2%, and latency tails moved in both directions. The consistent win is lifecycle ownership: sampled prompt-diagnostic survivors fell by 91%/96%, and both final snapshots contain exactly five legitimate trackers (four current children plus their parent), retaining 93,272/163,096 bytes. No retired child generations or completed Workshop review trackers remain. The fixed code preserves active diagnostic behavior and releases obsolete state without a new retention policy.
This is a targeted ownership/retention fix. The earlier hour-long campaign did not reproduce the reported approximately 1 GiB growth in 90 minutes, and this short comparison does not establish overall one-hour memory flatness or explain all native allocations. No production deployment or restart is part of this PR.