Repository navigation
fix: identify malformed Code Mode JavaScript as input errors - #149222
Conversation
|
🦞👀 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. |
71c00d2 to
b3c6175
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 6:22 AM ET / 10:22 UTC (Revision 5). ClawSweeper reviewWhat this changesCode Mode rejects malformed JavaScript before guest execution and returns bounded input-error diagnostics, with updated regression tests and troubleshooting guidance. Merge readiness✅ Ready for maintainer review The fix remains useful: current main still classifies malformed JavaScript as a guest runtime failure. No actionable correctness or security findings remain, and the protected maintainer label excludes cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw Code Mode accepts model-generated JavaScript and runs it in an isolated QuickJS worker that can request enabled tools. Source preparation checks the program before execution and returns errors to the model for correction. flowchart TD
A[Model submits JavaScript] --> B[Source preparation]
B --> C{Valid permitted source?}
C -->|No| D[Bounded input diagnostic]
C -->|Yes| E[Isolated QuickJS worker]
E --> F[Enabled tool dispatch]
E --> G[Result or runtime failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +10, Tests +37, Docs +7. Total +54 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep syntax classification in the existing source-preparation owner, preserving no-dispatch evidence and the distinction between malformed source and runtime exceptions. Do we have a high-confidence way to reproduce the issue? Yes, from source: submitting malformed JavaScript through Code Mode exec reaches guest parsing on current main and receives a runtime failure classification. The registered-exec regression covers that path; it was not run during this read-only review. Is this the best way to solve the issue? Yes. Reusing the existing parser and input-error contract is a focused repair that preserves guard precedence and runtime exceptions; it adds parsing work for cells that previously bypassed Acorn. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ffb50bc0479d. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
b3c6175 to
1af425e
Compare
Reject syntax errors before guest execution and preserve authoritative no-dispatch evidence without changing restart-safe policy. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
1af425e to
6dab4c2
Compare
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits) fix(ui): await scheduled rail layout in focus test fix(cron): keep healthy active runs from delaying job lists (#154421) fix(plugins): prevent config conflicts during legacy plugin installation (#154539) perf(gateway): reduce repeated session-list work (#154551) fix(tasks): retain admitted work across list retries (#154338) perf(gateway): speed up transcript artifact downloads (#154726) chore(ui): refresh control ui locales (#154580) fix(release): keep two extended-stable months eligible (#154777) fix(tests): avoid avatar descriptor reuse race (#154747) perf(plugins): reduce callback scope overhead (#154625) fix(ui): include final request time in completed work summaries (#149240) fix(ai): avoid retrying conflicting Responses terminal statuses (#149242) fix: identify malformed Code Mode JavaScript as input errors (#149222) fix(doctor): settle imported JSONL transcript leftovers (#154413) fix(cloud): restore node bootstrap with bundled browser runtime (#154654) test(ui): await publication state notifications (#154768) fix(plugins): keep unchanged plugins running across metadata refreshes (#151281) fix: keep chat panel accessibility targets within each pane (#153478) fix: forced Gateway restarts cancel healthy subagent work (#154300) improve: reduce session delivery reader imports (#154740) ...
…w#149222) * fix: identify malformed Code Mode JavaScript as input errors Reject syntax errors before guest execution and preserve authoritative no-dispatch evidence without changing restart-safe policy. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Dallin Romney <[email protected]> * fix: identify malformed Code Mode JavaScript as input errors Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Dallin Romney <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
What Problem This Solves
Fixes: Code Mode reports an internal runtime failure when model-generated JavaScript contains malformed nested quotes or another syntax error, even though no tool ran.
User Impact
User impact: the model receives a bounded syntax diagnostic with a source line and column and explicit no-dispatch evidence, so it can correct the source and continue. No configuration or migration is required.
Why This Change Was Made
Source preparation rejects malformed JavaScript through the existing input-error contract before creating the guest VM. Module and shell guards keep their precedence. Valid code that throws a runtime exception remains a runtime failure; source is never automatically repaired or replayed, and restartSafe/replaySafe behavior is unchanged.
The September 21 conflict resolution preserves main's synchronous, JavaScript-only source owner and its module-scan shortcut. It does not restore retired TypeScript execution or add another repair loop. The parser result is shared between syntax validation and module checks.
Evidence
This is a runtime diagnostic change, not a visual UI change. No merge or deployment is requested.
Contributor credit: Dallin Romney (@RomneyDa). Both authorized coauthor trailers are preserved on every commit.
Work sessions