Repository navigation
refactor(outbound): reuse prepared sendability facts - #142252
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 8, 2026, 11:05 AM ET / 15:05 UTC. ClawSweeper reviewWhat this changesReuses prepared content flags when selecting command replies for transport, avoiding repeated payload copying and rich-content normalization. Merge readiness✅ Ready for maintainer review This remains a useful, narrowly scoped optimization absent from current main. Source inspection supports equivalent filtering on the fresh-plan path, with no actionable correctness findings or outstanding prior findings. Priority: P3 Review scores
Verification
How this fits togetherCommand delivery prepares reply text, attachments, and rich content into an outbound plan. The transport projector selects sendable entries from that plan before channel delivery. flowchart LR
A[Command replies] --> B[Normalize text and media]
B --> C[Prepare content facts]
C --> D[JSON tracking]
C --> E{Sendable content?}
E -->|Yes| F[Channel delivery]
E -->|No| G[No transport entry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1. Total -1 across 1 file. 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 confined to synchronous fresh-plan transport projection while preserving mutable SDK delivery behavior and existing output references. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction: source confirms redundant normalization, while the reported allocation measurements were not independently rerun. Is this the best way to solve the issue? Yes. Reusing facts at the sole fresh-plan consumer removes redundant work without changing public APIs, payload construction, or mutable delivery semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 225845acbfe8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* commit '04869ae4899ad0524c3287759798362b0d62fef8': (677 commits) fix(release): pin Kova census refresh (#142104) fix: doctor read-only database inspections time out on large agent databases (#142179) docs: align v2026.9.3 framing with release announcement (#142307) fix(ui): discover models when default-model pickers open (#142105) fix(ci): keep Docker upgrade seed baseline older than target (#142273) refactor(tests): reuse named OAuth credential fixtures (#142272) fix(ci): keep mobile release helpers out of source checks (#142115) chore(ui): refresh control ui locales (#142147) fix(active-memory): explain why recall was skipped (#138658) fix(media): preserve converted images with HEIC filenames (#142263) docs: add v2026.9.3 release notes (#142277) fix(ui): retire picker focus listeners together (#142258) fix(ui): keep menu hover colors consistent across themes (#142243) fix(release): keep changelog credits within verified history (#142261) fix: keep tool-finalizer placeholders private in message-only groups (#138645) perf(tui): carry prepared URL membership through rendering (#142262) test(ui): await activity cache imports before teardown (#142282) fix(qa): align auth and Workshop proofs with runtime contracts (#142280) feat(xai): use one curated catalog and concrete setup default (#142136) refactor(outbound): reuse prepared sendability facts (#142252) ...
Closes #142251
Additional instructions
Maintainer edits are enabled on this repository-owned branch.
What Problem This Solves
This is a maintainer-authored and requested optimization. Command delivery normalizes rich reply content while building its outbound plan, then clones the payload and repeats rich-content normalization when deciding which transport entries to produce. The fresh plan already records the facts needed for that decision.
Why This Change Was Made
The internal outbound projector now reuses the prepared text/media, presentation, interactive and channel-data flags, together with the existing location-nullness check. Its sole production caller creates and consumes the plan synchronously, before another modifier or external callback runs. Output construction and object references remain unchanged.
Plans remain publicly mutable. The public SDK creator and delivery projector keep their existing behavior; this optimization applies only to the internal fresh-plan transport path. A bare
audioAsVoicemarker still produces a delivery/JSON tracking entry while producing no outbound transport entry. Actual voice media remains sendable.User Impact
Less transient allocation while preparing rich command replies, with the same text, media, rich content, status and delivery behavior. Production changes by +6/-7 lines in one file; no tests, public API, configuration, queue or persistence behavior changes.
The actual full plan-plus-projection rich workloads measured approximately 27–30% lower sampled JavaScript allocation. For example, 750 rich-card operations changed from 14,099,488 to 10,165,792 sampled bytes. Separate already-prepared projection measurements showed 89–99% reductions for rich workloads; those exclude plan creation and are not full-path savings.
Evidence
e321e32abde7b91f3ec1e83f599ea78e98c53673. Source and proof identities remain pinned.Active #137530, #127653 and #80396 change plan construction independently. Preserve their text/media normalization and new plan facts if they land first, then recheck the corresponding output/reference cases. Release-note context: reuse prepared sendability facts for internal command transport while preserving public SDK and audio-only tracking behavior.