Repository navigation
fix(cron): avoid phantom message tool guidance - #116908
Patrick-Erichsen merged 5 commits into
Conversation
9950c5a to
7415e23
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 6:08 PM ET / 22:08 UTC. ClawSweeper reviewWhat this changesThe branch makes isolated-cron delivery instructions reflect the final tool inventory submitted to embedded, CLI, and plugin-harness agent runtimes. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherAn isolated cron job resolves a delivery plan and then selects an agent runtime with its own tool surface. That runtime sends the prompt and tools to the model; the resulting text is either automatically delivered or, when available, can use the message tool directly. flowchart LR
A[Cron job] --> B[Delivery plan]
B --> C[Runtime selection]
C --> D[Final tool inventory]
D --> E[Delivery prompt guidance]
E --> F[Model response]
F --> G[Automatic or direct delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +123, Tests +213. Total +336 across 14 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical resolved-tool policy so cron guidance, the submitted tool inventory, and automatic-delivery fallback always agree; retain the explicit fail-closed path only for backends that cannot honor hook restrictions exactly. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main appends the delivery instruction from delivery-plan and allowlist facts before the runtime resolves its submitted tools. The PR additionally supplies exact-head compiled-loopback evidence of the affected isolated-cron path. Is this the best way to solve the issue? Yes: deriving guidance from the resolved submitted tool surface repairs the owner-boundary mismatch instead of compensating after the model receives contradictory instructions. The CLI fail-closed compatibility policy is the only remaining behavior that needs a final current-main confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae27d7936447. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
|
Maintainer evidence update for exact head
Remaining blocker before merge: exact-head CI and the integrated real-behavior proof must finish green for this head. Keeping this PR canonical and open. Do not merge yet. |
|
Exact-head integrated proof is now complete for I compiled this head and exercised the production Observed from the compiled production run: {
"status": "ok",
"outputText": "PR116908_AUTOMATIC_DELIVERY_OK",
"compiledPrompt": {
"hasAutomaticDeliveryGuidance": true,
"hasMessageToolInstruction": false,
"hasDestinationMetadata": false
},
"finalToolInventory": {
"names": ["session_status"],
"includesMessage": false
},
"automaticDelivery": {
"count": 1,
"delivered": true,
"to": "proof-recipient",
"text": "PR116908_AUTOMATIC_DELIVERY_OK"
}
}The PR body now records the complete proof, exact limitations, and artifact hashes. This validates the real compiled isolated-cron prompt/tool/delivery path, but it is intentionally not represented as an external provider call or a live Telegram network delivery. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head compiled runtime proof for I exercised production {
"status": "ok",
"summary": "PR116908_FINAL_AUTOMATIC_DELIVERY_OK",
"delivered": true,
"deliveryAttempted": true,
"compiledPrompt": {
"hasAutomaticDeliveryGuidance": true,
"hasMessageToolInstruction": false,
"hasDestinationMetadata": false
},
"finalToolInventory": {
"count": 1,
"names": ["session_status"],
"includesMessage": false
},
"automaticDelivery": {
"count": 1,
"delivered": true,
"to": "proof-recipient",
"text": "PR116908_FINAL_AUTOMATIC_DELIVERY_OK"
}
}Proof report SHA-256: Final model request SHA-256: This is deterministic loopback evidence, not a live external provider or Telegram-network test. All 8 hosted workflows on the same head are green. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fresh exact-head validation for
I also rebuilt the exact head and repeated the production {
"exactHead": "9686806646c82938df0ee163cf4cc816e47a1ad0",
"status": "ok",
"delivered": true,
"compiledPrompt": {
"hasAutomaticDeliveryGuidance": true,
"hasMessageToolInstruction": false,
"hasDestinationMetadata": false
},
"finalToolInventory": {
"count": 1,
"names": ["session_status"],
"includesMessage": false
},
"automaticDelivery": {
"count": 1,
"delivered": true,
"to": "proof-recipient"
}
}Proof report SHA-256: Final model request SHA-256: This is deterministic loopback evidence, not a live external provider or Telegram-network test. Fresh exact-head hosted CI is still running. |
|
@clawsweeper re-review |
|
Fresh exact-head validation for
The rebuilt production Proof report SHA-256: Final model request SHA-256: This is deterministic compiled loopback evidence, not a live external-provider or Telegram-network test. I updated the PR body with the current compatibility behavior and removed the stale parent-head evidence. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Exact-head merge evidence refreshed for
The PR body now reflects the restored hook-failure fallback and current exact-head proof. @clawsweeper re-review |
|
Merged via squash.
|
…odels-20260729 * origin/main: fix(tui): canonical terminal outcomes, cancellation, and error privacy (#117044) fix(cron): avoid phantom message tool guidance (#116908) fix(test): avoid macOS release gate deadlocks (#116972) fix(openai): canonical Chat cache-hit and billing accounting (#117043) fix(memory-wiki): salvage human Notes before pruning imported source pages (#102294) fix(memory): suggest reindex, not --fix, for a missing qmd index (#116958) chore(msteams): add private Gateway QA adapter fix(ui): make session controls and failures accessible (#117019) docs: fix tilde paths in CLI output examples (#114595) fix(plugins): canonical discovery diagnostics and deterministic lifecycles (#117025) fix(ui): honor Gateway readiness abort and subscription ownership (#117048) fix(updater): harden launchd replacement timing (#117030) fix(gateway): preserve static asset HEAD representation metadata (#117049) fix(gateway): abort embeddings when clients disconnect (#116146) fix(googlechat): retain fallback thread continuity (#117053)
* fix(cron): avoid phantom message tool guidance * fix(cron): derive message guidance from resolved tools * fix(cli): apply prompt hook tool restrictions before guidance * fix(agents): preserve prompt-hook failure fallback --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]>
What Problem This Solves
Isolated cron runs could be told to use the
messagetool even when the selected runtime did not expose that tool. The model could then follow guidance for a capability absent from its submitted tool inventory, preventing the intended automatic-delivery fallback.Why This Change Was Made
Delivery guidance is now derived from the final resolved tool surface submitted to the model.
The implementation:
messageToolAvailableafter tool filtering and runtime projectionsbefore_prompt_buildtool restrictions to CLI projection before both guidance and submissionmessage_tool_onlydelivery before model execution when the selected runtime cannot exposemessage, allowing the existing fallback path to choose a compatible runtimeUser Impact
Isolated cron jobs no longer receive phantom
message-tool instructions. Jobs that rely on automatic delivery can complete normally. CLI prompt-hook failures retain their previous fallback behavior, while explicit tool restrictions remain enforced.Evidence
Exact validated head:
08c9ad354609246db767de40e9dde61fcc893749check-lintandopenclaw/ci-gatebefore_prompt_buildregression test preserves the base promptgit diff --checkpassedA private-QA build of this exact head launched compiled
dist/index.jswith OpenClaw's loopback mock OpenAI-compatible server and disposable qa-channel transport. The production cron path hadmessagedenied and notoolsAllowoverride. It confirmed:messageinstruction or destination metadata appeared in the promptmessagewas absent from the submitted tool inventory{ "status": "ok", "persistedDeliveryStatus": "delivered", "summary": "PR116908_EXACT_HEAD_AUTOMATIC_DELIVERY_OK", "compiledGatewayEntry": "dist/index.js", "includesMessageTool": false, "hasAutomaticDeliveryGuidance": true, "hasMessageToolInstruction": false, "hasDestinationMetadata": false, "automaticDelivery": { "count": 1, "target": "proof-recipient", "text": "PR116908_EXACT_HEAD_AUTOMATIC_DELIVERY_OK" }, "finalRequestSha256": "e8d4e3ab507581418890c689e67cddda71d12c598d565a0d8dbaf92a097d5c47", "reportSha256": "0133c25a5b2d55a67e381db5d5f8f8886d79bd55eb47515dfa6f552cc5259b6a" }Blacksmith Testbox: https://github.com/openclaw/openclaw/actions/runs/30668895572
The runtime proof is deterministic loopback evidence. It does not claim a live external model-provider or channel-network test.
Closes #116871