Skip to content

fix(ai): reshape+restore non-canonical tool-call ids for HTTP continuation - #134425

Merged
Patrick-Erichsen merged 29 commits into
openclaw:mainfrom
hartmark:fix/openai-responses-continuation-noncanonical-call-id
Sep 29, 2026
Merged

Patrick-Erichsen merged 29 commits into
openclaw:mainfrom
hartmark:fix/openai-responses-continuation-noncanonical-call-id

Conversation

@hartmark

@hartmark hartmark commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Continuation replay re-sanitizes tool-call ids for provider compatibility (normalizeOpenAIResponsesToolCallIds in embedded-agent-helpers), so a function_call's call_id the client echoes back on round N+1 never matched the raw call_id the continuation resolver cached straight from the provider's own response on round N — for any provider whose native tool-call ids aren't already call_*/fc_*-shaped (e.g. Kimi K2, OpenRouter-style ids). Every such multi-round tool-calling turn permanently missed continuation and resent the whole conversation history on the next round.

Split out of #128910 (see that PR's history for the full trace); this is the raw-ID reshape/restore half.

Why This Change Was Made

canonicalizeToolCallId reshapes both sides of the comparison through the exact same transform replay applies (normalizeOpenAIResponsesFunctionCallId, pairing call_id with the item's own id first), and only treats the ids as equal when they canonicalize to the same value — fail-closed for an unrelated id change. The wire-bound delta then gets the raw provider call_id restored (restoreRawCallIdsInDelta) before it's sent, so a server that reconstructs continuation history from its own cached copy of the raw response still sees a function_call_output whose call_id matches the function_call it cached, instead of an orphaned id it silently drops.

Two replay shapes besides the agent-reshaped one needed the same treatment, both caught by review and now covered:

  • A direct Responses transport caller that preserves same-model tool-call ids verbatim replays the unchanged raw call_id/id pair — now canonicalizes to the same value as the cached side.
  • A connection configured with replayResponsesItemIds:false (e.g. ChatGPT-Responses) omits function_call.id from the wire entirely while keeping the raw call_id — the comparison now accepts either the paired or the id-less canonical form as "unchanged."

Depends on #128633 (compat.supportsResponsesContinuation), merged into main on September 15 — that's what makes this reshape+restore path reachable at all, on a compat/proxy endpoint.

Evidence

  • Unit regression coverage: unchanged agent-reshaped pair, unchanged raw pair, raw pair with the item id omitted, and a genuinely different id correctly still forcing a full resend.
  • openai-responses-client.continuation-noncanonical-id.integration.test.ts: real loopback HTTP+SSE server, no SDK mocking, proves the reshape+restore path end-to-end. Real captured wire output:
    request #2 previous_response_id: resp_1
    request #2 input: [{"type":"function_call_output","call_id":"functions.gateway:0","output":"recorded"}]
    
    (call_id above is the restored raw id, not the internal reshaped one.)
  • src/agents/embedded-agent-helpers/openai.test.ts (the real normalizeOpenAIResponsesToolCallIds suite this fix mirrors): 10/10.
  • Full packages/ai/src/transports/ suite green.

Production LOC

reviewMetrics: production net +335 lines (82 pure-move lines discounted); tests net +1002. The 82-line move from src/agents/embedded-agent-helpers/openai.ts places ID shaping in a shared helper because packages/ai cannot import from src/agents. The remaining growth keeps raw call ownership across superseding responses, verifies earlier call/result identities before dropping cached history, and rebuilds pending owners after a full-history retry. The existing state only records the latest response, so it cannot represent unresolved calls across response turns; the extra state and owner checks live in the shared resolver used by HTTP and WebSocket.

Landing follow-up

  • Applied the latest ClawSweeper findings and Rank-up move: replayed calls/results must retain their cached owner, and unknown or ambiguous delta IDs fall back to full history before dispatch. Added regressions for earlier-history edits, colliding replay shapes, pending async calls across later responses, full-history retry ownership, and reused IDs.
  • The loopback HTTP+SSE integration test exercises the production transport path. A live OpenRouter continuation was attempted, but its Responses proxy returns HTTP 400 saying previous_response_id is unsupported; this endpoint cannot provide successful continuation proof. No other configured live endpoint supports this test.
  • Exact-head GitHub CI for dc1089e582ddfeded61be4398b858a96dbe6ca90 is running: https://github.com/openclaw/openclaw/actions/runs/36505192016. The required openclaw/ci-gate remains pending until all checks complete.

@clawsweeper

clawsweeper Bot commented Aug 31, 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 9:02 PM ET / September 29, 2026, 01:02 UTC (Revision 22).

ClawSweeper review

What this changes

The branch changes OpenClaw’s Responses transport to recognize reshaped tool-call IDs, restore raw provider IDs in continuation requests, and track unresolved calls across responses.

Merge readiness

⛔ Blocked before merge - 1 item remains

Current main and the latest release still compare the replayed tool-call ID with the provider’s raw ID, so this PR retains a distinct fix. The earlier collision and call-ownership findings appear addressed at this head. No new blocking defect was established.

Priority: P2
Reviewed head: dc1089e582ddfeded61be4398b858a96dbe6ca90

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The transport-boundary trace and focused regressions support a useful repair; the unavailable full pinned diff limits this review’s exhaustiveness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The production Responses transport sent a second request to a real loopback HTTP/SSE server after a noncanonical tool call and replay reshape; the posted trace shows previous_response_id with the restored raw call ID. The test applies the agent replay transform by hand, so it does not establish success on the unavailable live proxy. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The production Responses transport sent a second request to a real loopback HTTP/SSE server after a noncanonical tool call and replay reshape; the posted trace shows previous_response_id with the restored raw call ID. The test applies the agent replay transform by hand, so it does not establish success on the unavailable live proxy. No stored-data contract changes.
Evidence reviewed 7 items Current main retains the reported mismatch: The current-main resolver compares replayed input with cached provider output without the branch's tool-call ID canonicalization and restoration.
Branch implementation: The resolver matches cached raw and replayed ID shapes, rejects ambiguous owners, and restores the provider's raw call ID before dispatching a continuation delta.
Transport-boundary proof: The test uses the production Responses transport and a loopback HTTP/SSE server. It applies the replay ID transform to a noncanonical call and checks that request two carries previous_response_id and the raw provider call ID. The contributor also posted the observed request trace in the PR discussion.
Findings None None.
Security None None.

How this fits together

The Responses transport turns agent conversation history into provider requests. Its continuation resolver decides whether to send only new input with a previous response ID or resend full history.

flowchart LR
A[Agent history] --> B[Replay tool IDs]
B --> C[Continuation resolver]
D[Cached provider response] --> C
C --> E{History and call owner match?}
E -->|Yes| F[Raw-ID delta request]
E -->|No| G[Full-history request]
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
Agent review details

Security

None.

PR surface

Source +335, Tests +1002. Total +1337 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 443 108 +335
Tests 3 1063 61 +1002
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 1506 169 +1337

Review metrics

Metric Value Why it matters
Production and test growth production net +335 lines; tests net +1002 lines The production growth is explained by shared ID shaping and ownership tracking across response turns; the tests exercise collision and fallback cases.

Technical review

Best possible solution:

Retain one continuation resolver for HTTP and WebSocket, with raw provider IDs restored only when a replayed result has one unambiguous cached call owner.

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

Yes at source level: current main compares replayed and cached IDs in their different forms. The branch’s loopback trace exercises the resulting transport behavior; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The change stays in the shared continuation resolver and falls back to full history when a call owner is unknown or ambiguous.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The fix improves multi-round continuation for compatible providers, with limited scope and no demonstrated urgent user outage.
  • merge-risk: 🚨 session-state: The patch changes how unresolved tool-call owners are carried across responses, where a mismatch could associate a result with the wrong call.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The production Responses transport sent a second request to a real loopback HTTP/SSE server after a noncanonical tool call and replay reshape; the posted trace shows previous_response_id with the restored raw call ID. The test applies the agent replay transform by hand, so it does not establish success on the unavailable live proxy. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The production Responses transport sent a second request to a real loopback HTTP/SSE server after a noncanonical tool call and replay reshape; the posted trace shows previous_response_id with the restored raw call ID. The test applies the agent replay transform by hand, so it does not establish success on the unavailable live proxy. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • hartmark: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T21:07:46.022Z sha bc95610 :: blocked before merge. :: [P2] Reject changed raw IDs that normalize to the cached call
  • reviewed 2026-09-28T21:24:56.296Z sha 84d65f3 :: blocked before merge. :: [P2] Reject distinct raw IDs that normalize to the cached call
  • reviewed 2026-09-28T21:34:47.789Z sha 84d65f3 :: blocked before merge. :: [P2] Reject distinct raw IDs that normalize to the cached call
  • reviewed 2026-09-28T21:59:49.374Z sha a717c7c :: blocked before merge. :: [P2] Preserve raw call identity when comparing cached history | [P2] Reject unmatched and ambiguous tool-output IDs
  • reviewed 2026-09-28T23:18:16.171Z sha 016392f :: blocked before merge. :: [P2] Preserve raw IDs in the previously sent history prefix
  • reviewed 2026-09-29T00:14:35.838Z sha ddcc731 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T00:23:55.066Z sha 918131b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T00:44:06.660Z sha fdb8868 :: needs maintainer review before merge. :: none

@hartmark
hartmark force-pushed the fix/openai-responses-continuation-noncanonical-call-id branch from 3f41f58 to 5f764c8 Compare September 1, 2026 11:35
hartmark added a commit to hartmark/openclaw that referenced this pull request Sep 1, 2026
…ation (blocked on openclaw#128633) (openclaw#134425)

Combined-deploy squash of openclaw#134425. See that PR for the
full commit history, review discussion, and live-verification evidence.
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Sep 16, 2026
@hartmark
hartmark force-pushed the fix/openai-responses-continuation-noncanonical-call-id branch from 5f764c8 to cec8866 Compare September 17, 2026 00:35
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Sep 17, 2026
… for eligibility

normalizeOpenAIResponsesToolCallIds re-sanitizes call_id for provider-format
compatibility on replay, which previously made the eligibility check either
reject every multi-round tool-calling turn (blanket compare) or, after a
prior loosening, blanket-drop call_id from the comparison entirely -- letting
an unrelated changed function-call id through as if it were the known reshape,
and shipping the client's reshaped call_id instead of the raw provider id on
the wire delta. A server that reconstructs continuation history server-side
from its own cached raw response (e.g. a proxy virtualizing previous_response_id)
pairs function_call_output against the function_call it cached verbatim, so
the reshaped call_id reads as orphaned and the tool result gets dropped.

Canonicalize call_id/fc_id through the same reshape for the eligibility
comparison (fail-closed: only forgives ids that reshape TO the cached raw
id, never an arbitrary difference), and restore the raw provider id on the
wire-bound delta before it's sent. Also fixes a lossless-integer gap in the
arguments comparison (distinct unsafe integers could round to the same JS
number under plain JSON.parse and wrongly compare equal).
…inuation eligibility

Replay reshapes a function_call's id by pairing call_id and item id into
one call_id|fc_id string before hashing (normalizeOpenAIResponsesToolCallIds).
The continuation eligibility comparison and the raw-id restore path only
canonicalized the cached response's bare call_id, ignoring its paired item
id, so they hashed a different input than replay actually produced and
permanently returned history_changed for any turn whose provider ids needed
reshaping.

Reconstruct the same call_id|item_id pairing from the cached raw response
before canonicalizing, mirroring the exact idempotent short-circuit replay's
own resolver uses so already provider-shaped ids are left unchanged.
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Sep 28, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit 906dccd into openclaw:main Sep 29, 2026
246 checks passed
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…ation (openclaw#134425)

* fix(ai): restore raw call_id on continuation wire delta, canonicalize for eligibility

normalizeOpenAIResponsesToolCallIds re-sanitizes call_id for provider-format
compatibility on replay, which previously made the eligibility check either
reject every multi-round tool-calling turn (blanket compare) or, after a
prior loosening, blanket-drop call_id from the comparison entirely -- letting
an unrelated changed function-call id through as if it were the known reshape,
and shipping the client's reshaped call_id instead of the raw provider id on
the wire delta. A server that reconstructs continuation history server-side
from its own cached raw response (e.g. a proxy virtualizing previous_response_id)
pairs function_call_output against the function_call it cached verbatim, so
the reshaped call_id reads as orphaned and the tool result gets dropped.

Canonicalize call_id/fc_id through the same reshape for the eligibility
comparison (fail-closed: only forgives ids that reshape TO the cached raw
id, never an arbitrary difference), and restore the raw provider id on the
wire-bound delta before it's sent. Also fixes a lossless-integer gap in the
arguments comparison (distinct unsafe integers could round to the same JS
number under plain JSON.parse and wrongly compare equal).

* fix(ai): canonicalize cached call_id with its paired item id for continuation eligibility

Replay reshapes a function_call's id by pairing call_id and item id into
one call_id|fc_id string before hashing (normalizeOpenAIResponsesToolCallIds).
The continuation eligibility comparison and the raw-id restore path only
canonicalized the cached response's bare call_id, ignoring its paired item
id, so they hashed a different input than replay actually produced and
permanently returned history_changed for any turn whose provider ids needed
reshaping.

Reconstruct the same call_id|item_id pairing from the cached raw response
before canonicalizing, mirroring the exact idempotent short-circuit replay's
own resolver uses so already provider-shaped ids are left unchanged.

* fix(test): keep the call_id-reshape test focused on ids, not argument whitespace tolerance

openclaw#134423 landed while this branch was in flight and scoped the lossless
unsafe-integer/whitespace argument comparison to fromResponse (cached,
provider-origin) items only -- replayed arguments are now compared
strictly, byte for byte, since a caller-side edit is meaningful and must
not be silently tolerated (see 'keeps already-sent arguments strict').

This test's fixture had an incidental whitespace difference between the
cached and replayed arguments string, left over from before that
refinement landed -- post-openclaw#134423 that's now a genuine (correct)
history_changed, not the call_id-reshape scenario this test is actually
about. Made the replayed arguments byte-identical to the cached ones (a
real client replay never actually changes them) so the test proves what
its name says: call_id reshaping, not argument tolerance.

* test(ai): add the non-canonical call_id integration test, blocked on openclaw#128633

Real loopback HTTP+SSE server (no SDK mocking) proof for this PR's own
reshape-then-restore mechanism, using a genuinely non-canonical
call_id/id pair shaped like a real moonshotai/kimi-k2.5-via-openrouter
connection would produce -- the only shape that exercises
canonicalizeCachedCallId's reshaping at all (a native api.openai.com
connection already returns canonical call_*/fc_* ids, making the reshape
a permanent no-op there).

describe.skip on this branch: reaching this path requires
compat.supportsResponsesContinuation eligibility widening, which is
openclaw#128633's work, not part of this PR. Confirmed this genuinely passes (not
just theoretically) by copying this file plus this PR's own production
changes onto openclaw#128633's branch checkout, un-skipping, and running it there
-- green. Un-skip for real once this branch stacks on openclaw#128633 (or after
it merges to main).

* fix(ai): clean up rebase fallout (dead helpers, assertion ratchet)

Rebasing this branch onto current main surfaced two check-changed
findings from the conflict resolution:

- Resolving the conflict in embedded-agent-helpers/openai.ts against a
  stale hunk by keeping the wrong side resurrected
  DowngradeOpenAIReasoningBlocksOptions and hasFollowingNonThinkingBlock,
  both already unused on current main and never referenced anywhere in
  this file (the same class of mistake already fixed once on the
  combined deployment branch in ee346ded273). Caught by tsgo's own
  unused-declaration check (TS6196/TS6133).
- The two new type assertions restoreRawCallIdsInDelta introduced in
  openai-responses-continuation.ts pushed that file's uncommented-
  assertion count past its grandfathered ratchet baseline (2 -> 4).
  Added // SAFETY: comments documenting why each cast is sound instead
  of loosening the ratchet.

Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6

* fix(ai): canonicalize the tool-call id pair on both replay and cache, not just the cache

ClawSweeper flagged a real continuation regression: canonicalizeReplayedCallId
reshaped only the bare replayed call_id, while canonicalizeCachedCallId
reshaped the call_id/item.id *pair* on the cached side. A direct Responses
transport caller that preserves same-model tool-call ids verbatim
(transcript-transform.ts's transformMessages same-model branch) replays a
completely unchanged, non-canonical call_id/id pair -- identical to the
cached side in every way -- but the two sides canonicalized to different
hashes for that exact case, permanently forcing history_changed and
resending the whole conversation every round.

Fix: use one canonicalization function (renamed to canonicalizeToolCallId)
for both sides, pairing call_id with the item's own id before reshaping
either way. New regression test proves an unchanged raw pair now continues.

* test(ai): enable the non-canonical call_id integration test now that openclaw#128633 landed

The compat/proxy eligibility widening this test was waiting on
(compat.supportsResponsesContinuation) merged into main; un-skip and drop
the now-stale pre-merge type-cast workaround. Passes for real.

* fix(ai): preserve continuation when replay omits the optional item id

ClawSweeper flagged a real regression from unifying call_id canonicalization
onto always-pair-with-item-id: a direct transport caller configured with
replayResponsesItemIds:false (e.g. the ChatGPT-Responses provider) omits
function_call.id from the wire while preserving its raw, non-canonical
call_id verbatim -- that replayed item structurally has no id to pair with,
so it always canonicalizes via the bare-call_id branch. The cached side
(which always has the full raw pair from the provider's own response) only
ever computed the paired canonicalization, so this legitimate unchanged
replay permanently forced history_changed.

Fix: compare the replayed tool round against two candidate cached-history
shapes -- normally paired with the cached item's own id, or, failing that,
ignoring it entirely -- and accept either as unchanged. Both are real replay
shapes; which one a given connection produces depends on its own
replayResponsesItemIds setting. New regression test proves the omitted-id
case now continues; TDD-verified it fails without the fix.

* test(ai): cover Responses continuation replay identity

* fix(ai): preserve Responses continuation identity

* chore(ai): retain assertion safety rationale

* test(systemd): include first-hop timing helper in fixture

* fix(ai): brace continuation comparison branches

* test(ai): reject Responses ID normalization collisions

* test(ai): cover invalid Responses continuation outputs

* test(ai): cover ambiguous Responses continuation fallback

* fix(ai): reject ambiguous Responses continuation IDs

* test(ai): avoid map spread in Responses fixture

* fix(ai): unify Responses continuation ID ownership

* fix(ai): track Responses continuation call owners

* docs(ai): clarify continuation ID test

* fix(ai): preserve Responses continuation call owners

* fix(ai): preserve pending Responses call order

* fix(ai): match replayed Responses ID shapes

* fix(ai): narrow replayed Responses call ID

* fix(ai): drop unused continuation loop binding

* style(ai): brace Responses continuation guards

---------

Co-authored-by: Patrick Erichsen <[email protected]>
hartmark added a commit to hartmark/openclaw that referenced this pull request Sep 29, 2026
… merge

Main moved again since the last push -- openclaw#134425 (non-canonical
tool-call-ID handling) merged directly into openai-responses-continuation.ts
and its test file, conflicting with this PR's default/cache-bound changes
in the same functions. Reconstructed via GitHub's own PR diff applied
fresh onto current main; hand-merged the three real conflicts (the
90-minute default + capacity/byte-bound eviction logic around Patrick's
new dispatchedPreviousResponseId/recordResponsesContinuationState call
shape in claimOpenAIResponsesHttpContinuation, and the matching test
additions).

Split the growing continuation.test.ts (now over the 700-line ratchet
after merging both PRs' additions) into a new sibling
openai-responses-continuation.cache-bounds.test.ts carrying the
capacity/byte-budget/eviction-order/reclaim-race tests -- new max-lines
suppressions aren't allowed, and this group was already a coherent,
separable unit.

No functional changes to this PR's own default-TTL/cache-bound logic.
Full targeted suite green (73 files, 1205 tests); oxfmt/oxlint clean;
max-lines ratchet and config-doc baseline verified.
Patrick-Erichsen added a commit that referenced this pull request Oct 2, 2026
…d the cache (#128848)

* fix(ai): rebuild onto main after #134425's tool-call-ID-shape merge

Main moved again since the last push -- #134425 (non-canonical
tool-call-ID handling) merged directly into openai-responses-continuation.ts
and its test file, conflicting with this PR's default/cache-bound changes
in the same functions. Reconstructed via GitHub's own PR diff applied
fresh onto current main; hand-merged the three real conflicts (the
90-minute default + capacity/byte-bound eviction logic around Patrick's
new dispatchedPreviousResponseId/recordResponsesContinuationState call
shape in claimOpenAIResponsesHttpContinuation, and the matching test
additions).

Split the growing continuation.test.ts (now over the 700-line ratchet
after merging both PRs' additions) into a new sibling
openai-responses-continuation.cache-bounds.test.ts carrying the
capacity/byte-budget/eviction-order/reclaim-race tests -- new max-lines
suppressions aren't allowed, and this group was already a coherent,
separable unit.

No functional changes to this PR's own default-TTL/cache-bound logic.
Full targeted suite green (73 files, 1205 tests); oxfmt/oxlint clean;
max-lines ratchet and config-doc baseline verified.

* refactor(ai): simplify bounded continuation ownership and strengthen proof

* fix(plugins): queue compatibility removals pending reader migration

---------

Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…d the cache (openclaw#128848)

* fix(ai): rebuild onto main after openclaw#134425's tool-call-ID-shape merge

Main moved again since the last push -- openclaw#134425 (non-canonical
tool-call-ID handling) merged directly into openai-responses-continuation.ts
and its test file, conflicting with this PR's default/cache-bound changes
in the same functions. Reconstructed via GitHub's own PR diff applied
fresh onto current main; hand-merged the three real conflicts (the
90-minute default + capacity/byte-bound eviction logic around Patrick's
new dispatchedPreviousResponseId/recordResponsesContinuationState call
shape in claimOpenAIResponsesHttpContinuation, and the matching test
additions).

Split the growing continuation.test.ts (now over the 700-line ratchet
after merging both PRs' additions) into a new sibling
openai-responses-continuation.cache-bounds.test.ts carrying the
capacity/byte-budget/eviction-order/reclaim-race tests -- new max-lines
suppressions aren't allowed, and this group was already a coherent,
separable unit.

No functional changes to this PR's own default-TTL/cache-bound logic.
Full targeted suite green (73 files, 1205 tests); oxfmt/oxlint clean;
max-lines ratchet and config-doc baseline verified.

* refactor(ai): simplify bounded continuation ownership and strengthen proof

* fix(plugins): queue compatibility removals pending reader migration

---------

Co-authored-by: Patrick Erichsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants