Skip to content

fix(openai): restore cache-TTL context pruning - #127992

Merged
fuller-stack-dev merged 9 commits into
openclaw:mainfrom
original4422:codex/issue-95840
Sep 20, 2026
Merged

fuller-stack-dev merged 9 commits into
openclaw:mainfrom
original4422:codex/issue-95840

Conversation

@original4422

@original4422 original4422 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #95840

What Problem This Solves

Fixes stale tool results remaining in OpenAI requests after the configured cache-TTL idle gap.

User Impact

Official OpenAI routes can prune expired tool-result context when contextPruning.mode is cache-ttl. Explicit opt-out remains authoritative; custom proxy routes remain unchanged unless explicitly opted in with compat.supportsPromptCacheKey: true.

Why This Change Was Made

The provider eligibility hook receives the same bounded route and capability facts for pruning setup and cache-touch recording. It does not receive the full model, headers, or extra request parameters. The repair preserves original contributor ancestry and keeps the existing Anthropic/Google behavior.

Evidence

  • Full build and native changed-file checks passed on the candidate integrated with main 42dcea5312ff. Final documentation and timeout-test additions also passed exact-tree formatting, affected native typechecking, and targeted lint.
  • 105 focused tests passed, covering route selection, disabled-pruning lazy loading, bounded hook context, compaction/timeout controls, and persisted projections.
  • Four real API routes passed before/after-TTL and fresh-process replay through the actual embedded runner: Platform, explicit opt-out, real-forwarding proxy unopted, and real-forwarding proxy opted in. Only synthetic data was used.
  • Offline Codex eligible and explicit-opt-out routes passed through actual production owner/catalog selection, request construction, both changed consumers, and durable replay, using synthetic auth and transport-only response simulation with egress blocked.
  • A source-bound baseline restoring the original eligibility helper reproduced the after-idle failure against the real API; the exact candidate bytes were restored afterward. All diagnostics and baselines are included in the 23-call cumulative total.
  • Independent API review found no actionable production-code defect. Its accepted offline payload-provenance finding was fixed; a focused follow-up review passed. The versioned acceptance validator and eight adverse provenance controls pass. The original incomplete report is retained.
  • Exact-public-head required CI passed; this PR merged as e0e6ce7bab919a9e37079841b6ee399cb90631b8. Later main drift has been mapped separately; runtime evidence is bound to the qualified tree, not claimed as rerun on an untested whole tree.

No live Codex/OAuth-service acceptance, provider cache hit, or billing savings is claimed. Offline response simulation is distinct from the four real API routes.

Original contribution: Daniel Peng (@original4422); contributor commit ancestry is preserved.

AI-assisted: yes — implementation, qualification, and independent API review used Codex.

Inspectable runtime evidence

Qualified production tree: ffaf1aa28b5005f0d11bb070d85389a281c1d9b1 (integrated main 42dcea5312ff). Published head 29e7d34c281358d1f77acd6ad175684af5b9a642 has that identical tree; the publication commits only preserve contributor/main ancestry. These are excerpts from the existing source-bound run journals, not newly executed calls.

The task-private fixture ran the real runEmbeddedAgent, production provider registration/serialization, supported exec SecretRef resolution, and durable SQLite session reload. It seeded synthetic old/fresh tool outputs into an existing session, with contextPruning: { mode: "cache-ttl", ttl: "250ms" }. Each replay phase started a fresh process. The four live lanes used Platform Responses (gpt-4.1-mini); the proxy really forwarded to Platform.

The table is computed from actual requests[0].body.input[].output strings and persisted custom entries, not the journal's pass flags. 6377 is the complete synthetic old tool result; 3086 is its real trimmed request projection. Every phase retained the exact fresh output SYNTHETIC_FRESH_PR127992, and every durable source transcript still contained SYNTHETIC_OLD_MIDDLE_PR127992.

Route Before / after / restart old-output characters Old middle before / after / restart Cache-touch markers before / after / restart Live service?
platform 6377 / 3086 / 3086 present / absent / absent 1 / 2 / 3 Yes, HTTP 200 each phase
optout 6377 / 6377 / 6377 present / present / present 0 / 0 / 0 Yes, HTTP 200 each phase
proxy-unopted 6377 / 6377 / 6377 present / present / present 0 / 0 / 0 Yes, HTTP 200 each phase
proxy-opted 6377 / 3086 / 3086 present / absent / absent 1 / 2 / 3 Yes, HTTP 200 each phase
codex-offline 6377 / 3086 / 3086 present / absent / absent 1 / 2 / 3 No: offline transport simulation
codex-optout-offline 6377 / 6377 / 6377 present / present / present 0 / 0 / 0 No: offline transport simulation

Literal Platform projection / durable-marker excerpt

Repeated alpha/beta filler is omitted below and marked as an excerpt. The trimming annotation and fresh output are literal transport-body strings. No auth, private endpoints, local paths, request instructions or personal data are included.

platform/before  at=2026-09-20T03:00:07.432Z  HTTP=200
  request_id=req_18818147f0854c36935656e4ab0b962c
  response_id=resp_04785701b084e5a1006aaf4c3b65fc87d1abb9f32f6ab439b1
  request_body_sha256=3d179ffd5ad66621d98adf73c5f8c0547bcfed7fcaed8d0c08787708709de032
  old_output_chars=6377
  old_output_middle_excerpt="alpha SYNTHETIC_OLD_MIDDLE_PR127992 beta "
  fresh_output="SYNTHETIC_FRESH_PR127992"
  persisted_cache_touches=[{"customType":"openclaw.cache-ttl","timestamp":1789873212290,"provider":"openai"}]
platform/after  at=2026-09-20T03:01:06.950Z  HTTP=200
  request_id=req_b022d6bb2f56406c8aa5527d587fa01e
  response_id=resp_0104079c54b7b1fc006aaf4c784b4487d1b07c1a1f79627405
  request_body_sha256=0e1727571fd2fd5e6ea84fae813f90bcf40da6da4c78a181430e8bdcc1e88eb3
  old_output_chars=3086
  old_output_tail="[Tool result trimmed: kept first 1500 chars and last 1500 chars of 6377 chars.]"
  idle_since_previous_ms=56588
  fresh_output="SYNTHETIC_FRESH_PR127992"
  persisted_cache_touches=[{"customType":"openclaw.cache-ttl","timestamp":1789873212290,"provider":"openai"},{"customType":"openclaw.cache-ttl","timestamp":1789873273027,"provider":"openai"}]
platform/replay  at=2026-09-20T03:02:16.550Z  HTTP=200
  request_id=req_7a3cb4960afa46ab9cc9a44f33f228d8
  response_id=resp_018869953db4d0d6006aaf4cbc9db487d1802fc37e99496493
  request_body_sha256=912ff13882b27d6e91349519a117e60f9fbbf47007fc14cea6925a61171fb699
  old_output_chars=3086
  old_output_tail="[Tool result trimmed: kept first 1500 chars and last 1500 chars of 6377 chars.]"
  idle_since_previous_ms=65921
  fresh_output="SYNTHETIC_FRESH_PR127992"
  persisted_cache_touches=[{"customType":"openclaw.cache-ttl","timestamp":1789873212290,"provider":"openai"},{"customType":"openclaw.cache-ttl","timestamp":1789873273027,"provider":"openai"},{"customType":"openclaw.cache-ttl","timestamp":1789873341277,"provider":"openai"}]

Real-route counterexamples and baseline

Route/phase Request ID Actual old projection Durable cache markers
optout/after req_c4c67900b3e9463d9c32bb614704af84 6377 chars; middle present 0
proxy-unopted/after req_89ab61018a354d0c98c37582d015b46c 6377 chars; middle present 0
proxy-opted/after req_8d1a8852a9414b08ab35493922378c6b 3086 chars; middle absent 2
platform-baseline/before req_1eed7becef1f4468af6da9f57a991e56 6377 chars; middle present 0
platform-baseline/after req_6287b4cea1454b8c8bc01a588af977e6 6377 chars; middle present 0

The baseline replaced only the eligibility helper with its exact original bytes from aac3b2773c7f, used the same real runner and service, and retained the old middle after the TTL gap with no cache touches. The expected after-idle assertion failed; the exact candidate helper was restored in finally. No baseline or diagnostic call is omitted from the 23-request cumulative total.

Provenance and limits

  • Offline Codex exercised the canonical openai owner, actual production request construction and both changed consumers, with synthetic auth and all network egress blocked. The local service response was simulated. Native zstd codec input/output and actual compressed fetch bytes were captured independently; hashes, decoded bodies and eight adverse mutation controls were verified. This is not live Codex/OAuth service evidence.
  • Independent API review found no actionable production finding. Its sole accepted evidence-provenance finding was repaired; the focused follow-up passed with no findings. Original incomplete review retained.
  • The versioned route-specific validator passed. No provider cache hit or billing savings is claimed. Actual qualification usage including diagnostics/baselines: 23 requests, 97,517 input tokens, 69 output tokens.
  • Exact-public-head CI passed: CI run. Native review validated the same head/tree and guarded preparation passed; the PR is now merged.
Journal SHA-256 bindings for the excerpts
JOURNAL-platform-before.json 3e4acee8695d478339b5aa771ef2581014fa375ca31874ee9bbe16ea9ac502fc
JOURNAL-platform-after.json 6dd4387535bca962d4ece716a4bcd1fe294256b86391ade9788db5cc2427858a
JOURNAL-platform-replay.json 08d554050c12c712e2fbf123bbc8cee4712f05559e949bcd6a9ada914c3c3550
JOURNAL-optout-before.json 9a9c56512a1742c77b386a540e9e09397b3fe831a0edd2fe4eddb1404ebbbf6c
JOURNAL-optout-after.json 9319d728fbb1e3a73330521ee569df283e9af73e777d58fb4d5de00d1a0bb75e
JOURNAL-optout-replay.json d2213e0cc55763c0a24bb3a295dcf67a45762b7d88042807ba61a0d1e7aab30b
JOURNAL-proxy-unopted-before.json c9d5411c3cc132ba45d11d5480714ec47ac689c5844ddfce5cfd266d2cb61a85
JOURNAL-proxy-unopted-after.json 09c7b8c504a44ea1bbc4d785fe3993931928c5d440c7bc2f9f22caaf3c04b068
JOURNAL-proxy-unopted-replay.json 02b47fc3bcb2afdd789bce5f284eedbf31178bdd64d4b591870c50ff034a84fa
JOURNAL-proxy-opted-before.json 478fc8cc4197890253a4ac7f4becf71cc9e780c248daa6eb0910a50726131444
JOURNAL-proxy-opted-after.json 2bce6ae6ab3747e1bc3325a037fd75858d459ad8afe6fbbd81fd8979a411f396
JOURNAL-proxy-opted-replay.json b67d0c6e2b303bb645eadda87f2c7dd5b14b0d955bf8589d739a22c18319510c
JOURNAL-codex-offline-before.json 52377a057be16dd2f51ac1d88d25cf7237a64ebc2954b4a2e39fe3d3d4b2f128
JOURNAL-codex-offline-after.json ba2c8670466ff8cf6a73c32c09efac0c3f5535d5d0e5fdd35f41a8a142ec40eb
JOURNAL-codex-offline-replay.json 15a73abb232e998cbd20dcbca36cccbd6d0ec2e4e096d06b5320a09a7be23fb3
JOURNAL-codex-optout-offline-before.json 0dbc88deb0693996eaac7055ddc1e1abcdf3a19c10c8deb4636f8af359095f4c
JOURNAL-codex-optout-offline-after.json 8e0f607924db419fe7c36f54fe2ca9e71cd7c4dc70a6d5719cc4f591ab7414a5
JOURNAL-codex-optout-offline-replay.json 44ca051b942dd5f28be4ad69aa0705075a5138daba3c5efe2b7f6a1bf1ba1a54
JOURNAL-platform-baseline-before.json f0a60098475ff444bd7956140d57a0355f38da0c8b596492e047e68cfb65cc9d
JOURNAL-platform-baseline-after.json 75320ae0b75cebc571b7e122c291f5594a568323cc86fc42eb72f259335d45a9

Maintainer contract and upgrade disposition

Accepted for this scoped repair: add the two optional, bounded provider-hook facts (baseUrl and supportsPromptCacheKey) and enable the existing configured cache-TTL behavior for eligible official OpenAI embedded routes. The existing provider hook is the owner; no new pruning mode, configuration option, default, transcript format, or retention policy is introduced.

This is an intentional support expansion, not a claim that released OpenAI pruning already worked. An existing global contextPruning.mode: "cache-ttl" configuration (including an earlier seeded configuration) can now shorten eligible OpenAI tool-result request projections after the configured idle/size thresholds. Original transcript entries remain intact, as the persisted-source checks above verify. Explicit supportsPromptCacheKey: false remains authoritative, custom proxies stay ineligible without explicit true, and disabled-pruning, compaction/timeout, Anthropic/Google and fresh-output controls remain covered.

The compatible hook extension and this bounded upgrade effect are the selected implementation disposition for the assigned repair-and-land work. No live Codex/OAuth service acceptance is inferred from the offline lane.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@original4422
original4422 marked this pull request as ready for review August 22, 2026 17:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50e697f56a

ℹ️ 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".

Comment thread extensions/openai/openai-provider.ts Resolved
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 20, 2026, 12:16 AM ET / 04:16 UTC (Revision 10).

ClawSweeper review

What this changes

The PR enables configured idle-time pruning of old OpenAI tool results using resolved endpoint and cache capability facts, with proxy opt-in, explicit opt-out, tests, and SDK documentation.

Merge readiness

⛔ Blocked before merge - 4 items remain

This remains useful work: current main and the latest release still lack OpenAI eligibility. Earlier proxy and OAuth findings are resolved; the public-contract decision and inspectable runtime evidence remain outstanding.

Priority: P2
Reviewed head: 29e7d34c281358d1f77acd6ad175684af5b9a642
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation resolves prior findings, but the reported live results are not yet inspectable.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The updated body reports real embedded-runner Platform/proxy runs before and after TTL plus restart replay, addressing the earlier tests-only limitation. However, no trace or linked report exposes the resulting markers and request projections; the separately simulated ChatGPT route is correctly identified as offline coverage. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The updated body reports real embedded-runner Platform/proxy runs before and after TTL plus restart replay, addressing the earlier tests-only limitation. However, no trace or linked report exposes the resulting markers and request projections; the separately simulated ChatGPT route is correctly identified as offline coverage. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Current main still excludes OpenAI: At fetched main, the OpenAI shared hooks contain no isCacheTtlEligible implementation; the runner fallback covers Anthropic-family and eligible Google routes. The proposed eligibility behavior is therefore still absent.
Latest-release check: The supplied latest release, v2026.9.5, also lacks the OpenAI eligibility hook in its shared provider implementation.
Previous route findings resolved: The current hook recognizes validated Platform and ChatGPT endpoints, honors explicit false, and requires true for custom routes. The registered-provider test matrix exercises these distinctions, including lookalike and invalid endpoints.
Findings None None.
Security None None.

How this fits together

OpenClaw’s embedded runner uses provider eligibility and configured idle time to decide whether old tool results should be shortened before model requests. Existing session markers preserve those projected results across later turns and restarts.

flowchart TD
  A[Resolved model and pruning settings] --> B[OpenAI route eligibility]
  B --> C[Idle and context-size checks]
  C --> D[Projected tool results]
  D --> E[Model request]
  B --> F[Session cache marker]
  F --> D
Loading

Decision needed

Question Recommendation
Should the existing cache-TTL hook accept these two optional route facts and activate pruning for eligible OpenAI embedded sessions under existing global settings? Accept the bounded extension: Approve the optional route facts and documented OpenAI eligibility while retaining explicit opt-outs and the existing projection lifecycle.

Why: The discussion explicitly requests this contract decision, and current behavior does not establish previously supported OpenAI pruning.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The updated body reports real embedded-runner Platform/proxy runs before and after TTL plus restart replay, addressing the earlier tests-only limitation. However, no trace or linked report exposes the resulting markers and request projections; the separately simulated ChatGPT route is correctly identified as offline coverage. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The optional public hook inputs and expanded eligibility need an explicit disposition: existing global cache-ttl settings, including previously seeded settings, can begin shortening old OpenAI tool results after upgrade, although original transcript entries remain intact.
  • Complete next step (P2) - Obtain the hook-contract disposition and attach the existing runtime evidence. Terminal output or redacted logs suffice; screenshots or recordings are welcome when they show the result. Remove keys, IP addresses, private endpoints, and personal data. Updating the PR body should trigger re-review; otherwise ask a maintainer to comment @clawsweeper re-review.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +36, Tests +203, Docs +1. Total +240 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 6 47 11 +36
Tests 4 208 5 +203
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 256 16 +240

Review metrics

Metric Value Why it matters
Public contract 2 optional hook inputs; 0 new configuration options The change extends an existing provider API without introducing another pruning mode.
Production versus tests Production +47/-11; tests +208/-5 Production growth carries bounded route facts through both consumers; tests protect eligibility and marker behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #95840
Summary: This PR implements the linked OpenAI eligibility request; the merged projection-storage work is adjacent and does not replace it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the contract with upgrade evidence (recommended)
    Record acceptance of the optional hook fields and inspect the existing runtime evidence for previously configured sessions and opt-out routes.
  2. Pause eligibility expansion
    Keep the current provider-support boundary until its intended upgrade behavior is settled.

Technical review

Best possible solution:

Approve a bounded provider-owned eligibility contract that preserves proxy opt-outs, configured TTLs, original transcripts, and stable replay through the existing pruning owner.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: an OpenAI embedded session with cache-ttl configured fails the current eligibility gate. This establishes the exclusion, not a historical regression; no runtime execution was performed during this review.

Is this the best way to solve the issue?

Yes, the existing provider hook is the narrowest implementation path; adding a separate pruning mode would duplicate ownership. Acceptance of the expanded support contract remains a maintainer choice.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ad3fc06d6411.

Labels

Label justifications:

  • P2: This addresses a configured context-efficiency workflow without evidence of an urgent runtime or onboarding failure.
  • merge-risk: 🚨 compatibility: The public hook grows and existing global pruning settings gain an effect on previously excluded OpenAI sessions.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The updated body reports real embedded-runner Platform/proxy runs before and after TTL plus restart replay, addressing the earlier tests-only limitation. However, no trace or linked report exposes the resulting markers and request projections; the separately simulated ChatGPT route is correctly identified as offline coverage. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current main still excludes OpenAI: At fetched main, the OpenAI shared hooks contain no isCacheTtlEligible implementation; the runner fallback covers Anthropic-family and eligible Google routes. The proposed eligibility behavior is therefore still absent. (extensions/openai/shared.ts:95, ad3fc06d6411)
  • Latest-release check: The supplied latest release, v2026.9.5, also lacks the OpenAI eligibility hook in its shared provider implementation. (extensions/openai/shared.ts, ec9c1a13db89)
  • Previous route findings resolved: The current hook recognizes validated Platform and ChatGPT endpoints, honors explicit false, and requires true for custom routes. The registered-provider test matrix exercises these distinctions, including lookalike and invalid endpoints. (extensions/openai/shared.ts:102, 29e7d34c2813)
  • Both production consumers use bounded facts: Pruning setup and stream settlement pass the resolved base URL and supportsPromptCacheKey value through the existing eligibility owner. The marker format, projection serializer, compaction exclusions, and original transcript storage are unchanged. (src/agents/embedded-agent-runner/run/attempt-setup.ts:250, 29e7d34c2813)
  • Public hook acceptance remains unresolved: Two optional fields extend ProviderCacheTtlEligibilityContext. Contributor comments explicitly request acceptance of this contract; the supplied discussion and live reviews contain no approving disposition. Existing global cache-ttl configurations would now also affect eligible OpenAI embedded sessions. (src/plugins/provider-transport.types.ts:152, 29e7d34c2813)
  • Updated proof claims inspected: The complete captured body, identified by context sourceRevision ccc4e76a9721784d7db2cf1049dd454ba8bd97f8aa5f853da8af3f67b8e3e50a, reports four real API routes, fresh-process replay, a failing baseline, and separately simulated ChatGPT transport coverage. The live body matches it. Neither body nor available human comments supplies the referenced reports, request traces, marker output, or artifact links; the supplied proof directory contains no files. These are relevant execution claims, but the observed pruning results cannot yet be inspected. (29e7d34c2813)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Link or paste the existing redacted runtime traces showing marker creation, post-idle request pruning, opt-out behavior, and restart replay; identify the qualified candidate.
  • Record the maintainer’s disposition of the optional hook inputs and expanded OpenAI eligibility.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-22T18:30:08.695Z sha 07924b8 :: needs real behavior proof before merge. :: [P1] Preserve the linked OAuth cache-TTL path
  • reviewed 2026-08-23T06:43:36.557Z sha 07924b8 :: needs real behavior proof before merge. :: [P1] Preserve cache-TTL eligibility for OpenAI OAuth
  • reviewed 2026-08-23T07:35:26.287Z sha 07924b8 :: needs real behavior proof before merge. :: [P1] Preserve cache-TTL eligibility for OpenAI OAuth
  • reviewed 2026-08-23T19:08:01.628Z sha d9a4814 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-24T23:40:39.088Z sha d9a4814 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-29T18:22:42.415Z sha d9a4814 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-03T09:12:32.521Z sha d9a4814 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-03T11:51:59.757Z sha f24620c :: needs real behavior proof before merge. :: none

@original4422

Copy link
Copy Markdown
Contributor Author

Hi maintainers — could you please rerun the failed CI jobs for exact head 07924b82ced4e4e8bbe821e7a503abcf01e4db5a?

The only primary failure is checks-node-compact-large-6; openclaw/ci-gate is derivative. The failure is the unrelated src/audit/audit-event-writer.test.ts timing assertion at 251.775 ms against a 250 ms limit; this PR does not touch the audit code. The exact-head focused suites and type checks for the OpenAI/cache-TTL changes pass. This contributor account cannot rerun upstream Actions jobs because GitHub requires repository admin rights.

Thank you.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 23, 2026
@original4422

Copy link
Copy Markdown
Contributor Author

Addressed the current OAuth route finding in d9a4814f8b0a7157b966db225e3f7f74379859f9.

  • Added the exact openai-chatgpt-responses + https://chatgpt.com/backend-api/codex case to both the OpenAI owner matrix and generic runner matrix.
  • The existing endpoint classifier now treats its validated official ChatGPT/Codex route like the Platform route for cache-TTL eligibility. Explicit supportsPromptCacheKey: false still wins, and custom/unresolved/invalid routes are not widened.
  • RED: each focused matrix failed only the new OAuth row (expected true, received false) on 07924b82.
  • GREEN: node scripts/run-vitest.mjs extensions/openai/index.test.ts extensions/openai/openai-provider.test.ts src/agents/embedded-agent-runner/cache-ttl.test.ts src/agents/embedded-agent-runner/run/attempt-context-guards.test.ts src/agents/embedded-agent-runner/run/attempt.spawn-workspace.cache-ttl.test.ts src/agents/embedded-agent-runner/tool-result-truncation.cache-ttl.test.ts passed 4 shards, 6 files, 130 tests.
  • oxfmt, oxlint, git diff --check, and tsconfig.extensions.json passed. The two test-project tsgo reruns were stopped when the shared workspace approached its 20 GiB storage reserve; I did not install dependencies or claim those interrupted reruns as passing.

The PR body now carries the updated route matrix, cumulative LOC, validation, and the unchanged credentialed-live-proof limitation. No direct OpenAI or ChatGPT/Codex OAuth credential was available, so no live call is claimed.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @steipete — when you have a chance, could you please review this PR’s OpenAI/ChatGPT prompt-cache-key TTL handling and let me know if any changes are needed or if it is ready to merge? Thanks!

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @vincentkoc — this PR is still ready for review, and there have been no maintainer updates since my last follow-up. When you have a chance, could you please take a look and let me know whether it can be merged or if anything else is needed? Thank you.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @vincentkoc, when you have a chance, could you please take another look and let me know whether this is ready to merge or needs any changes? Thank you.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Sep 3, 2026
@original4422

Copy link
Copy Markdown
Contributor Author

Updated exact head f24620c8219c74cf498d9398206a023128047bda with a non-rewriting current-main merge refresh. The resolution preserves main’s cache-TTL projection state and server-side clearing while retaining the provider-owned route/capability eligibility fix.

Validation on the merged result: 4 Vitest shards / 6 files / 138 tests passed; the targeted check:changed plan passed all core, core-test, extension, and extension-test type/lint/guard lanes; cumulative diff check passed; final branch autoreview was clean (patch is correct, 0.99). I updated the PR body with the exact evidence. The previously disclosed credentialed direct OpenAI/ChatGPT OAuth runtime proof remains unavailable and is not claimed.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @vincentkoc, when you have a chance, could you please check the proposed provider-hook contract and advise what remains before merge? The real provider-session proof is still unavailable, as disclosed in the PR. Thank you.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @vincentkoc, could you please check whether the optional baseUrl and supportsPromptCacheKey inputs are acceptable for the public provider cache-TTL hook? The identified merge conflict and real provider-session proof remain unresolved, so I am not claiming this is ready to merge. Your guidance on the contract would help determine the next step. Thank you.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @steipete, could you please check whether the optional baseUrl and supportsPromptCacheKey inputs are acceptable for the public provider cache-TTL hook, and advise what remains before merge? The current-main conflict and real provider-session proof remain unresolved. Thank you.

@original4422

Copy link
Copy Markdown
Contributor Author

Hi @steipete, when you have a chance, could you please check the optional baseUrl / supportsPromptCacheKey public hook inputs and advise the next step toward merge? The current-main conflict, real provider-session proof, and safe local validation route remain unresolved. Thank you.

@fuller-stack-dev fuller-stack-dev self-assigned this Sep 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This assigned pull request has been automatically marked as stale after being open for 27 days.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 19, 2026
Preserve the contributor branch and retained main merge while carrying the
source-bound route eligibility repair, regression tests, and SDK documentation.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M and removed size: S labels Sep 20, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Sep 20, 2026
@fuller-stack-dev
fuller-stack-dev merged commit e0e6ce7 into openclaw:main Sep 20, 2026
243 of 244 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 21, 2026
* fix(openai): enable cache-TTL context pruning

* fix(openai): gate cache ttl by resolved route

* fix(openai): include OAuth route in cache ttl

* test(agents): align cache ttl coverage with projection state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: openai merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

2 participants