Repository navigation
fix: keep recursive Code Mode cells recoverable - #141960
Conversation
Punchcard-Session: amber-brook-orchard-d1
|
🦞👀 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. Reviewed September 8, 2026, 3:18 AM ET / 07:18 UTC. ClawSweeper reviewWhat this changesBounds recursive Code Mode execution so fresh and restored cells return a readable stack-overflow error instead of trapping the WebAssembly runtime. Merge readiness✅ Ready for maintainer review Keep open: this is a focused, useful repair that current main still lacks. No introduced correctness or security defect was found; the maintainer-authored PR is also protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw Code Mode executes model-written JavaScript in an isolated QuickJS worker. The worker handles fresh cells and restored snapshots, returning results or errors to the host’s tool execution and recovery flow. flowchart TD
A[Model-written cell] --> C[Shared VM options]
B[Suspended cell snapshot] --> C
C --> D[QuickJS worker with stack bound]
D --> E[Completed or suspended result]
D --> F[Guest stack-overflow error]
F --> G[Host failed-cell recovery]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +50. Total +58 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the dependency-supported stack bound in the canonical VM constructor so recursive cells fail through the existing guest-error and cleanup flow. Do we have a high-confidence way to reproduce the issue? Yes: infinite recursion before or after yield_control provides a concrete worker-level reproduction path, supported by the missing main-branch stack bound and reported pre-fix failures; this read-only review did not execute it. Is this the best way to solve the issue? Yes: setting the dependency’s supported limit once covers fresh and restored VMs without adding a competing recovery mechanism or user configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 44b52287ff38. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Punchcard-Session: amber-brook-orchard-d1
Punchcard-Session: amber-brook-orchard-d1 (cherry picked from commit 9a5ba67)
배치 A 체리픽이 이 포크에 없는 중간 리팩터링에 걸린 지점을 포크 코드에 맞춰 정리했다. - 문자열 이스케이프 복구: attempt-prompt-build.ts, attempt-prompt-context.test.ts - openclaw#140859: session-accessor.entry-mutation.ts 의 transcript 헤더 import 복원 - openclaw#141247: runs.ts 에서 포크에 없는 projectSessionActive 조건 제거 - openclaw#141471: execute-plugin.test-support.js 가 없어 native-bash 테스트 파일 제거 - openclaw#141960: quickjs-wasi 3.6.0 의 MAX_STACK_SIZE 를 쓸 수 없어 되돌림(포크는 3.5.0 핀) - openclaw#142130: agents.ts 의 assertCurrent 호출 제거, cleanup-utils 는 선택 인자로 유지 - openclaw#142158: manifest-planner.ts 의 remoteModelIds·manifestModelsById 복원 - openclaw#143308: simple-completion-runtime.ts 에 acquireSimpleCompletionModelForAgent 래퍼 추가 - openclaw#143899: src/infra/file-descriptor.ts 의 fingerprint 비교 헬퍼 이식, backup-shared 의 configCapture 참조 제거 Co-Authored-By: Claude Fable 5.1 <[email protected]>
What Problem This Solves
Fixes an issue where recursively authored Code Mode cells could trap the QuickJS WASM runtime with
memory access out of boundsinstead of returning a normal failed-cell result.Why This Change Was Made
Pass the
quickjs-wasiexportedMAX_STACK_SIZEinto the canonical VM options shared by fresh creation and snapshot restoration. This keeps both execution paths on the dependency's supported recursion bound.User Impact
Recursive guest code now fails visibly with
RangeError: Maximum call stack size exceeded, allowing the normal Code Mode recovery loop to continue instead of surfacing a low-level WASM trap.Evidence
WebAssembly.RuntimeError: memory access out of bounds