fix(cron): preserve action-critical command output#96358
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 6:03 AM ET / 10:03 UTC. Summary PR surface: Source +220, Tests +57. Total +277 across 5 files. Reproducibility: yes. by source inspection: current main tail-truncates command output before building cron summaries, and the wait/delivery paths consume that summary. I did not run a live cron job because this review is read-only. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a combined or sequenced fix that preserves action-critical lines only after cron announce/webhook delivery sanitizes them, with focused tests and one real cron proof. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main tail-truncates command output before building cron summaries, and the wait/delivery paths consume that summary. I did not run a live cron job because this review is read-only. Is this the best way to solve the issue? No, not as currently mergeable: preserving action-critical lines is the right repair direction, but this branch must also sanitize or avoid non-interactive delivery before those lines are added to summaries. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8242923fe393. Label changesLabel justifications:
Evidence reviewedPR surface: Source +220, Tests +57. Total +277 across 5 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Closes #96346
Draft safety note: this should stay draft until #95809, or an equivalent cron announce/webhook redaction change, lands. This PR preserves action-critical command output in the stored/interactive summary; current main still sends command summaries to non-interactive delivery paths.
What Problem This Solves
Fixes an issue where users waiting on cron command results could lose one-time setup or authentication instructions when
outputMaxBytestail truncation drops early stdout/stderr lines.That made device-code flows unactionable: the result could keep filler output while omitting the short code or next-action line needed to complete auth.
Why This Change Was Made
The command runner now uses a small action-critical output classifier for device-login URLs, local callback URLs, setup codes, and explicit next-action instructions.
runCommandWithTimeoutkeeps its existing bounded tail behavior by default, but accepts an explicit boundedpreserveOutputLinehook so cron command summaries can include matched earlier lines, the tail, and a run-history recovery hint.This does not duplicate the non-interactive redaction work in #95809. The PR is intentionally draft until that boundary is covered.
User Impact
Users who run a cron command and wait for the result can still see short auth/setup lines even when later output is large enough to trigger truncation. Output capture remains bounded for ordinary command output.
Evidence
#96346, the final title,src/cron/action-critical-output.ts,src/process/exec.ts preserveOutputLine,src/cron/command-runner.ts,login.microsoft.com/device, and the recovery wording. No overlapping PR was found; fix(cron): redact command output in delivery #95809 remains adjacent redaction-only work.node scripts/run-vitest.mjs src/cron/command-runner.test.ts src/process/exec.no-output-timer.test.tsnode scripts/run-vitest.mjs src/process/exec.test.ts src/cron/run-diagnostics.test.ts src/gateway/server-cron.test.tsnode_modules/.bin/oxfmt --check --threads=1 src/cron/action-critical-output.ts src/process/exec.ts src/cron/command-runner.ts src/process/exec.no-output-timer.test.ts src/cron/command-runner.test.tsgit diff --checkKnown proof gap: no live cron service restart/run was performed in this local environment. The regression coverage uses synthetic device-code output and validates the affected command runner/process capture boundaries.