Repository navigation
fix(code-mode): check automation and process result types - #147143
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 12:59 PM ET / 16:59 UTC (Revision 3). ClawSweeper reviewWhat this changesAdds automation and process result declarations, types existing node methods, and reports up to five bounded TypeScript errors together in Code Mode. Merge readiness✅ Ready for maintainer review The PR remains useful and the previous pending-cleanup finding is resolved. Producer contracts, registered-tool coverage, and the revised regression support clearing that blocker; no additional actionable defect was found. Priority: P2 Review scores
Verification
How this fits togetherCode Mode lets agents compose existing OpenClaw tools in JavaScript or TypeScript. Tool result schemas feed declaration discovery, optional compiler checks, and validation before results return to the running program. flowchart TD
A[Agent program] --> B[Optional TypeScript preflight]
C[Tool result declarations] --> B
B --> D[Existing tool dispatch]
B --> E[Bounded compiler errors]
D --> F[Automation and process results]
C --> G[Result validation]
F --> G
G --> A
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +287, Tests +459, Docs +17. Total +763 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep accurate declarations with the existing tool owners and use the shared catalog validator and compiler to support safe composition without adding another execution path. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature enhancement; current-main source confirms the missing declarations and single-error feedback. The previous patch defect now has targeted regression coverage, inspected but not executed in this read-only review. Is this the best way to solve the issue? Yes. The patch extends the existing output-schema and preflight mechanisms, shares the process schema across constructors, and preserves existing automation result variants. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 00c540f16bb7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
Declare automation and process results for schema discovery, strict TypeScript composition, and runtime output validation. Reuse canonical automation job and history contracts, describe node handles, and return up to five bounded compiler diagnostics per repair attempt. Related: #147105
a50b221 to
fd9a5f4
Compare
Successful removal of an active isolated or current automation can defer base-session cleanup. Preserve that existing pending result in the closed output schema and canonical service type so Code Mode does not report failure after deleting the job. Verify both targets through the real cron service and Code Mode catalog with one removal invocation and no retry.
|
Merged via squash.
|
* commit '201f11afefdb19a9c75e9d3542bf7425c80df7a7': (141 commits) fix: keep catalog discovery scoped and execution lazy (#147159) fix: serialize reclamation worker shutdown with foreground writes (#147178) test(sessions): cover abrupt committed transcript recovery (#143984) fix: stop transcript storms during context overflow recovery (#147202) fix: reduce CPU overhead for small history and usage reads (#147205) fix: resume tasks after tools finish and the model times out (#147203) refactor(scripts): share SQLite reliability message waits (#146900) feat(exec): configure approval reviewer thinking and fastMode (#147192) test: remove redundant Bonjour module headers (#146981) refactor: share streaming media tail boundary update (#146989) refactor(tui): classify resume candidates once (#146983) improve: skip unused toast dismissal work (#147196) fix(linux): recover saved remote connections without replacing active sessions (#146047) fix: doctor stays silent when Windows state dir is under OneDrive (#123720) feat: announce successful Daybreak retries (#147146) feat(code-mode): reuse results across code cells (#147154) refactor(test): reuse CLI plugin fixture writer (#147186) test: skip unused compiler setup in routing fixtures (#147194) test: reuse LINE webhook runtime fixture (#146710) fix(code-mode): check automation and process result types (#147143) ...
…47143) * feat(code-mode): improve typed composition and repair feedback Declare automation and process results for schema discovery, strict TypeScript composition, and runtime output validation. Reuse canonical automation job and history contracts, describe node handles, and return up to five bounded compiler diagnostics per repair attempt. Related: openclaw#147105 * fix(code-mode): accept pending automation session cleanup Successful removal of an active isolated or current automation can defer base-session cleanup. Preserve that existing pending result in the closed output schema and canonical service type so Code Mode does not report failure after deleting the job. Verify both targets through the real cron service and Code Mode catalog with one removal invocation and no retry.
Related: #147105
What Problem This Solves
Code Mode cannot type-check composition of automation and process results, and compiler feedback exposes only one error per attempt.
User Impact
Agents can inspect accurate output declarations for automations and process and compose their results with strict TypeScript checks. Preflight reports up to five bounded diagnostics together and understands the existing nodes API. Command-specific node result payloads remain unknown.
Why This Change Was Made
Output schemas describe the existing producer results, including failure and control variants, and are shared by eager and lazy process tools. Automation contracts reuse canonical Gateway schemas. Large result unions remain available through API.read rather than being shortened into misleading quick-index hints. Runtime output validation uses the same contracts.
Evidence
The original feature patch was rebased onto the main revision containing startup-budget repair #147164; git range-diff confirmed patch equivalence. Final review then caught an existing successful-removal variant: active automation jobs can return
sessionCleanup: "pending"after durable deletion. The schema and canonical removal type now preserve that outcome, so Code Mode does not report failure after deleting the job. Both active isolated/current cases passed through the real CronService and Code Mode boundary with exactly one removal call; all 27 focused contract and cleanup tests passed, with a fresh clean P2 review.