Repository navigation
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
November 4, 2026 10:01
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
deleted the
steipete/perf-micro-responses-continuation-normalize-alloc-20260919
branch
November 4, 2026 10:13
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Long OpenAI Responses tool conversations repeatedly allocate normalized copies of history that conversion has already prepared and frozen.
User Impact
Unchanged immutable histories need substantially less local CPU and allocation per continuation request. Wire deltas, response IDs, and tool-result ownership stay unchanged. Mutable hooks, reconstructed histories, and images retain the existing comparison path; no configuration or migration is required.
Why This Change Was Made
The continuation owner now compares the producer's existing immutable item identities before rebuilding both historical owner maps and JSON projections. This introduces no new cache or retained state. The latest response and every pending/delta tool result still undergo ownership checks. An identical already-sent prefix can continue even when historical IDs share a replay alias; changed colliding results still reject continuation.
Runtime production delta is +18 LOC: the identity admission branch preserves the complete mutable/replacement fallback. Tests add 51 lines for reuse, replacement/unknown-result rejection, and historical alias safety. The benchmark adds 10 lines to distinguish reused identities from mutable-image history.
Evidence
Synthetic owner fixture: 200 growing decisions after 120 initial turns, 604–1,599 text/tool/reasoning items, approximately 4 KiB new content per turn. Five conversations per sample and five alternating A1/A2/B samples per metric; timing and allocation run in separate processes on Node v26.12.1. Acceptance: unchanged prefix/delta correctness, CPU and allocation improvement beyond A/A spread, no material fallback regression.
Main-thread CPU falls 97.6%, allocation 99.7%. A/A median drift: CPU 0.69%, allocation 0.10%. Five-sample p95 uses the maximum. With a mutable image every 25 turns, A1/A2/candidate CPU medians were 1,681.80/1,519.82/1,536.19 µs and allocations 2,318,644/2,321,587/2,327,882 B: no mixed-image speedup claimed. Profiles confirm the historical normalization/ownership-map work disappears from the shared-prefix path. These are owner measurements, not whole-Gateway or live-provider latency claims.
Reproduce on parent and candidate with the committed benchmark (copy the parent's owner beside the current file and pass
--modulefor the baseline):Add
--allocationfor sampled allocations; use--image-every 25for the fallback control.5d3c080a173fe4690e117e689248aae4a4f7261b, through P2: scoped clean, no actionable findings. Author simplification pass retained only the identity admission branch and existing fallback.pnpm check:changedcompleted all selected checks. Its initial package-test typecheck found two fixture index reads typed as possibly undefined; both were repaired, and the failed package typecheck plus owning tests were rerun successfully. All other selected checks passed. Final formatting and test-line budget checks pass.No production systems or data were accessed. Session database and workspace size do not affect this owner, which only receives prepared request history. Stream decoding already scans new text plus bounded delimiter overlap; this PR does not change it.