Repository navigation
fix: bound Workshop turn lookup on large sessions - #193544
Conversation
Reject oversized implicit full model-context reads before payload hydration and keep anchored fork requester lookup bounded with explicit tool-result omissions. Preserve exact small reads and fail visibly when initiating input is outside the bounded window. Fixes #193492. Thanks to @dengsc525 for the worker exhaustion report.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesBounds the forked-turn requester and model lookup to 8 MiB and 20,000 events, with explicit tool-result omission. Example: A completed turn contains 2,800 tool pairs and 492.1875 MiB of synthetic result text.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete background-review failure without retaining the earlier foreground compatibility regression; no blocking defects found, and current-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSkill Workshop passes a completed-turn anchor through the plugin Gateway adapter to the shared fork owner, which derives requester and model facts before admitting a bounded background review. flowchart LR
A[Completed turn] --> B[Workshop scheduler]
B --> C[Plugin Gateway adapter]
C --> D[Bounded requester lookup]
D --> E[Transcript worker]
D --> F[Source policy checks]
F --> G[Hidden review and settlement]
Technical reviewBest possible solution: Use the existing bounded projection for fork lookup while preserving full-context reader semantics and refusing unavailable requester evidence. Do we have a high-confidence way to reproduce the issue? Current-main source reaches an unlimited worker read before bounded review execution, supported by reported real-worker OOM results; this read-only review executed no reproduction. Is this the best way to solve the issue? The final patch is the smallest complete production repair: one bounded read through the existing projection owner, preserving anchor, cancellation, requester policy, and unrelated full-context consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0af74c76da98. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -3, Tests 0, Docs +5. Total +2 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed November 5, 2026, 12:41 PM ET / 17:41 UTC (Revision 5). |
|
@clawsweeper re-review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3c279fa12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new RangeError( | ||
| "Model context exceeds the implicit 8 MiB / 20000-event limit; pass explicit context limits.", | ||
| ); |
There was a problem hiding this comment.
Migrate foreground worker callers before enforcing the read cap
For admitted cloud-worker turns whose retained context exceeds 8 MiB or 20,000 events, this guard now prevents foreground execution: readWorkerTurnInputContext in src/gateway/worker-environments/worker-turn-user-message.ts still calls openModelContextAsync without explicit limits. executeWorkerTurn awaits that read before preparing the model or launching the worker, with no context-size recovery on this path, so subsequent turns in an otherwise usable session fail with this internal RangeError. Update those foreground callers to choose appropriate explicit limits as part of this cutover rather than making the background-review protection disable foreground conversations.
AGENTS.md reference: AGENTS.md:L52-L52
Useful? React with 👍 / 👎.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep the bounded Workshop requester lookup while restoring the public omitted-limits contract. Remove the implicit ceiling and null opt-ins; exercise the fork reader and full-context compatibility through existing regressions.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix: bound background transcript context reads Reject oversized implicit full model-context reads before payload hydration and keep anchored fork requester lookup bounded with explicit tool-result omissions. Preserve exact small reads and fail visibly when initiating input is outside the bounded window. Fixes openclaw#193492. Thanks to @dengsc525 for the worker exhaustion report. * docs: explain implicit model context limits * fix: preserve explicit full transcript replay * test: assert Goal return denial by status * fix: preserve full model context reads outside background lookup Keep the bounded Workshop requester lookup while restoring the public omitted-limits contract. Remove the implicit ceiling and null opt-ins; exercise the fork reader and full-context compatibility through existing regressions.
* fix: bound background transcript context reads Reject oversized implicit full model-context reads before payload hydration and keep anchored fork requester lookup bounded with explicit tool-result omissions. Preserve exact small reads and fail visibly when initiating input is outside the bounded window. Fixes openclaw#193492. Thanks to @dengsc525 for the worker exhaustion report. * docs: explain implicit model context limits * fix: preserve explicit full transcript replay * test: assert Goal return denial by status * fix: preserve full model context reads outside background lookup Keep the bounded Workshop requester lookup while restoring the public omitted-limits contract. Remove the implicit ceiling and null opt-ins; exercise the fork reader and full-context compatibility through existing regressions.
Closes #193492.
What Problem This Solves
Skill Workshop can exhaust a transcript worker while looking up the requester and model of a completed, tool-heavy turn.
User Impact
Background reviews prepare long turns through one bounded lookup with explicit tool-result omission. The completed-turn anchor, initiating sender policy, model selection, cancellation, and refusal when the initiating input is unavailable remain intact. The actual review window and incomplete-evidence warning are unchanged.
There is no public SDK contract change: omitted limits still return the full selected context. Full replay and reconciliation callers retain their existing behavior.
Why This Change Was Made
The final attempt in the old requester lookup read the whole model context. Replace the escalating attempts with one 8 MiB / 20,000-event read using
toolResultOverflow: "omit". All six other unbounded callers were audited again and intentionally need complete reconstruction or reconciliation; no shared ceiling or new full-read sentinel is needed.Thanks to @dengsc525 for the report and bounded-reader experiment.
Evidence
6d49ef1c): realreadSessionForkTurnfailed withERR_WORKER_OUT_OF_MEMORYon 492.1875 MiB of synthetic result text under the production 512/32 MiB worker limits. Subsequent bounded and small reads recovered in the same process. This baseline evidence is reused; the lookup source is unchanged on current main.6d49ef1cthrough headdaf081987420f13e7a9ea57790e4f3fdb2522149, scoped-clean through P2, no findings.qwen2.5:7bcompleted the callback successfully in 58.519 s with work counts returning to zero. The completed-turn event was synthetic; inference and settlement were real. This proves review execution, not successful skill authoring.ClawSweeper reviewed exact head
daf081987420f13e7a9ea57790e4f3fdb2522149: ready for maintainer review, Findings None, Before merge None.CI remains pending in run 42076119496: 33 observed jobs passed and 25 skipped; the only queued job is checks-node-changed-compact-large-15. It requests
blacksmith-32vcpu-ubuntu-2404and has no assigned runner. Preflight and build prerequisites passed. No CI failure was observed and no rerun was requested. The prior head'sscheduled-child-extra-automationsfailure remains prior-head evidence, not a claimed fix or a recurrence on this head. Do not treat the pending CI gate as green.The prior Goal-authority CI repair is retained: assert structured forbidden status while preserving the later revocation and delivery checks. No permission policy changed.
Production: 38 additions / 41 deletions (net -3). Tests: net zero. Docs: net +5. No test allocation or ceiling changes.
Local proof is macOS arm64 with Node 26.12.1 and pinned OpenClaw Bun. Linux coverage is left to PR CI. Extremely large explicitly full reads retain their existing memory cost and can exhaust their worker; cold navigation also still scales with row count. This change bounds the one background lookup, not every possible transcript read.