Repository navigation
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 real behavior proof before merge. What this changesThis PR adds explicit GPT-5.6 Responses caching, Mantle capability metadata, replay accounting, and widget toolbar spacing. Example: Five Mantle GPT-5.6 Terra requests in a tool loop.
Review scores
ProductKind: Performance · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 6 items remain This PR contains useful caching work absent from current main, but the previously reported stale-instruction defect remains unresolved. Priority: P2 Decision needed
Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe shared Responses builders convert model capabilities, system instructions, and conversation history into provider requests; continuation reuses stored responses, and replay metadata supports later context accounting. flowchart TD
A[Model capabilities] --> C[Responses request builders]
B[Prompt series and history] --> C
C --> D[Continuation owner]
D --> E[OpenAI or Mantle endpoint]
E --> F[Response and replay accounting]
F --> B
Technical reviewBest possible solution: Compose cache boundaries with the existing prompt-series owner, preserve reusable history, and separate the unrelated widget layout repair. Do we have a high-confidence way to reproduce the issue? Source tracing establishes both the current implicit-cache path and the introduced stale-suffix continuation path; contributor traces demonstrate cache-write suppression, and no target code was executed during this review. Is this the best way to solve the issue? Shared Responses ownership is appropriate, but unconditional suffix delivery conflicts with prompt pinning and the proposed native default trades history-cache reuse for write suppression. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eec35949bda1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +253, Tests +633, Docs +67. Total +953 across 29 files. Added test files: 2. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (20 earlier review cycles; latest 8 shown)
Reviewed October 18, 2026, 3:15 AM ET / 07:15 UTC (Revision 21). |
9e6d1e6 to
c25ef95
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c25ef95c15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Updated head
This removes both P1 findings from the prior review (which inspected superseded head Current exact-head CI has one upstream blocker: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c25ef95 to
04c11f0
Compare
|
Addressed all three current-head ClawSweeper findings in
Regression proof:
Automatic discovery and endpoint routing remain out of scope here and owned by #111782. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Live QQ Bot The test called Before, automatic cache mode: After, explicit mode with one stable system-prompt breakpoint: The live route was This directly covers the multi-round |
04c11f0 to
7efd87f
Compare
|
Updated head
Verification after this refactor:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
19ac335 to
c0169a9
Compare
c0169a9 to
37ba43f
Compare
37ba43f to
ca81f06
Compare
Attach existing raw SQL allowances to the actual SQL nodes, document the immutable backup PRAGMA, and reuse quoted schema-derived identifiers. Query text, value encoding and migration behavior remain unchanged. Validated pnpm lint:kysely, the existing plugin rowid/view/trigger preservation test, formatting and git diff --check.
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Thanks @BukeLy for the detailed cache-cost investigation and endpoint traces. Closing this broad patch in favor of the prefix-preservation repairs in #140849, #167698, and #181301. On current main ( This is request-boundary evidence, not a live billing measurement. A system-only explicit-mode default disables implicit history checkpoints, so eliminating new writes alone does not establish lower total cost. Leaving #130061 open for measured breakpoint-placement and total-cost work; your endpoint evidence remains useful there. No contributor code was executed. |
Closes #130061
Related: #108216. #111782 owns automatic Mantle discovery and endpoint routing; this change owns caching after a Responses route is selected. The manual Mantle configuration in the provider docs is usable independently of automatic discovery.
What Problem This Solves
OpenClaw discards its stable/dynamic system-prompt boundary when constructing GPT-5.6 Responses requests. Changing turn context and tool results can therefore cause repeated cache writes instead of reusing stable instructions. Responses succeed while cache-write cost accumulates.
The repair preserves the stable prefix on native OpenAI and verified compatible Responses endpoints, keeps current dynamic context visible during continuation, and preserves measured compaction usage after saved-history reload.
Why This Change Was Made
The shared Responses request owners now translate the existing prompt boundary into one content-level
prompt_cache_breakpointand sendprompt_cache_options.mode: "explicit".supportsExplicitPromptCachingruntime capability while normalizing their models. Unknown endpoints remain implicit.cacheRetention: "none"sends explicit mode with no breakpoint or cache key, preventing cache writes while preserving current instructions.ttl: "30m"with explicit mode. Compatible providers retain their declared key/lifetime limits.The Mantle plugin declares support for its prefixed GPT-5.6 Responses models and preserves an explicitly disabled prompt-cache key. Both managed transport and simple completion use the same conversion and capability contract.
This adds one optional provider-owned runtime capability and no user configuration option or Plugin SDK subpath. The provider SDK docs define the endpoint-verification and payload-test requirements for declarations. The declaration is additive and defaults off for unverified compatible endpoints.
The Responses SDK compatibility type also declares the existing
supportsPromptCacheKeyswitch, matching the runtime's native-default/compatible-opt-in behavior and allowing verified models to preserve an explicit key opt-out.User Impact
GPT-5.6 Sol, Terra, and Luna agents can reuse stable instructions across changing turns without repeatedly writing dynamic context. Continued requests retain current instructions, and compaction accounting can still use measured provider usage after transcript reload.
Evidence
API contracts
[email protected]declares both request cache options and content-level breakpoints.Fresh native OpenAI transport proof
On 2026-10-10, the candidate's real
createOpenAIResponsesTransportStreamFnmade three credentialedgpt-5.6-lunaSSE requests with a synthetic stable prefix, changing developer markers, and stateful continuation enabled through the existing payload hook. Captures inspected the final serialized bytes passed to fetch.Exactly three physical requests completed successfully. Turns two and three sent
previous_response_idand only the current dynamic developer message plus the new user turn. The stable instruction prefix was absent from those wire deltas. No credential or private prompt content was recorded.The real Mantle QQ Bot tool-loop trace supplies compatible-endpoint cache proof: the four follow-up tool rounds each reused 25,375 cached tokens with zero new writes.
Regression proof
Before the owner fixes, the strengthened three-turn test returned
stop, stop, error, and both native/shared explicit-cache compaction cases lost their measured boundary after JSON transcript reload. After the fixes, all six selected continuation and saved-history scenarios passed.The broader Responses/cache/replay selection covers native key and TTL behavior, compatible declarations, opt-out, instructions, SSE/WebSocket continuation, reasoning replay, tool IDs, recovery, lifecycle cleanup, and compaction usage. Mantle tests cover prefixed IDs and preservation of explicit key opt-out.
Stable saved-data compatibility
The retained fixture comes from eleven immutable v2026.9.9 source owners, with their SHA-256 hashes recorded. The candidate saves and reopens all four synthetic messages through the supported SQLite session reader, restores the old 520-token compaction usage boundary, and sends the next request through real SDK serialization into mocked HTTP/SSE. Model/provider/API/base URL, cache-key opt-out, retention selection and saved conversation remain unchanged. The new request contains the retained compaction and conversation plus the current explicit stable-prefix breakpoint.
This validates source-produced saved-data compatibility; it does not claim a complete published-binary database upgrade.
Validation
Local owner selections passed using the standard
pnpm test ... --maxWorkers=1entrypoint:The final Responses selection took 8.98 seconds (10.59 seconds through the repository wrapper), reusing the shared compiled generation. The parameter owner took 0.785 seconds standalone (13 tests). The Mantle selection took 9.30 seconds, Gateway 7.84 seconds, and embedded caller 13.22 seconds.
The complete Dashboard browser file passed 8/8 tests in 22.70 seconds, including the production UI build and Chromium setup. True pointer clicks cover both original Pin failures, Details open/close, widget documents, dashboard commands, permissions and Workboard linkage.
Core and UI production, package tests/shared declarations, plugin production and plugin test typechecks passed. Scoped source and UI stylesheet lint, formatting, assertion safety, line caps and deprecated API checks passed.
Docs passed Markdown, template, MDX, glossary, internal link, configuration-fence and changelog gates: 14,955 links with zero broken links, and 1,316 validated configuration fences. Config/schema baselines remain unchanged. Local ratchets, plugin boundaries, source lint, dependency pins/patches, schema version, database/media/sidecar guards, authentication/webhook guards and zero runtime import cycles passed.
At head
37ba43fca63379ddc526d0e7d78cfb7852910c5b,pnpm buildpassed in 4m46.1s, verifying 151 public SDK subpaths, 96 external plugins, 54 native modules and the Control UI build. The public SDK declaration graph is 4,761,404 bytes against a 5,315,536-byte limit. The production, full-tree and scripts unused-export scans all passed with zero entries.The strict normalized Control UI performance lane passed in native CI. Final candidate:
ca81f06b37e06f7d6d3080add2f2bea1630ed700; exact-head native CI is verified after publication.Independent structured review of the complete candidate:
scoped-clean, no actionable P0–P2 findings or suspected credentials.The branch carries the small CI prerequisite from #168292, original commit
8133cc33327afa7c7882cd625d0a6e324ee5e2e0, with Dallin Romney's original author identity preserved. It removes two test-only Gateway exports, exercises the actual rendered lifecycle script in the existing refresh fixture, and removes the staledoctor-memory-search.test.tsmax-lines entry. Rendered script bytes, HTML and CSP behavior remain unchanged. The olderpr-cross-checkout.test.tsmissing-tool fixture failure is fixed by upstream commit4bbdedbb9b94fa0d13c4db0fae292c29a9021be6, included in this branch's base.The integration prerequisite also reserves the existing above-preview widget toolbar's 36-pixel height plus the 12-pixel spacing token in normal flow. This clears the Details header in narrow conversation columns and keeps both controls clickable. The E2E fixture uses the canonical language context. General Details layout and widget document execution remain owned by their existing implementations.
Production growth implements the shared explicit-cache wire contract, stable/dynamic continuation comparison, and measured-prefix reconstruction. Tests cover those observable contracts; provider documentation explains the additive capability and manual configuration.