cron: keep failure destination for threaded delivery#43808
Conversation
Greptile SummaryThis PR fixes a gap where The fix is well-scoped and consistent:
One minor observation worth awareness: Confidence Score: 5/5
Last reviewed commit: 28de381 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28de381c84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ee06f72 to
68d52bd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68d52bd32f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
One remaining blocker appears to be infra-only.
I also re-ran the targeted tests locally on the rebased head:
Could a maintainer rerun the failed Windows shard or the workflow? |
|
@tyler6204 this is ready on the rebased head The only remaining red check is Could you rerun that failed Windows shard or the workflow when you have a moment? |
68d52bd to
656eb1d
Compare
|
Follow-up pushed in Alex-Alaniz@656eb1d. This addresses the remaining threadId gap in two places:
Local verification:
|
|
The remaining red Evidence:
I’m leaving those CSS files out of this PR to keep the scope on the cron fix. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: current main still has the source-level cron failure-destination dedupe gap, and this PR is a focused repair with sufficient terminal proof, but the head is now merge-conflicting and needs adaptation to the newer delivery-target routing code before merge. Canonical path: Close this PR as superseded by #31059. So I’m closing this here and keeping the remaining discussion on #31059. Review detailsBest possible solution: Close this PR as superseded by #31059. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main still compares failure destinations without Is this the best way to solve the issue? Yes, after rebase. The proposed direction is the narrow owner-boundary fix, but it must be adapted to current main's newer delivery-target/session-route implementation before merge. Security review: Security review cleared: The diff changes cron routing logic, tests, and changelog text without new dependencies, workflow permissions, secret handling, downloads, or execution surfaces. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 45fbf2d81a0e. |
656eb1d to
80e0167
Compare
80e0167 to
21c07ca
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21c07ca88b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -223,6 +224,7 @@ function isSameDeliveryTarget( | |||
| return ( | |||
| failureChannelNormalized === primaryChannelNormalized && | |||
| failurePlan.to === primaryTo && | |||
| failurePlan.accountId === primaryAccountId | |||
| failurePlan.accountId === primaryAccountId && | |||
| primaryThreadId === undefined | |||
There was a problem hiding this comment.
Preserve dedupe when failure target still resolves same thread
The new primaryThreadId === undefined guard disables deduplication for every threaded primary delivery, but failure destinations without an explicit threadId can still resolve back to the same thread via session-based thread carry (resolveSessionDeliveryTarget/resolveDeliveryTarget keep lastThreadId when to matches). In that case this function now returns false and we send an unnecessary duplicate failure notification to the same effective destination; this regression is triggered whenever a threaded job has a same-chat failure destination and a matching session thread context.
Useful? React with 👍 / 👎.
e43f67c to
e80edd9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e80edd9261
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if ( | ||
| failureChannelNormalized !== primaryChannelNormalized || | ||
| (failurePlan.to !== primaryTo && !failureUsesSessionRecipient) || |
There was a problem hiding this comment.
Don't dedupe channel-only failure destinations
This new comparison path treats a failure destination with channel set but no to as equivalent to an explicit primary recipient, so resolveFailureDestination() can return null even when the fallback would actually send somewhere else. Specifically, when failurePlan.to is undefined, the (failurePlan.to !== primaryTo && !failureUsesSessionRecipient) check is bypassed and same-channel/account targets are deduped; but resolveDeliveryTarget() can still resolve that channel-only fallback to lastTo from session state (which may differ from delivery.to). In jobs with explicit primary targets plus channel-only failure destinations, this can silently suppress legitimate failure alerts.
Useful? React with 👍 / 👎.
|
Added exact-head real behavior proof for the Command run locally on the PR branch head Relevant live output: What this proves:
No code changes in this comment; this is the missing proof requested by ClawSweeper. Re-review progress:
|
8f07f8c to
7f425f9
Compare
|
ClawSweeper PR egg ✨ Hatched: ✨ glimmer Neon Branchling Hatch commandComment Hatchability rules:
Rarity: ✨ glimmer. What is this egg doing here?
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
delivery-planbehavior on currentmain; no cron schema expansion and no local gateway/runtime startup.Change Type
Scope
Linked Issue/PR
User-visible / Behavior Changes
Security Impact
Real behavior proof
threadId.main-based PR branch, using the actualsrc/cron/delivery-plan.tsimplementation throughnode --import tsx. No local gateway or network channel service was started.resolveFailureDestination()and resolves a cron job whose primary delivery istelegramchat111,threadId99, accountbot-a, with a same-chat failure destination.{ "afterFixFailureDestination": { "mode": "announce", "channel": "telegram", "to": "111", "accountId": "bot-a" } }null, so it will not be suppressed as a duplicate of the threaded primary delivery.Verification
PNPM_HOME= COREPACK_ENABLE_PROJECT_SPEC=0 /opt/homebrew/bin/pnpm exec oxfmt --check --threads=1 src/cron/delivery-plan.ts src/cron/delivery.test.ts CHANGELOG.mdPNPM_HOME= COREPACK_ENABLE_PROJECT_SPEC=0 /opt/homebrew/bin/pnpm test src/cron/delivery.test.tsPNPM_HOME= COREPACK_ENABLE_PROJECT_SPEC=0 /opt/homebrew/bin/pnpm test src/cron/delivery.test.ts src/cron/normalize.test.ts src/cron/service/jobs.apply-patch.test.ts src/cron/isolated-agent/delivery-target.test.tsPNPM_HOME= COREPACK_ENABLE_PROJECT_SPEC=0 /opt/homebrew/bin/pnpm test src/gateway/server.cron.test.tsPNPM_HOME= COREPACK_ENABLE_PROJECT_SPEC=0 /opt/homebrew/bin/pnpm check:changedNotes