Skip to content

fix: retain model budgets for durable context-engine turns - #142871

Merged
jalehman merged 2 commits into
openclaw:mainfrom
Marvinthebored:fix/durable-context-engine-model-budget
Sep 11, 2026
Merged

jalehman merged 2 commits into
openclaw:mainfrom
Marvinthebored:fix/durable-context-engine-model-budget

Conversation

@Marvinthebored

@Marvinthebored Marvinthebored commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #142870

What Problem This Solves

Fixes an issue where users of durable context engines could get premature compaction because accepted turns lost the model's resolved context window and token budget. For example, a context engine used its 128,000-token fallback during post-turn processing despite a 1,000,000-token inference window.

Why This Change Was Made

Carry the resolved provider, model ID, context window, and token budget through the existing durable turn payload into commitTurn.runtimeContext. Native, plugin-harness, and CLI producers provide these facts. Accepted-turn recovery and retries preserve them.

Only these four primitive model facts are persisted, not live capabilities, credentials, or the full runtime configuration. Existing rows without this optional metadata keep their current behavior. No database schema migration is needed.

User Impact

Context engines that accept runtimeContext can use the turn's actual model budget during post-turn processing, including after recovery. This prevents the host from forcing fallback budgets merely by dropping those facts.

Evidence

  • Before the fix, two existing outbox tests failed new assertions because recovered and retried commits lacked runtimeContext. With the fix, all 8 outbox tests passed.

  • Extended existing native-producer and accepted-finalization fixtures to assert a 200,000-token model window and a distinct 180,000-token budget. The lifecycle and finalization suites passed all 12 and 13 tests respectively.

  • Existing CLI-transcript and harness-selection suites also passed. The five selected suites passed all 190 tests on the upstream-based PR branch.

  • Real-engine proof used the OpenClaw durable outbox with the actual local LcmContextEngine. After reconstructing the engine before draining, an older row without metadata used the documented tokenBudget=128000 fallback, while a new row carried tokenBudget=180000, modelContextWindow=200000, provider=anthropic, and model=anthropic/claude-sonnet-4-6; both rows drained successfully. The redacted terminal output was:

    pendingAfterDrain=false retainedRows=[]
    legacy-session: thresholdTokens=96000 tokenBudget=128000 model=none modelContextWindow=none
    new-session: thresholdTokens=135000 tokenBudget=180000 model=anthropic/claude-sonnet-4-6 modelContextWindow=200000
    
  • Core source and all core-test typecheck shards passed on the combined development patch, as did targeted lint and formatting. The broader changed-files gate stopped on an unrelated compatibility-expiry record, also reproduced on the unchanged checkout.

  • Independent adversarial review found no actionable correctness or security issues.

AI-assisted implementation and independent review. Sanitized work log; private session transcripts are not published. The optional persisted payload contract remains explicitly submitted for maintainer acceptance.

@clawsweeper

clawsweeper Bot commented Sep 9, 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: S labels Sep 9, 2026
@Marvinthebored
Marvinthebored marked this pull request as ready for review September 9, 2026 06:05
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 10, 2026, 10:32 PM ET / September 11, 2026, 02:32 UTC (Revision 3).

ClawSweeper review

What this changes

Preserves resolved model identity, native context window, and token budget through durable context-engine commits, including recovery and retries.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains a useful fix: current main and the latest release still omit model metadata from durable commits. No actionable patch defect was found, and the real-engine recovery evidence is sufficient. The previously identified persisted-contract approval remains unresolved.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported repair with meaningful real-engine recovery evidence and no concrete correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied terminal trace exercises OpenClaw's durable outbox with an actual reconstructed LCM engine: legacy and metadata-bearing rows both drain successfully, and the latter produces the expected 180,000-token budget and 200,000-token native window. Source and focused fixtures supplement the producer wiring.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied terminal trace exercises OpenClaw's durable outbox with an actual reconstructed LCM engine: legacy and metadata-bearing rows both drain successfully, and the latter produces the expected 180,000-token budget and 200,000-token native window. Source and focused fixtures supplement the producer wiring.
Evidence reviewed 10 items Current main still needs the fix: Current main constructs commitTurn arguments without runtimeContext; the branch adds the missing metadata to the existing durable handoff.
Latest release also omits metadata: The supplied latest release, v2026.9.3, constructs the same durable commit arguments without runtimeContext. No shipped fix was established.
Default-budget review concern checked against production: The review at #142871 (review) describes contextTokenBudget as an explicit override. Production resolveEmbeddedRuntimeModelPolicy instead supplies resolved.ctxInfo.tokens for OpenClaw-owned model policy; runtime preparation and dispatch carry that value into the attempt. Native-model-owned sessions intentionally retain private policy and omit the host context engine. Removing a field from a hand-built finalization fixture does not reproduce the production default path.
Findings None None.
Security None None.

How this fits together

Context engines prepare and compact an agent’s conversation history. The durable turn outbox stores accepted turns until the selected engine commits them, including after a restart or temporary failure.

flowchart LR
  A[Resolved model facts] --> B[Accepted agent turn]
  B --> C[Durable turn outbox]
  C --> D[Recovery or retry]
  D --> E[Context engine commit]
  E --> F[Budget-aware post-turn processing]
Loading

Decision needed

Question Recommendation
Accept the four optional persisted model facts as the durable commit contract, with legacy rows retaining fallback behavior and older readers omitting the metadata? Accept the additive contract: Record acceptance of the bounded metadata payload and its demonstrated legacy-row behavior.

Why: The implementation and compatibility evidence support the change, but repository policy reserves acceptance of restart-visible persistent semantics for maintainers.

Before merge

  • Resolve merge risk (P1) - The optional persisted metadata changes restart-visible plugin inputs and compaction thresholds. Legacy-row behavior is demonstrated, but maintainer acceptance remains unrecorded; reverting to older code would again omit these facts during recovery and delivery.
  • Complete next step (P2) - Record maintainer acceptance of the four optional persisted model facts, legacy-row fallback, and older-reader behavior before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +42, Tests +50. Total +92 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 42 0 +42
Tests 5 52 2 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 94 2 +92

Review metrics

Metric Value Why it matters
Persisted contract 4 optional primitive facts; 0 schema migrations The compatibility decision concerns restart-visible payload semantics despite an unchanged SQLite schema.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #142870
Summary: This PR is the explicit implementation candidate for the paired model-budget omission report.

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 documented recovery behavior (recommended)
    Approve the optional persisted facts while explicitly retaining fallback for legacy rows and metadata omission under older readers.
  2. Pause for a different compatibility guarantee
    Keep the PR unmerged if maintainers require stronger older-reader or rollback semantics.

Technical review

Best possible solution:

Adopt the existing outbox-based repair with an accepted contract for the four optional model facts, legacy-row fallback, and older-reader behavior.

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

Yes, from source: current main drops resolved model facts before durable commitTurn, including recovery. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Carrying resolved facts through the existing durable payload fixes the owning handoff without a parallel mechanism; the latest commit correctly separates the native window from the effective budget.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Missing model budgets can cause premature compaction for durable context engines, with limited established blast radius.
  • merge-risk: 🚨 compatibility: The PR changes persisted plugin inputs across restart and recovery, requiring explicit acceptance of legacy and older-reader behavior.
  • 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 supplied terminal trace exercises OpenClaw's durable outbox with an actual reconstructed LCM engine: legacy and metadata-bearing rows both drain successfully, and the latter produces the expected 180,000-token budget and 200,000-token native window. Source and focused fixtures supplement the producer wiring.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied terminal trace exercises OpenClaw's durable outbox with an actual reconstructed LCM engine: legacy and metadata-bearing rows both drain successfully, and the latter produces the expected 180,000-token budget and 200,000-token native window. Source and focused fixtures supplement the producer wiring.

Evidence

What I checked:

  • Current main still needs the fix: Current main constructs commitTurn arguments without runtimeContext; the branch adds the missing metadata to the existing durable handoff. (src/agents/harness/context-engine-turn-outbox.ts, 89f364512258)
  • Latest release also omits metadata: The supplied latest release, v2026.9.3, constructs the same durable commit arguments without runtimeContext. No shipped fix was established. (src/agents/harness/context-engine-turn-outbox.ts, 1391f7cd2d40)
  • Default-budget review concern checked against production: The review at fix: retain model budgets for durable context-engine turns #142871 (review) describes contextTokenBudget as an explicit override. Production resolveEmbeddedRuntimeModelPolicy instead supplies resolved.ctxInfo.tokens for OpenClaw-owned model policy; runtime preparation and dispatch carry that value into the attempt. Native-model-owned sessions intentionally retain private policy and omit the host context engine. Removing a field from a hand-built finalization fixture does not reproduce the production default path. (src/agents/embedded-agent-runner/run/setup.ts:263, f8cc0ea9d7c1)
  • Latest commit separates native window from effective budget: The verified head commit passes models.runtime.contextWindow separately from the resolved contextTokenBudget. Native and plugin-harness finalization now use that separate field, and existing fixtures distinguish a 200,000-token native window from a 180,000-token effective budget. (src/agents/embedded-agent-runner/run/runtime-preparation.ts:567, f8cc0ea9d7c1)
  • Existing optional plugin contract remains applicable: commitTurn already accepts ContextEngineRuntimeContext, whose declared fields are optional. Registry projection honors acceptedHostParams for commitTurn, with existing coverage excluding undeclared runtimeContext. A defined runtimeContext has no existing guarantee of live callbacks or every optional field. The modified harness fixtures exercise OpenClaw-owned routing with synthetic harnesses; they do not establish a dependency on the Codex runtime contract. (src/context-engine/types.ts:442, f8cc0ea9d7c1)
  • Persistence and recovery boundary inspected: Accepted and ready payloads serialize through the existing SQLite payload_json column. Recovery forwards runtimeContext, and draining parses the stored payload before calling commitTurn. Existing recovery and retry tests now assert the metadata across these boundaries; older payloads without it remain accepted. (src/agents/harness/context-engine-turn-outbox.ts:467, f8cc0ea9d7c1)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Marvinthebored: 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.

  • Record maintainer acceptance of the optional persisted metadata and its legacy-row and older-reader compatibility contract.

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 (2 earlier review cycles)
  • reviewed 2026-09-09T06:13:55.533Z sha b746877 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-09T07:16:28.703Z sha b746877 :: blocked before merge. :: none

@Marvinthebored

Copy link
Copy Markdown
Contributor Author

Real-engine proof is now included in the PR body. I exercised the OpenClaw durable outbox with the actual local LCM engine after reconstructing it: an older row without runtime metadata drained using the documented 128k fallback, while a new row carried 180k budget, 200k model window, provider, and model ID; both drained with no pending rows.

The remaining decision is intentionally for maintainers: accept the optional restart-visible JSON payload extension, with old rows retaining fallback behavior.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 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 Sep 9, 2026

@Yigtwxx Yigtwxx 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.

I measured this at head b74687746d1. The plumbing is clean and the recovery/retry coverage is genuinely good, but I think the value being carried is the wrong one, and the three producers do not agree on what they are carrying.

1. The persisted tokenBudget is the raw override, not the resolved budget

attempt-finalize.ts:239 and selection.ts:599 write attempt.contextTokenBudget / internalParams.contextTokenBudget straight through. That field is optional (embedded-agent-runner/run/types.ts:166, agent-settings.ts:36) and is only set when an explicit budget override is configured. The number the turn actually ran under is resolved separately:

// src/agents/embedded-agent-runner/run/attempt-history-prepare.ts:186-194
const contextTokenBudget = Math.max(1, Math.floor(
  attempt.contextTokenBudget ??
    attempt.model.contextWindow ??
    attempt.model.maxTokens ??
    DEFAULT_CONTEXT_TOKENS,
));

So in the default configuration - no explicit override - the runtime resolves a budget from the model window, but the durable row records nothing.

Measured on your own fixture. attempt-phase-lifecycle.test.ts passes both model: { contextWindow: 200_000 } and contextTokenBudget: 180_000; I removed only the second line, leaving everything else identical, and reran the suite:

node node_modules/vitest/vitest.mjs run \
  --config test/vitest/vitest.agents-embedded-agent-run.config.ts \
  src/agents/embedded-agent-runner/run/attempt-phase-lifecycle.test.ts
Fixture recorded runtimeContext
as in the PR (12/12 pass) { provider: "test", modelId: "model", modelContextWindow: 200000, tokenBudget: 180000 }
explicit budget removed { provider: "test", modelId: "model", modelContextWindow: 200000, tokenBudget: undefined }

The window survives, the budget does not. For that same attempt the resolved budget is 200,000 by the expression above, so the row records undefined where the runtime resolved a real number, and a consumer with a documented 128,000 fallback still falls back.

That is the case in the problem statement. "A context engine used its 128,000-token fallback during post-turn processing despite a 1,000,000-token inference window" describes a model with a large window; unless that deployment also sets an explicit contextTokenBudget, this change records tokenBudget: undefined for it and the fallback still wins. Every test and the terminal evidence in the body set contextTokenBudget explicitly (180,000), so the default configuration is never exercised.

There is also a contract mismatch on the field itself:

// src/context-engine/types.ts:317-318
/** Runtime-resolved context window budget for the active model call. */
tokenBudget?: number;

The slot is documented as runtime-resolved; the PR writes the unresolved override into it. Passing the same expression attempt-history-prepare.ts computes (or the already-resolved value, if it is reachable at finalize time) would make the field mean what its doc comment says, and would make the fix work without an override.

2. The three producers are mirror images of each other

Field cli-run-transcript.ts:375-380 attempt-finalize.ts:235-240 selection.ts:595-600
provider runParams.modelProvider ?? runParams.provider attempt.provider internalParams.provider
modelContextWindow runParams.modelContextWindow attempt.model.contextWindow internalParams.model.contextWindow
tokenBudget context.contextWindowInfo?.tokens attempt.contextTokenBudget internalParams.contextTokenBudget

The CLI row is the inverse of the embedded row, not a variant of it:

  • CLI tokenBudget is contextWindowInfo.tokens, which is exactly what the CLI runner already uses as its own budget (cli-runner/prepare.ts:1665, contextTokenBudget: contextWindowInfo.tokens) - i.e. the resolved value, essentially always defined.
  • CLI modelContextWindow is runParams.modelContextWindow, which is optional (cli-runner/types.ts:162) and is a caller-supplied raw value, not contextWindowInfo.tokens (prepare.ts:1601 shows the resolved window flowing into a different field).

So for the same model an engine can see { modelContextWindow: undefined, tokenBudget: 200000 } from the CLI route and { modelContextWindow: 200000, tokenBudget: undefined } from the embedded route. provider diverges too: only the CLI producer prefers modelProvider. Since the whole point is that engines can trust these four facts, it would help to resolve them once in a shared helper and have all three producers call it, rather than three hand-written literals.

The body says "Native, plugin-harness, and CLI producers provide these facts." Measured, in the default configuration the native and harness producers provide three of the four.

3. runtimeContext on commitTurn is a shared slot, and this makes it partial

commitTurn's parameter is typed ContextEngineRuntimeContext (src/context-engine/types.ts:451), the same type assemble, afterTurn and the maintenance hooks take. On the non-durable path that slot is filled by buildAfterTurnRuntimeContextFromUsage (attempt-finalize.ts:244), which produces the full object from buildAfterTurnRuntimeContext (attempt-prompt-helpers.ts:508): cwd, sessionTarget, promptCache, transcriptStorage, rewriteTranscriptEntries, llm, and more.

Before this PR, commitTurn simply received no runtimeContext from the durable path, so an engine could branch on undefined. After it, runtimeContext is defined but carries four keys, and runtimeContext !== undefined no longer implies the fields an engine reads elsewhere are present. An engine sharing one readRuntimeContext(ctx) helper across afterTurn and commitTurn - a natural thing to do given the identical type - now silently gets undefined for everything except these four.

Related: ContextEngineRuntimeContext is Record<string, unknown> & { ... } (types.ts:309), and of the four fields only tokenBudget is declared. provider, modelId and modelContextWindow ride in on the index signature, so a plugin engine written against the public type reads them as unknown and has to cast. If they are meant to be part of the contract, declaring them next to tokenBudget would make that explicit and would let the type system catch producer drift like point 2.

Smaller note

recoverContextEngineTurnOutbox reads payload.runtimeContext back out of the stored row. The outbox tests cover this, and I did not find a schema that would strip unknown keys, but it is worth confirming that a row written by an older build (no runtimeContext) and one written by a newer build round-trip through the same parse without the field being dropped on the way in - the retry assertion currently checks the field only after Object.assigning it onto the payload in the test itself, not after a real write/read cycle.

None of this touches the recovery and retry work, which looks right to me.

@jalehman

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jalehman

jalehman commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Acting on Josh Lehman’s explicit instruction to land this PR, I’m recording his maintainer acceptance of the additive optional durable metadata contract:

  • older readers can parse these rows while ignoring the four model facts;
  • legacy rows retain engine fallback behavior; and
  • if older code performs accepted→ready recovery, it may permanently drop those facts, after which engine fallback applies.

That downgrade behavior is accepted. The payload remains bounded to four optional primitive facts and does not require a SQLite schema or protocol version change.

@jalehman

Copy link
Copy Markdown
Contributor

Maintainer review complete for exact head f8cc0ea9d7c18d9d2b1e6dd63b5182be1b78223d.

The original contributor head had one actionable P2: embedded producers could persist the already-capped effective window as the native model window. Commit f8cc0ea9d7c fixes that by snapshotting and forwarding the native context window independently from the effective token budget. I rechecked the prior review concerns against current source: production setup resolves the effective budget, dispatch forwards it, CLI native-window/effective-budget fields are intentionally distinct, and the outbox coverage performs real SQLite enqueue/recovery/drain and retry cycles.

Evidence:

  • focused/expanded relevant tests: 235 passed across 3 shards;
  • changed-file gates for all 13 paths: passed;
  • fresh exact-head Codex autoreview: clean, no accepted/actionable P0–P2 findings, correctness confidence 0.96;
  • isolated install/build/type+lint check: passed;
  • exact-head required openclaw/ci-gate: passed (run);
  • repository-native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 142871: passed, verified remote and prep trees both at f8cc0ea9d7c, with hosted exact-head gates and no ancestry replacement.

ClawSweeper’s latest exact-head review reports sufficient real-engine proof and no correctness or security finding. Its remaining checklist items are the same persisted-contract owner decision, now explicitly resolved in the maintainer acceptance.

@jalehman jalehman 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.

Approved at f8cc0ea9d7c18d9d2b1e6dd63b5182be1b78223d after fresh source review, clean P0–P2 autoreview, focused and changed-file gates, exact-head required CI, and repository-native prepare. The persisted optional metadata and documented downgrade behavior have explicit maintainer acceptance.

@jalehman
jalehman merged commit d6997b6 into openclaw:main Sep 11, 2026
213 checks passed
@jalehman

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…142871)

* fix: retain model budgets for durable context-engine turns

* fix(agents): preserve native context window metadata

---------

Co-authored-by: Marvinthebored <[email protected]>
Co-authored-by: jalehman <[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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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: S 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.

Durable context-engine commits lose the resolved model window and budget

3 participants