Skip to content

fix: use context-aware reserveTokensFloor in overflow recovery hint#84399

Merged
steipete merged 9 commits into
openclaw:mainfrom
tanshanshan:fix/context-aware-reserve-tokens-floor-v2
May 25, 2026
Merged

fix: use context-aware reserveTokensFloor in overflow recovery hint#84399
steipete merged 9 commits into
openclaw:mainfrom
tanshanshan:fix/context-aware-reserve-tokens-floor-v2

Conversation

@tanshanshan

@tanshanshan tanshanshan commented May 20, 2026

Copy link
Copy Markdown

Summary

Replace the hardcoded 20000 reserveTokensFloor suggestion in context-overflow recovery messages with dynamic tier-based values based on the model context window size.

Problem

When context limit is exceeded, the error message suggests setting agents.defaults.compaction.reserveTokensFloor to 20000. However, 20000 is too low for models with larger context windows (200k, 1M tokens), causing users to still experience context overflow errors even after applying the recommended config.

Solution

Use context-aware tiered values for the recommended reserveTokensFloor:

  • 100000 for context windows >= 1M tokens
  • 50000 for context windows >= 200k tokens
  • 35000 for context windows >= 100k tokens
  • 20000 for smaller/undefined context windows (default)

Uses session contextTokens as fallback when model metadata is unavailable, with model metadata taking precedence over stale session entries.

Changes

  • Add computeContextAwareReserveTokensFloor() function with tier logic
  • Add resolveContextWindowForCompactionHint() to resolve context window with session fallback
  • Add buildContextOverflowResetHint() helper function
  • Update buildContextOverflowRecoveryText() to use dynamic hint
  • Output plain numeric values (e.g. 50000) instead of locale-formatted strings, matching the integer config schema
  • Add comprehensive unit tests for tier boundaries, fallback behavior, and model-metadata priority

Verification

OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/auto-reply/reply/agent-runner-execution.test.ts -t "computeContextAwareReserveTokensFloor|buildContextOverflowRecoveryText" --no-file-parallelism

16 tests passed (7 direct tier tests + 9 integration tests).

Real behavior proof

Behavior addressed: Context overflow recovery hint suggests hardcoded 20000 for reserveTokensFloor regardless of model context window size; after this fix, the hint uses context-aware tiers (100000/50000/35000/20000).

Real environment tested: Local OpenClaw dev setup, verified via pnpm dev gateway with the patched code, invoking buildContextOverflowRecoveryText with different context window sizes.

Exact steps or command run after this patch:

  1. Start gateway with pnpm dev
  2. Call buildContextOverflowRecoveryText with different model context window sizes (1M, 200k, 100k, 32k, undefined)
  3. Observe the recovery hint message for each tier

Evidence after fix:

Terminal output from running buildContextOverflowRecoveryText with patched code:

=== 1M context (openrouter/qwen3.6-plus) ===
⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 100000 or higher in your config.

=== 200k context (claude-sonnet-4-6) ===
⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 50000 or higher in your config.

=== 100k context (gpt-4o) ===
⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 35000 or higher in your config.

=== 32k context (ollama/qwen3.5) ===
⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config.

=== undefined (no model metadata) ===
⚠️ Context limit exceeded. I've reset our conversation to start fresh - please try again.

To prevent this, increase your compaction buffer by setting `agents.defaults.compaction.reserveTokensFloor` to 20000 or higher in your config.

Observed result after fix: The recovery hint now recommends context-appropriate values: 100000 for 1M, 50000 for 200k, 35000 for 100k, and the default 20000 for small/undefined context windows. Before this patch, all cases showed the hardcoded 20000.

What was not tested: Full E2E context-overflow scenario with compaction recovery on a 200k model; verified via unit tests only for that tier. Live heartbeat model bleed path (which bypasses the reserveTokensFloor hint entirely) was not tested.

Fixes #65839

@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 7:16 PM ET / 23:16 UTC.

Summary
The PR changes context-overflow recovery text to recommend reserveTokensFloor values from the effective model context window instead of always suggesting 20000.

PR surface: Source +106, Tests +507. Total +613 across 2 files.

Reproducibility: yes. at source level: current main and v2026.5.22 both hardcode the reserveTokensFloor hint to 20000, matching the linked bug. I did not run the app or tests in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • I did not execute the focused Vitest command in this read-only review; merge should still wait for required checks on ea02a9602e4503e8cc36afdda82e81eb504609fa.

Maintainer options:

  1. Decide the mitigation before merge
    Land this focused PR after required CI is green so the linked issue can close through the PR's closing reference.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No ClawSweeper repair lane is needed; the remaining action is maintainer review and normal CI gating for the current head.

Security
Cleared: The diff only touches the auto-reply recovery helper and colocated tests; it does not add dependencies, workflows, scripts, permissions, or secret-handling changes.

Review details

Best possible solution:

Land this focused PR after required CI is green so the linked issue can close through the PR's closing reference.

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

Yes at source level: current main and v2026.5.22 both hardcode the reserveTokensFloor hint to 20000, matching the linked bug. I did not run the app or tests in this read-only review.

Is this the best way to solve the issue?

Yes; the PR keeps the existing config key and derives the hint from the effective runtime context window, including existing agent context caps and session/runtime fallback behavior, rather than adding a new config surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 65a210553b6c.

Label changes

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This fixes a normal-priority user-facing recovery hint for context overflow without changing persisted defaults or core routing behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output from the patched recovery text helper showing the expected tiered hints for 1M, 200k, 100k, 32k, and unknown context windows.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from the patched recovery text helper showing the expected tiered hints for 1M, 200k, 100k, 32k, and unknown context windows.
Evidence reviewed

PR surface:

Source +106, Tests +507. Total +613 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 119 13 +106
Tests 1 507 0 +507
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 626 13 +613

What I checked:

  • Repository policy read: The full root policy was read and applied, including PR review, compatibility, proof, and source-history requirements. (AGENTS.md:1)
  • Scoped policy check: No scoped AGENTS.md exists under src/auto-reply, and the only maintainer note found is Telegram-specific, so root policy owns this review.
  • Current main still has the reported behavior: At the provided current main SHA, the overflow reset hint still hardcodes reserveTokensFloor to 20000. (src/auto-reply/reply/agent-runner-execution.ts:717, 65a210553b6c)
  • Latest release still has the reported behavior: The latest release tag also hardcodes the same 20000 hint, so the PR is not obsolete from shipped behavior. (src/auto-reply/reply/agent-runner-execution.ts:716, a374c3a5bfd5)
  • PR implements dynamic reserve floor tiers: The PR head adds computeContextAwareReserveTokensFloor and builds the reset hint with tiered values for 1M, 200k, 100k, and smaller or unknown context windows. (src/auto-reply/reply/agent-runner-execution.ts:717, ea02a9602e45)
  • PR threads effective runtime model into overflow hints: The PR passes the attempted runtime provider/model into both embedded overflow and compaction-failure recovery paths, so fallback candidates can drive the hint. (src/auto-reply/reply/agent-runner-execution.ts:2374, ea02a9602e45)

Likely related people:

  • fuller-stack-dev: Commit cd1cae5be9ba76763e696784ff2effa534e00052 added preserved-session overflow recovery guidance and tests around the same buildContextOverflowRecoveryText path. (role: introduced adjacent recovery behavior; confidence: medium; commits: cd1cae5be9ba; files: src/auto-reply/reply/agent-runner-execution.ts, src/auto-reply/reply/agent-runner-execution.test.ts)
  • vincentkoc: Commit 04061bc801891060fb34a425af5fc08c38dd1ad3 changed the heartbeat context-window fallback logic that shares the same overflow hint decision surface. (role: recent area contributor; confidence: high; commits: 04061bc80189; files: src/auto-reply/reply/agent-runner-execution.ts, src/auto-reply/reply/agent-runner-execution.test.ts)
  • steipete: The current PR head was force-pushed by steipete and includes maintainer follow-up commits tightening runtime candidate, stale-session, and heartbeat-hint handling. (role: recent PR follow-up owner; confidence: high; commits: b3203d4fd0b4, 1ec913025cc9, 9d28cba8cea4; files: src/auto-reply/reply/agent-runner-execution.ts, src/auto-reply/reply/agent-runner-execution.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🥚 common Neon Crabkin

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🥚 common.
Trait: sparkles near resolved comments.
Image traits: location review cove; accessory proof snapshot camera; palette moss green and polished brass; mood mischievous; pose nestled inside a glowing shell; shell matte ceramic shell; lighting gentle morning glow; background gentle dashboard dots.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Neon Crabkin in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@tanshanshan

This comment was marked as low quality.

@clawsweeper

clawsweeper Bot commented May 20, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@tanshanshan

This comment was marked as low quality.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

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: 🦐 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 20, 2026
@steipete steipete force-pushed the fix/context-aware-reserve-tokens-floor-v2 branch from e76b8cb to ea02a96 Compare May 25, 2026 23:09
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels May 25, 2026
tanshanshan and others added 9 commits May 26, 2026 00:21
Replace hardcoded 20000 reserveTokensFloor suggestion with dynamic
tier-based values based on the model context window size:
- 100000 for context windows >= 1M tokens
- 50000 for context windows >= 200k tokens
- 35000 for context windows >= 100k tokens
- 20000 for smaller/undefined context windows

Uses session contextTokens as fallback when model metadata is
unavailable, with model metadata taking precedence over stale
session entries.

Fixes openclaw#65839
When agents.defaults.contextTokens or per-agent contextTokens caps
the effective context window below the model's full window, the
hint should reflect the capped value, not the raw model window.

Uses Math.min(agentCap, modelWindow) to compute the effective
context, matching resolveContextTokens() in model-selection.ts.
When the primary model's context window cannot be resolved from
model metadata, fall back to the session entry's modelProvider/model
to look up context window before using session contextTokens numeric.
When a large primary model falls back to a smaller runtime model
that overflows, the recovery hint should recommend a
reserveTokensFloor based on the actual runtime model's context
window, not the primary model's larger window.

Thread runtimeProvider/runtimeModel into buildContextOverflowRecoveryText
and resolveContextWindowForCompactionHint, with priority:
1. Runtime/fallback model (the one that actually overflowed)
2. Session entry model (when runtime not provided)
3. Primary model (fallback when runtime unknown)
4. Agent contextTokens cap applied via Math.min
5. Session contextTokens numeric value
@steipete steipete force-pushed the fix/context-aware-reserve-tokens-floor-v2 branch from ea02a96 to e25b3e8 Compare May 25, 2026 23:23
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 25, 2026
@steipete steipete merged commit 3a4f2b1 into openclaw:main May 25, 2026
109 of 162 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 26, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
SebTardif pushed a commit to SebTardif/openclaw that referenced this pull request May 26, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
cael-dandelion-cult pushed a commit to karmaterminal/openclaw that referenced this pull request May 27, 2026
…to PR-head wholesale

Per pr-review-toolkit:code-reviewer finding: my prior shape-only port left
computeContextAwareReserveTokensFloor as dead code and runtimeProvider/
runtimeModel params unused, regressing upstream openclaw#84399 ("use context-aware
overflow reserve hints"). The 10 test failures attributed in RESOLUTION-TRAIL
§11 to "upstream-class loss" included this real regression of an upstream
feature, not just an upstream-only test that PR-head intentionally lacked.

Full port-back applied to PR-head's wholesale-taken
src/auto-reply/reply/agent-runner-execution.ts:

- resolveContextWindowForCompactionHint() helper added (resolves context window
  from runtime / session / primary / agent-cap, in that priority order)
- buildContextOverflowResetHint() helper added (dynamic per-window reset hint
  using computeContextAwareReserveTokensFloor)
- buildContextOverflowRecoveryText() body rewritten to compute the primary
  context window and select heartbeat-bleed-hint vs reset-hint per upstream
- Static CONTEXT_OVERFLOW_RESET_HINT constant removed (was unused after rewrite)
- CLI runner runParams now carries suppressNextUserMessagePersistence,
  onUserMessagePersisted, and userTurnTranscriptRecorder (upstream's
  prepared-CLI-user-turn boundary)
- attemptedRuntimeProvider / attemptedRuntimeModel tracking added at function
  scope; updated inside the run() callback per candidate attempt
- Three buildContextOverflowRecoveryText callsites now thread
  runtimeProvider: attemptedRuntimeProvider / runtimeModel: attemptedRuntimeModel
  (was fallbackProvider/fallbackModel, which only updates on success)
- Added unconditional `if (isCompactionFailure)` fallback branch with
  preserveSessionMapping: true mirroring upstream, AFTER PR-head's existing
  resetSessionAfterCompactionFailure-gated branch. Preserves PR-head's reset-
  attempt feature when the callback returns true; falls back to upstream's
  always-show-recovery-text behavior when reset returns false.

Test gate: src/auto-reply/reply/agent-runner-execution.test.ts now 149/149
PASS (was 10 failing). Tsgo / umbrella check / build all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cael-dandelion-cult pushed a commit to karmaterminal/openclaw that referenced this pull request May 27, 2026
…fixture corrections

Supersedes prior fold-3-defer-2 ambiguity. Per figs verbatim canon at PR #792
issuecomment-4551691544 (Elliott byte-walk correction): "we ship feature complete.
thats a weird deferral" — fold ALL 5 #793 substantive deltas, no active-vs-dormant
split.

Plus paired test corrections that BOTH lanes shipped (per Elliott byte-walk):

1. **`src/agents/pi-embedded-runner/run/failover-policy.ts`** — adopt #793's
   `harnessOwnedTimeout` extraction + early-return `continue_normal` shape.
   Reverts my earlier `bf21bbc4b8`-shape revert. Cohort lock: full fold.

2. **`src/infra/session-cost-usage.ts`** — adopt #793's `includeCheckpoints`
   typed flag at helper source. Reverts my earlier `bf21bbc4b8`-shape revert
   (targeted skip in `loadCostUsageSummary` loop). Cleaner abstraction.

3. **`src/agents/pi-tools.workspace-paths.test.ts`** — fixture rename
   `memory/2026-05-20.md` → `memory/new-note.md` to de-stamp date-baked
   fixture. Test assertion shape unchanged (`fs.readFile(...).resolves.toBe(...)`).
   Both lanes converged on this rename per Elliott `4551691544`. NOT a mask.

4. **`src/agents/pi-embedded-runner/run.cross-provider-fallback-error-context.test.ts`**
   — paired test update matching merged production behavior under openclaw#84399 +
   #793 harnessOwnsTransport shape. Assertion now asserts what production
   actually does (`.resolves.toMatchObject({payloads: [{isError: true, text:
   stringContaining("Request timed out")}]})`). Both lanes shipped paired test
   updates for their contract changes per Elliott byte-walk. NOT a mask.

Cael's earlier "Ronan masked tests / Cael honest-fails" framing was wrong;
Elliott byte-walked and self-corrected (PR comments 4551691544 + 4551691738).
This commit aligns cael's test surface to the cohort convergence.

Test gate: 38/38 in the 2 previously-red files; tsgo green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…4399)

Use the effective runtime/model context when computing overflow recovery reserveTokensFloor hints, including uncataloged runtime refs, stale session windows, and heartbeat fallback cases.

Verification:
- pnpm test src/auto-reply/reply/agent-runner-execution.test.ts
- autoreview clean on final focused fixup; prior accepted findings addressed before push.
- CI passed on head e25b3e8 after rerunning cancelled jobs: preflight, critical quality network-runtime-boundary, security high, checks, Real behavior proof.

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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.

Context limit exceeded error suggests too low reserveTokensFloor value (20000)

2 participants