Repository navigation
Fix/cron announce no reply - #65016
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e57cfa281
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR fixes the production bug where cron announce deliveries containing NO_REPLY" Confidence Score: 5/5Safe to merge; core delivery logic is correct for all described cases and prior P0/P1 concerns have been resolved. All remaining findings are P2: a minor state-sync inconsistency between synthesizedText and deliveryPayloads after stripping (delivery itself is unaffected), and a behavioral asymmetry vs the normalize-reply.ts single-strip pattern. Neither blocks correctness. src/cron/isolated-agent/delivery-dispatch.ts — review the synthesizedText/deliveryPayloads state-sync issue after the strip loop in finalizeTextDelivery() Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/cron/isolated-agent/delivery-dispatch.ts
Line: 694-700
Comment:
**`synthesizedText` stripped but `deliveryPayloads` not updated**
After the while-loop trims `synthesizedText` (e.g. `"Summary"` from `"Summary\n\nNO_REPLY"`), `deliveryPayloads` still holds the original unstripped text (set via lines 644–647 or 655–656 in the subagent/descendant branches). `deliverViaDirect()` then re-strips from `deliveryPayloads`, so the *delivery* is correct, but the `DispatchCronDeliveryState` returned to callers ends up with inconsistent `synthesizedText` (stripped) vs `deliveryPayloads` (unstripped). Any caller that inspects `deliveryPayloads` for logging, replay, or audit purposes would see the raw unstripped text. Keeping them in sync here avoids the drift.
Alternatively, simply update `deliveryPayloads = [{ text: synthesizedText }]` after the strip loop completes, similar to the assignment pattern already used in the subagent-followup branches above.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/cron/isolated-agent/delivery-dispatch.ts
Line: 459-461
Comment:
**While-loop is more aggressive than the `normalize-reply.ts` single-call pattern**
`normalize-reply.ts` calls `stripSilentToken` exactly once, so `"Summary NO_REPLY NO_REPLY"` would survive as `"Summary NO_REPLY"` through the auto-reply path. The while-loop here (and in `stripAndClassifyReply`) fully strips all trailing tokens, which is actually *more* correct, but it creates a behavioral asymmetry between the cron and direct-reply paths. The PR description says it "mirrors normalize-reply.ts logic", but the while loop is a divergence. It's worth either aligning `normalize-reply.ts` to also loop, or documenting the intentional difference so a future reviewer doesn't "simplify" one path to match the other and accidentally introduce a regression.
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/cron-announ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a130f80945
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
obviyus
left a comment
There was a problem hiding this comment.
This is close, but one regression on current head blocks merge.
src/agents/subagent-announce.ts:400 now treats an empty reply after NO_REPLY stripping as an early silent return when there is no non-silent fallback. That changes existing behavior outside the cron NO_REPLY bug: subagent completions that previously announced (no output) now disappear entirely.
This is a real behavior change, not just a comment/test mismatch. Existing coverage expects the (no output) completion announcement path, so this needs to be preserved while still stripping mixed-content NO_REPLY tokens.
Once that is fixed, the main cron-path change looks reasonable.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb46e7f4c2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@greptileai review again |
|
CI failures are in doctor-config-flow.test.ts and doctor-legacy-config.migrations.test.ts — unrelated to this PR. These tests fail on assertions about config migration return types ({ mode: 'partial' } vs true), not in any file this PR touches. Happy to rebase once these are resolved on main. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8d9da97e0
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a64fdd4b07
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 818b063355
ℹ️ 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".
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbf904d06c
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b22a4a4315
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de9e2eb274
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d88d630a74
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 679caae1c3
ℹ️ 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".
Summary
NO_REPLYwhen it is the exact/entire response (isSilentReplyText). When the agent prepends summary text beforeNO_REPLY, the full response is delivered to the target channel.NO_REPLYbut were delivered anyway. Every user with announce-mode crons usingNO_REPLYsuppression hits this.NO_REPLYtoken stripping from the auto-reply path (normalize-reply.ts, PR fix(auto-reply): strip leading NO_REPLY tokens to prevent silent-reply leak #63068) into the cron announce delivery path. Three locations:deliverViaDirect()andfinalizeTextDelivery()indelivery-dispatch.ts, andrunSubagentAnnounceFlow()insubagent-announce.ts.isSilentReplyTextexact-match checks are preserved. No changes to the auto-reply path, token definitions, or cron scheduling logic. No new functions — only imports of existing helpers.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
startsWithSilentToken/stripLeadingSilentToken/stripSilentTokento the auto-reply path but the cron announce delivery path was not updated. It still uses onlyisSilentReplyText(exact match).NO_REPLYmixed with other text in cron announce delivery.NO_REPLY, making the exact-match check insufficient in practice.Regression Test Plan (if applicable)
src/cron/isolated-agent/delivery-dispatch.test.ts"All items processed.\n\nNO_REPLY"→ delivery suppressed (not delivered to channel)normalize-reply.test.ts.node_modulesinstalled locally to run the test suite. Happy to add a test if maintainers prefer — the pattern exists innormalize-reply.test.ts.User-visible / Behavior Changes
Cron announce deliveries containing
NO_REPLYmixed with other text will now be stripped or suppressed, matching the behavior of the direct-reply path. Users who previously received false deliveries withNO_REPLYembedded in the text will no longer receive them.Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
--announce --channel discord --to "channel:xxx"Steps
openclaw cron add --name "Test" --cron "*/5 * * * *" --session isolated --message "Check X. If nothing actionable, reply NO_REPLY" --announce --channel discord --to "channel:xxx"NO_REPLYExpected
NO_REPLYActual
Evidence
15 cron deliveries over 8 days from production instance, 14 contained
NO_REPLYin the response text but were delivered to Discord/WhatsApp. Pattern: agent writes summary, appendsNO_REPLY. Delivery system did not recognize it as suppression becauseisSilentReplyTextonly matches exact/whole-string.Human Verification (required)
isSilentReplyTextis the only check indelivery-dispatch.tsandsubagent-announce.ts. ConfirmedstartsWithSilentToken/stripLeadingSilentToken/stripSilentTokenexist insrc/auto-reply/tokens.tsand are not imported in the cron path. Verified the diff applies the same pattern asnormalize-reply.ts.finishSilentReplyDelivery(). Payloads with content after stripping are preserved. Existing exact-match checks are not altered.node_modulesinstalled locally. Did not verify against a running gateway.Review Conversations
Compatibility / Migration
Risks and Mitigations
NO_REPLYfrom mixed-content responses could remove the token but still deliver text the user intended to suppress entirely.NO_REPLY, delivering the substantive text (with the token stripped) is the safer default. Full suppression only occurs when the entire response isNO_REPLY.