Repository navigation
improve(agents): skip unused assistant delivery parsing - #146858
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: needs maintainer review before merge. Reviewed September 13, 2026, 5:59 AM ET / 09:59 UTC (Revision 5). ClawSweeper reviewWhat this changesSkip delivery-directive parsing for assistant text without marker prefixes, extend transcript byte-preservation coverage, and close test database handles before removing fixtures. Merge readiness✅ Ready for maintainer review This remains a useful, narrowly scoped optimization absent from current main and the latest release. No actionable correctness findings remain; the supplied real SQLite measurements support the bounded performance claim. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw prepares assistant messages for live session state and transcript storage through a shared delivery-directive owner. It extracts reply and speech instructions while preserving ordinary text and recording managed-media references. flowchart TD
A[Assistant message blocks] --> B{Text contains marker prefix?}
B -->|Yes| C[Existing directive parsing]
B -->|No| D[Preserve original text]
C --> E[Merge delivery facts and media references]
D --> E
E --> F[Live session and SQLite transcript]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3, Tests +15. Total +18 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep the optimization at the existing transcript delivery owner while preserving parser behavior for other callers and exact stored message bytes. Do we have a high-confidence way to reproduce the issue? Yes: current source unconditionally normalizes marker-free assistant text and discards the result; the supplied SQLite append measurements exercise that path. This review did not rerun the benchmark. Is this the best way to solve the issue? Yes: the owner-specific shortcut avoids unused work without changing the shared parser's existing normalization contract or adding another implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d1cf24318b8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
49566e6 to
5d54b16
Compare
|
Merged via squash.
|
* refs/heads/temp/pr-146883: (159 commits) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) ...
* refs/heads/temp/pr-146833: (43 commits) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) ...
…ssion-list-roster-batch-20260913 * commit 'f513c0f345f7f2514c49ccfbc00adc3f78b9a755': (46 commits) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) fix: share Doctor lifecycle coordination with SQLite workers (#146714) fix: retain native session model provenance (#146801) fix: settle embedded transcript repairs before session cleanup (#146842) feat(macos): improve agent navigation and chat layout (#146531) ...
Closes #146829.
What Problem This Solves
Saving an assistant reply without delivery markers still parses and normalizes its Markdown, then discards that result. Large code blocks make this unused work noticeable in the complete SQLite append path.
User Impact
Code-heavy assistant replies take less time to save. Exact transcript bytes, delivery facts, mixed content, and managed-media recording remain unchanged. No cache, schema, API, or update behavior changes.
Why This Change Was Made
The existing delivery owner now skips parsing text without the literal
[[prefix required by every reply, audio, malformed-prefix, and TTS directive. Marker-bearing text follows the existing path.The existing persistence test adds ordinary whitespace, CRLF, and Markdown byte-preservation coverage. Its fixture also uses the existing session-state cleanup owner before removing temporary directories: the original Windows run failed all 21 cases during removal with open SQLite handles; the same 21 cases pass after proper cleanup, with original assertions and limits.
Evidence
Three alternating fresh-process pairs on each of Node 24.19 and 26.8 exercise public
SessionManager.open,appendMessage, andflushPendingPersistencewith real isolated SQLite storage. Each child verifies 558 complete outputs and measures 18 fixed workloads, with three sessions, three warmups, and five measured appends per session. All 12 children and 6,696 comparisons passed; no selective reruns.Fenced 16K appends improve 8.932 to 3.021 ms on Node 24 and 10.869 to 3.149 ms on Node 26. Indented 4K and plain 64K also improve in all three pairs on both versions. These are elapsed times for complete persisted appends, not whole-application or provider latency.
Controls are mixed. Node 24 plain 1K, reply 4K, and audio 4K are slower in all three pairs; reply 4K moves 2.584 to 3.016 ms, with paired increases of 0.145–0.664 ms. Node 24 mixed content moves 2.283 to 3.049 ms (one faster pair), and empty content 1.823 to 2.255 ms (one faster pair). Node 26 also has adverse directive/empty controls. Unchanged nontext controls vary too; their cause is not established. No universal gain is claimed.
All warm append measurements
Values are medians of three child-process medians; each child summarizes three session medians. Faster counts retain paired direction and can differ from the direction of the overall medians.
Setup and first appends are recorded separately. A first append uses a fresh session in an already warm process/database; it is not application cold start. First-append samples include adverse outliers, including 142.697 ms for a Node 26 literal-code control and 106.665 ms for a Node 24 empty control. They remain in the evidence.
Whole-process peak RSS medians were 988,672 → 974,808 KiB on Node 24 and 890,876 → 851,908 KiB on Node 26. These include imports, runner, both variants' parity work, and the full workload; they do not measure retained product memory.
The 69 directive tests and complete 21-case persistence suite passed. Core typechecking, all 18 test type graphs, preceding selected guards, formatting, targeted lint, and all nine remaining selected checks passed. The aggregate check failed only on
canonicalProviderNameandlistPackagedStaticExtensionAssetOutputs, also reproduced on the clean baseline; both owning files are unchanged. Production unused-export analysis passed. No guard, baseline, timeout, or assertion was weakened.Fresh independent P2 review completed with no actionable findings across all four evidence batches (confidence 0.80). The previous hosted head failed two inherited main defects: the removed sidebar deferred helper and the agents-other 702-root headroom overflow. Both repairs are now on main through #146862 and #146803. This branch was refreshed onto
2e0bfa16with a byte-identical patch and unchanged affected source owners. Historical run 34748396850 ended in startup_failure with zero jobs, and the separate OpenGrep run did not acquire a runner across five attempts. Two initial recovery calls failed without changing the PR. A later verified close/reopen attached run 34750244280. Its first attempt failed before typechecking because @matrix-org/[email protected] postinstall received HTTP 500 and then threw ReferenceError: err is not defined; the raw log remains preserved. These historical failures are not passing results or evidence of a source defect. The subsequent second attempt completed successfully at the unchanged reviewed head. Current exact-head CI run 34750244280, attempt 2 completed successfully at5d54b16f66557debc73af5b463f83172bce7dc19(2026-09-13T10:07:29Z). The current required-check query reportsopenclaw/ci-gateSUCCESS. This supports native preparation; it does not claim merge or cleanup, or a rerun of unchanged local performance proof.