Skip to content

refactor(ui): remove duplicate progress Markdown cache - #174831

Merged
steipete merged 1 commit into
mainfrom
deslop/z27-unneeded-caches-20261016
Oct 17, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z27-unneeded-caches-20261016

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem and change

Progress cards kept a second 16-entry Markdown cache above the canonical sanitized-Markdown cache. Remove that Map, its locale/key/eviction plumbing, and the now-redundant forwarding helper. The mounted Solid memo calls the canonical sanitizer with the same progress-bar option. Sanitization, locale refresh, DOM retention, markup, and accessible output stay owned by their existing implementations.

Net production LOC: 20 removed across two production files (6 additions, 26 deletions). One test loses 24 lines that mocked renderer call counts for the removed mechanism; output/accessibility/locale coverage remains. Whole diff: 3 files, 6 additions, 50 deletions. No benchmark speedup claim or intended visual change.

Solid structure stays unchanged: one mounted memo and one effect; no added signals, listeners, controllers, or rendering owners. The outer Map goes from one to zero.

Best-effort tradeoffs accepted

  • Repeated 50K–140K progress cards across mounts can render literal text again: the canonical cache caps normalized input at 50K, while the removed outer cache admitted 140K. The consolidation in refactor(ui): deslop shared components and libraries third pass #158787 established no measured outer-cache benefit. The canonical 500-entry sanitizer cache and mounted memo remain; no security/authorization cache changes.

CI-driven scope reduction

The original head f1ad31c removed 364 production lines. Run 38982034436 passed 72 jobs but failed checks-node-changed-compact-small-1: unchanged runtime-llm.prepared-owner.test.ts, keeps completion ownership coherent: lru, expected two registry forks and observed three. The CI gate failed downstream. Registry-build reuse remained eleven before/after; this is not evidence of catalog rebuilding.

No matching signature was established in the coordinator's main-flake ledger or six completed scheduled-main runs. Serial replay of the exact tested merge d8ee40ac42c1ce84b4138ab270d1164818a0cf2a and its main parent 2badc68 produced no test result during cold preparation under host load. Neither is a passing replay or inherited-failure attribution.

Following campaign rule 8, all 21 changed core production files reachable through the failing test's runtime-import graph, and their 12 test/support/baseline companions, have been removed from this PR. The independent UI slice remains. The original candidate is preserved on deslop/z27-parked-lru-attribution-20261015 (no PR); the parked core slice removes 346 production lines and needs conclusive fork-count proof before revival. No assertion, timeout, retry, skip, or suppression was weakened. The replacement starts from main b0ab440 for this named-gate narrowing, not merely to chase green.

Proof

Fresh focused UI-card, locale/DOM-retention and sanitizer tests passed: 58 tests across three files, serial workers, isolated state. Wall time was 636.11 seconds on a host reporting load around475; the two test shards reported305.32 and162.44 seconds. No timeout, retry, skip, assertion, or fixture was loosened. Formatting passed. Correctly scoped lint and the suppression ratchet each reached a300-second external proof budget without diagnostics/case results: unfinished local proof, not passes or product attribution. UI-package types and cycle-check attempts remain serially active; exact replacement-head PR CI is the broad gate. The existing independent scoped-clean P2 review covers the unchanged cache-removal hunks; the sole forwarding helper was mechanically inlined and verified by source inspection and the fresh tests. No new review verdict is claimed for the cancelled duplicate capture. Original-head CI does not qualify the replacement head.

Exact replacement-head CI run 38990792648 completed successfully at 58cf0b2cd3c7a1aa4f180cff28eb2ee4970488d6, including UI tests, UI E2E, performance, lint, production/test types, architecture and baseline ratchets, and openclaw/ci-gate. Local UI types and both cycle attempts also exhausted their external proof budgets without results; these are not claimed as passes. The hosted exact-head gates supply broad proof. Three cancelled auto-response jobs were superseded by successful same-head auto-response jobs; they are metadata automation, not missing test-suite proof. Scope-selected jobs were skipped as planned.

The earlier local suppression-ratchet failure was unchanged at its baseline (sqlite-memory-search-fragments.ts, oxc/no-map-spread); both original-head and replacement-head hosted baseline-ratchets passed. No new suppression or baseline allowance is introduced. Phase E standalone session memory and its factory, registry, expiry, federation, and tests remain untouched.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 16, 2026 23:33
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1ad31c293

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (!strict) {
prepareOpenAIFunctionTool(descriptor.name, descriptor.description, parameters, undefined);
}
normalizeOpenAIStrictToolParameters(descriptor.parameters, strict, compat);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Add benchmark evidence before removing agent caches

This performance-affecting refactor removes the cached OpenAI descriptor preparation here, as well as other agent-runtime result caches, without before/after timing and RSS measurements. Repeated tool preparation or transcript-policy resolution may therefore increase turn CPU or latency without evidence that the removed bookkeeping offsets it; benchmark a representative repeated-turn workload before accepting these removals.

AGENTS.md reference: src/agents/AGENTS.md:L5-L9

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T01:27:35.911077Z 58cf0b2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes redundant result caches and their invalidation plumbing while retaining canonical file, schema, routing-index, pricing, and Markdown owners.

Example: A session loads workspace AGENTS.md containing “Use concise replies” on consecutive turns.

  • Before: Each turn reloads the files, compares them with a session snapshot, and copies the reused array.
  • After: Each turn uses the freshly loaded array directly, with the same guarded file-content cache.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-approved reduction with retained canonical contracts and no concrete introduced defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor is outside the ordinary contributor proof gate; its reported focused tests support equivalence without claiming shipped-entry-point verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Redundant result caches add retained state and lifecycle bookkeeping without changing the intended user result.
Reason: The maintainer has approved the direction through authorship and documented the recomputation tradeoffs; the diff removes competing cache layers while retaining their substantive owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: the cache removals form a coherent simplification, and source review found no concrete introduced bug; one CI failure still needs attribution.

Priority: P3
Reviewed head: f1ad31c293f0ab56fde42bdc81197eec47e9238b

Before merge

  • Complete next step - Classify the prepared-runtime LRU failure at src/plugins/runtime/runtime-llm.prepared-owner.test.ts:923 against base evidence, and repair it if this diff caused it.

Findings

None.

Agent review details

How this fits together

These helpers turn workspace files, routing inputs, tool schemas, transcript records, and progress Markdown into agent context, provider requests, session routes, and rendered output.

flowchart TD
  A[Workspace and request inputs] --> B[Canonical readers and indexes]
  B --> C[Direct result construction]
  C --> D[Agent context and session routes]
  C --> E[Provider request descriptors]
  F[Progress Markdown] --> G[Canonical sanitizer and mounted memo]
Loading

Technical review

Best possible solution:

Retain the direct-result simplification and canonical caches, then settle the unrelated-versus-introduced CI attribution before landing.

Do we have a high-confidence way to reproduce the issue?

This PR reports redundant internal work rather than a product bug; source inspection confirms the duplicated cache layers, and no target code was executed.

Is this the best way to solve the issue?

Direct construction is a reasonable simplification because expensive canonical caches remain and the maintainer explicitly accepts the lost small-result reuse.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b461dc69d67d.

Provenance checked

  • Bootstrap snapshots and reset invalidation changes intended behavior with a stated reason (40db3fe: Per-session snapshot reuse originally avoided repeated loading; fix(agents): refresh bootstrap snapshot when workspace files change #72406 subsequently restored per-turn loading for freshness, crediting earlier contributor work.)
  • Workspace source-identity comparison keeps the original intent (d06fc25: Privacy filtering required exact opened-source provenance; only the obsolete snapshot-equality token is removed, while path, stat identity, remote relative path, and final filtering remain.)
  • Routing and account result caches changes intended behavior with a stated reason (ba5ae5b: Cache repeated route resolution; later account consolidation shared canonical normalization, while this PR accepts recomputation through retained indexes.)
  • OpenAI descriptor variants and warmups changes intended behavior with a stated reason (bca779e: Reuse prepared immutable descriptors between turns; this PR removes request-wrapper reuse while retaining published schemas, normalization variants, and descriptor snapshots.)
  • Transcript replay-policy memo changes intended behavior with a stated reason (f8cbd35: Memoize replay policy for repeated provider/config inputs; the PR accepts rebuilding the flag object and retains runtime-plan getter memoization.)
  • Pricing-index duplication keeps the original intent (068924e: Avoid rebuilding model-cost indexes during repeated usage lookups; the canonical normalizer-scoped provider index still supplies that reuse.)
  • Text-segment projections changes intended behavior with a stated reason (8416d71: Share code-region discovery across native text parts; callers consume each segment once, and the joined code scan remains shared.)
  • Progress Markdown result cache changes intended behavior with a stated reason (0be9268: Reduce repeated sanitization, including large cards; the current maintainer explicitly accepts repeated large-card rendering across mounts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit bca779e adds src/agents/agent-tools.descriptor-snapshot.ts:59 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bca779eac0ca; files: src/agents/agent-tools.descriptor-snapshot.ts)
  • Jacqueline Henriksen: Raw commit 0be9268 adds ui/src/components/session-progress-card.ts:92 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0be926819afa; files: ui/src/components/session-progress-card.ts)

PR surface

Source -364, Tests -183, Other -2. Total -549 across 35 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 22 36 400 -364
Tests 12 48 231 -183
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 2 -2
Total 35 84 633 -549

Review metrics

Metric Value Why it matters
Production versus test changes Production +36/−400; tests and test support +48/−231. The reduction removes result-cache owners and obsolete identity/invalidation assertions while preserving canonical behavior coverage.

Labels

Label changes:

  • add P3: This is an internal simplification with no intended user-visible behavior change or demonstrated urgent defect.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal simplification with no intended user-visible behavior change or demonstrated urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 7:51 PM ET / 23:51 UTC.

@steipete
steipete force-pushed the deslop/z27-unneeded-caches-20261016 branch from f1ad31c to 58cf0b2 Compare October 17, 2026 01:25
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 17, 2026
@steipete steipete changed the title refactor: remove redundant result caches refactor(ui): remove duplicate progress Markdown cache Oct 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The branch and proof are current at 58cf0b2cd3c7a1aa4f180cff28eb2ee4970488d6. The core slice was parked following inconclusive fork-count attribution; only the independent progress-card cache removal remains. Exact-head CI run 38990792648 passed, including the aggregate gate. The PR body records the scope reduction, accepted tradeoff, focused proof, and unchanged-review reuse.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Landing evidence for exact reviewed head 58cf0b2cd3c7a1aa4f180cff28eb2ee4970488d6.

Exact-head CI run 38990792648 completed successfully. All check runs for this head were enumerated: no failing checks; the CI aggregate, security-fast, UI/E2E/performance, lint, types, architecture and baseline ratchets passed. Three cancelled auto-response jobs (117272712784, 117272709109, 117272698537) are superseded metadata automation, with successful same-head auto-response jobs including 117272864342. They contain no missing test suite. Other skips are scope-selected or nonapplicable automation. No CI rerun or green-chasing push was used.

Focused proof: 58 passing UI/card/locale/sanitizer tests with serial workers and isolated state; original independent scoped-clean review reused for unchanged cache-removal hunks and mechanical forwarding-helper inline. Local lint/types/suppression/cycle attempts exhausted external host-load budgets without results and are not claimed as passes; exact-head hosted gates supply broad proof.

The original wider candidate failed the prepared-owner LRU fork-count test. It was not attributed as inherited. Inconclusive serial replays led to campaign-rule-8 removal of the entire reachable core slice and its dependent companions. Those hunks remain on deslop/z27-parked-lru-attribution-20261015, without a PR. This PR now removes 20 net production lines across two UI files; Phase E is untouched.

Coordinator-authorized rule-10 infrastructure fallback: the first native initialization refused materialized dependency-version drift. The supported separate tooling root resolved that prerequisite. The later native review-init lost its synchronous tool/controller session during an execution-service interruption; its supervisor disappeared and an orphaned wrapper/Git scan remained with no recoverable completion result. Those exact task-owned remnants were terminated and verified drained. Intentional earlier cancellations are not counted as failures. No retained native merge intent exists, and the PR remains OPEN/MERGEABLE at the exact head above. The native initialization/recovery artifacts are preserved rather than fabricated or cleared.

Using the authorized SHA-guarded squash API after these two infrastructure failures. This bypasses broken native orchestration, not CI, security, or review gates.

@steipete
steipete merged commit eb0fc4d into main Oct 17, 2026
99 of 103 checks passed
@steipete
steipete deleted the deslop/z27-unneeded-caches-20261016 branch October 17, 2026 01:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant