Repository navigation
refactor(auto-reply): share closed execution outcome reporting - #138127
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 6:04 AM ET / 10:04 UTC. ClawSweeper reviewWhat this changesThe PR centralizes closed auto-reply execution status reporting so terminal callbacks, reply-operation receipts, and message-tool outcome records use one classifier while retaining separate delivery evidence. Merge readiness✅ Ready for maintainer review Keep open. The small refactor preserves the existing terminal callback and message-tool record ordering while replacing two identical status projections with one shared helper; no blocking correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherAuto-reply executes an agent turn, then reports its terminal result to lifecycle owners and—when a message tool owns delivery—records whether a reply was sent. The shared classifier feeds those post-execution reporting paths while delivery evidence remains independent. flowchart LR
A[Incoming reply turn] --> B[Agent execution]
B --> C[Closed execution result]
C --> D[Shared status classifier]
D --> E[Lifecycle callback]
D --> F[Reply-operation receipt]
C --> G[Message-tool delivery record]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -4, Tests +27. Total +23 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the single dependency-free execution-status projection at the auto-reply boundary and retain message delivery as an independent persisted fact. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor rather than a report of a user-visible defect; focused tests exercise the changed terminal and delivery outcome combinations. Is this the best way to solve the issue? Yes. A small shared classifier removes duplicate outcome mapping at both existing owners, while the message-tool recorder continues to derive delivery independently from the embedded-run result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e4bba0813e7a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…law#138127) Share one closed execution-status projection across terminal callbacks, invocation-owned reply receipts and message-tool reporting. Preserve independent delivery evidence, callback ordering, abort handling and persisted status values. Production LOC: -4. No database, config, protocol or scheduler changes. Validation: 283 focused candidate tests; 40 tests after the unchanged case move; production/core-test types, lint and repository guards. Independent Codex reviews found no actionable findings. Exact-source isolated real-provider Gateway parity passed on OpenClaw and Codex: https://github.com/openclaw/openclaw/actions/runs/33858740814. The pre-existing NO_REPLY fallback diagnostic remains a named follow-up. Exact-head CI: 129 checks passed and 43 skipped. Two production audit attempts exhausted npm advisory-service request timeouts; security-fast and its aggregate are the only failures. The maintainer explicitly waived this availability failure and dependent gate. Native prepare validated review artifacts, then rejected the failed aggregate; no green gate stamp or audit clearance is claimed. Landing uses that narrow maintainer-authorized exception. Related: openclaw#135933
Related: #135933
What Problem This Solves
Heartbeat and ordinary reply execution classify the same closed agent result in separate places. That duplication makes it easier for later scheduler changes to confuse failed execution with a successful run that intentionally delivered no message.
Why This Change Was Made
Use one dependency-free execution classifier for the invocation-owned reply receipt, terminal callback, and existing message-tool outcome recorder. Keep the delivery fact independent: a failed run can already have delivered a message, and a completed run can intentionally remain silent. The recorder keeps its existing callback ordering and persisted values.
User Impact
Behavior-preserving prerequisite for the heartbeat/cron split. No SQLite schema, migration, stored representation, config/default, Gateway protocol, scheduling, or retry changes. Production code shrinks by 4 lines (+28/−32); tests grow by 27 (+54/−27), excluding the pure file rename.
Evidence
892f83902d8a62fee5b1f77fc4202dcd26f4d866in an isolated Testbox. OpenClaw and Codex each executed one side effect once and recorded the existingcompletedexecution /mutemessage-tool outcome with periodic heartbeat disabled. Codex usedgateway_exec. The task-only proof snapshot matched that source outside the two proof scripts; the lease is stopped.NO_REPLY. This PR preserves that behavior;mutedescribes message-tool evidence, not total downstream delivery. Fixing the host finalization policy is a follow-up for the broader cutover.