Repository navigation
improve: reduce data fetched for profile metadata operations - #148953
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 15, 2026, 5:19 AM ET / 09:19 UTC. ClawSweeper reviewWhat this changesThe PR avoids loading avatar bytes during profile metadata operations and makes schema-readiness caches follow transaction rollback. Merge readiness✅ Ready for maintainer review This remains a useful, bounded optimization that current main and the latest release do not contain. No actionable correctness defect was found in the introduced changes. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw resolves stored user profiles for skill-library permissions, personal GitHub connections, and preference updates. These operations need identity and role metadata; separate avatar operations need the image bytes. flowchart TD
A[Library and preference requests] --> B[Profile lookup]
B --> C{Role schema known?}
C -->|Yes| D[Metadata without avatar bytes]
C -->|No| E[Existing full-row fallback]
D --> F[Resolve canonical profile]
E --> F
F --> G[Existing permissions and operations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +73, Tests +220. Total +293 across 15 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep metadata projection with the existing profile resolver, preserving avatar access, legacy reads, native validation, and transaction-owned cache invalidation. Do we have a high-confidence way to reproduce the issue? Not applicable to the primary performance improvement; current source confirms unnecessary full-row reads, and the PR reports concrete before/after byte measurements. Is this the best way to solve the issue? Yes. The change narrows reads inside the existing resolution owner while preserving its fallback, error, permission, and avatar contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a10df27f8d55. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…w#148953) Co-authored-by: Peter Steinberger <[email protected]>
Related: #146197
What Problem This Solves
Skill-library authorization and profile preference operations fetch stored avatars when they only need profile metadata.
User Impact
These operations avoid copying avatar BLOBs into JavaScript. Profile resolution, missing-profile errors, and avatar access retain their behavior. No operator action or data migration is required.
Why This Change Was Made
Metadata reads omit BLOB avatars while retaining non-BLOB values and numeric columns for existing native validation. Required-profile callers use the same resolution owner, including merged aliases and missing merge targets. Cold and legacy handles retain their fallback; avatar reads and adoption keep their full-row reads.
The role-schema cache now follows transaction rollback, so a rolled-back legacy migration cannot make subsequent metadata reads select a nonexistent column.
Evidence
Native SQLite measurements through actual library operations and the preference handler on Node 24.19.0:
TEXT bytes were also unchanged. The preference measurement does not include worker-thread SQL. No latency, heap, or disk-I/O improvement is claimed.
a5ffb586bed46443d91718e694748192d6df4256.