Repository navigation
fix(cron): silent agentTurn runs no longer report errors after successful tools - #114528
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 7:01 AM ET / 11:01 UTC. ClawSweeper reviewWhat this changesThis PR passes cron’s optional-terminal-reply contract into embedded agent terminal resolution so a successful tool-only run can finish as intentional silence instead of a failed incomplete turn. Merge readiness⛔ Blocked until real behavior proof is added - 2 items remain Keep this PR open for maintainer review. The patch is a focused fix for false cron errors and its changed paths preserve the existing error guards, but the contributor has not supplied inspectable after-fix runtime output for the reported live gateway scenario; the Priority: P2 Review scores
Verification
How this fits togetherCron schedules isolated agent turns and declares whether a terminal user-facing reply is required. The embedded runner converts the agent’s final tool and assistant state into a reply payload and cron diagnostic outcome, so this change affects whether a completed no-delivery run is reported as silent or erroneous. flowchart LR
A[Cron schedule] --> B[Isolated agent turn]
B --> C[Terminal reply expectation]
B --> D[Embedded agent runner]
D --> E[Tool and assistant outcome]
C --> F[Terminal classification]
E --> F
F --> G[Reply payload and cron diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +139. Total +155 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared terminal-reply contract propagation, add redacted live cron output demonstrating the successful silent run and one genuine failure, then land after the protected maintainer review completes. Do we have a high-confidence way to reproduce the issue? No high-confidence independent reproduction was established in this read-only review; the source path is clear and the PR describes a concrete no-delivery cron turn with successful side-effecting tools and an empty final response. Is this the best way to solve the issue? Yes, provisionally: threading the already-declared terminal-reply expectation into the shared classifier is narrower and less duplicative than adding cron-specific outcome rewriting, provided live proof confirms the stated failure boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 87b76d0cd050. LabelsLabel changes:
Label 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
|
|
Addressing the rank-up moves: Before-fix live evidence (redacted dev-gateway log, 2026-07-27): a no-delivery one-shot cron whose After-fix contrast: rather than a second live gateway run, the added regression tests in |
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where one-shot cron jobs running an⚠️ Agent couldn't generate a response. Note: some tool actions may have already been executed — please verify before retrying." even when every tool action succeeded. The run did exactly what it was asked — executed its tools and stayed silent — but cron diagnostics recorded it as a failure. Observed live on 2026-07-27 on a dev gateway while testing session archiving on the Codex harness (gpt-5.6-sol): the cron turn archived the session successfully, then was logged as an error purely because the final assistant message was intentionally empty.
agentTurnpayload with no delivery route (for example "archive this session after my turn ends — do not send any user-facing message") finished withoutcome=errorand the diagnostic "Why This Change Was Made
Cron already declares its delivery contract per run:
terminalReplyExpectation: "required" | "optional"(src/cron/isolated-agent/run-executor.ts), where "optional" means no user-facing reply is owed (deliverynone, webhook, or invalid route). The empty-reply classifier in the embedded runner never consumed that declaration:shouldTreatEmptyAssistantReplyAsSilenttreated any post-tool empty stop with replay-unsafe side effects as an ambiguous provider failure. This change threads the existing declaration into the classifier: when the run consumer declared the terminal reply optional, a normally-completed run (no abort, no timeout, no tool error, stopReasonstop) whose tools succeeded is classified as intentional silence (terminalReplyKind: "silent-empty",NO_REPLY) instead of an incomplete-turn error. Required or unspecified expectations, tool failures, error stop reasons, aborts, and timeouts keep the existing failure behavior, so genuinely broken runs still surface.User Impact
Operators no longer see false
outcome=errordiagnostics for silent cron automation turns whose tool actions succeeded; real failures (tool errors, provider errors, timeouts) still report as errors.Evidence
required/unspecified expectation → still error path; tool-error, error-stop, and aborted variants → still error; fullrunEmbeddedAgentrun assertsNO_REPLYpayload, nometa.error,terminalReplyKind: "silent-empty".node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run.incomplete-turn.test.ts→ 1 file, 157 tests passed.git diff --checkclean.