Repository navigation
improve(gateway): reduce publication receipt fetches - #148144
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 14, 2026, 7:45 AM ET / 11:45 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR reduces SQLite data fetched for GitHub publication status and deferred notifications, and extends test instrumentation to count native all() reads. Merge readiness✅ Ready for maintainer review Keep open as a useful, bounded optimization that current main does not contain. No actionable correctness or security findings remain; the protected maintainer label also precludes cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway records GitHub publication outcomes in SQLite and reads them to report publication status for a session’s workspace. Deferred publication updates notify session observers after their transaction commits. flowchart TD
A[Session status request] --> B[Publication receipt reader]
C[SQLite receipts and workspace records] --> B
B --> D{Latest receipt matches current workspace?}
D -->|Yes| E[Validate and return receipt]
D -->|No| F[Search receipt history]
F --> E
C --> G[Deferred request updates]
G --> H[Post-commit session notifications]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +148. Total +155 across 3 files. View PR surface stats
Review metrics
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 receipt selection and notification semantics at their existing owners while avoiding redundant row materialization. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug report; the source shows redundant materialization, and the supplied owner-boundary measurements quantify it. This read-only review did not rerun tests. Is this the best way to solve the issue? Yes. Reusing the already-qualified latest receipt and narrowing UPDATE return columns removes unnecessary work without introducing another owner, cache, schema, or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9a5af1b95370. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
7abc6a6 to
dd48fd8
Compare
|
Merged via squash.
|
* improve(gateway): reduce publication receipt fetches * test(gateway): satisfy publication regression lint rules --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #146197
What Problem This Solves
Shared GitHub publication status reads can fetch the latest receipt twice and materialize older history unnecessarily; deferring requests also returns large receipt fields that notifications do not use.
User Impact
No user-visible behavior changes. Publication reads and deferred notifications transfer less data from SQLite, with unchanged validation, history selection, errors, transactions, and event order. No schema or migration changes.
Why This Change Was Made
Reuse the latest receipt after the existing workspace validation when it matches the current lifecycle and workspace. Keep the existing paginated fallback and receipt-integrity checks. Deferred updates return only the three fields consumed by the existing notification owner.
The shared test counter now observes
StatementSync.all()as well asget,iterate, andrun; Node 26.6 and newer use this path for Kysely reads. The initial incomplete-counter attempt is excluded from the measurements below.Evidence
Measurements use real SQLite owners with synthetic fixtures on Node 26.8.2. Text bytes are the summed UTF-8 bytes of returned string values, not heap usage or transport serialization size.
all()and the failing cases do not use the shared counter. That test-fixture repair is fix(tests): restore session race coverage on Node 26 #148182, with 41 passing tests on both Node 24 and Node 26 and all 20 selected checks passing.The follow-up test lint repair at
7abc6a640784078ebdb8783f780f1debea3d690echanges only the prefix assertion and nonmutating expected-row construction. All 46 owner tests pass again with the same measurements, and a fresh independent P0–P2 review is clean.At
7abc6a640784078ebdb8783f780f1debea3d690e, the Docker CI job failed the stale plugin-fixture assertion; the equivalent fix merged as #148129 atabbdd5287afc59899721285bca79fdfd8e6d289d(#148118 remains an open duplicate, correcting the earlier note). The memory CI job separately failed withENOTEMPTYduring watcher-fixture teardown. One complete original-order watcher-file run on Node 24.19.0, with the shared counter restored to its original version, passed all 78 tests. No direct counter instrumentation path reaches that fixture, but the late writer was not identified and the full hosted shard remains unverified. The Docker failure justifies refreshing onto its merged fix; fresh exact-head CI and native landing gates remain required. No failing result is waived.Refreshed head:
dd48fd8f42add57140251a9860ebddf730d955f4onf4ffd8c21fcd9ff9df417fba01c3c1afb1ad3c7a. The complete two-commit patch, reviewed context, and dependency inputs are unchanged. New exact-head CI passed.Current CI completion: Exact-head CI run 34837821263, attempt 1, completed successfully for dd48fd8, including required openclaw/ci-gate job 103976009033. Run evidence.