[codex] Reproduce session stall and restart drain bugs#61225
Conversation
Greptile SummaryAdds three intentionally-failing regression tests for two user-facing auto-reply bugs: preflight compaction starting before a run is registered as active (blocking Confidence Score: 5/5Safe to merge — all findings are P2 style suggestions with no impact on test correctness or runtime behavior. The PR only adds intentionally-failing regression tests with no production code changes. The single finding is a P2 model-constant naming preference (claude-opus-4-6 vs. sonnet-4.6) that does not affect how the test runs or fails. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts
Line: 642
Comment:
**Prefer `sonnet-4.6` for Anthropic test model constants**
Per project guidelines, tests should use `sonnet-4.6` rather than `claude-opus-4-6` for Anthropic model examples.
```suggestion
defaultModel: "anthropic/sonnet-4.6",
```
**Context Used:** CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Merge branch 'main' into codex/repro-ses..." | Re-trigger Greptile |
| sessionStore: { [sessionKey]: sessionEntry }, | ||
| sessionKey, | ||
| storePath, | ||
| defaultModel: "anthropic/claude-opus-4-6", |
There was a problem hiding this comment.
Prefer
sonnet-4.6 for Anthropic test model constants
Per project guidelines, tests should use sonnet-4.6 rather than claude-opus-4-6 for Anthropic model examples.
| defaultModel: "anthropic/claude-opus-4-6", | |
| defaultModel: "anthropic/sonnet-4.6", |
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts
Line: 642
Comment:
**Prefer `sonnet-4.6` for Anthropic test model constants**
Per project guidelines, tests should use `sonnet-4.6` rather than `claude-opus-4-6` for Anthropic model examples.
```suggestion
defaultModel: "anthropic/sonnet-4.6",
```
**Context Used:** CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 182f65f41e
ℹ️ 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".
| tokensAfter: 8_000, | ||
| }, | ||
| }); | ||
| await runPromise; |
There was a problem hiding this comment.
Avoid unbounded wait on stalled run in regression test
The new /stop regression can leave runReplyAgent(...) unresolved when the preflight-compaction bug is present, but this finally block always awaits runPromise; that turns the expected red assertion into a hanging test process instead of a deterministic failure. Running this case locally required an external timeout (timeout 35s ..., exit 124), which means CI can stall on this test rather than report the regression cleanly.
Useful? React with 👍 / 👎.
* Tests: reproduce session stall and drain bugs * Docs: add reply lifecycle unification plan * Docs: lock down reply lifecycle plan * Delete docs/experiments/plans/reply-lifecycle-unification.md --------- Co-authored-by: Onur <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…law#61225)" (openclaw#61265) This reverts commit 13aebf5.
* Tests: reproduce session stall and drain bugs * Docs: add reply lifecycle unification plan * Docs: lock down reply lifecycle plan * Delete docs/experiments/plans/reply-lifecycle-unification.md --------- Co-authored-by: Onur <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…law#61225)" (openclaw#61265) This reverts commit 78b6ff5.
* Tests: reproduce session stall and drain bugs * Docs: add reply lifecycle unification plan * Docs: lock down reply lifecycle plan * Delete docs/experiments/plans/reply-lifecycle-unification.md --------- Co-authored-by: Onur <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…law#61225)" (openclaw#61265) This reverts commit 783662c.
* Tests: reproduce session stall and drain bugs * Docs: add reply lifecycle unification plan * Docs: lock down reply lifecycle plan * Delete docs/experiments/plans/reply-lifecycle-unification.md --------- Co-authored-by: Onur <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…law#61225)" (openclaw#61265) This reverts commit 96a0151.
* Tests: reproduce session stall and drain bugs * Docs: add reply lifecycle unification plan * Docs: lock down reply lifecycle plan * Delete docs/experiments/plans/reply-lifecycle-unification.md --------- Co-authored-by: Onur <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
…law#61225)" (openclaw#61265) This reverts commit 68e71c4.
Summary
This PR adds failing regression tests for two user-facing auto-reply bugs in external chat channels.
It does not fix the bugs yet. The follow-up work will land the production changes in this same PR.
Bugs Reproduced
/stopcannot abort it and the channel appears stuck./newduring gateway restart/drain sends✅ New session startedtoo early and then surfaces a generic failure instead of a restart-specific reply.User Impact
/stop./new.Tests Added
src/auto-reply/reply/agent-runner.misc.runreplyagent.test.tslets /stop abort a run that is still in preflight compactionsrc/auto-reply/reply/get-reply-run.media-only.test.tsdoes not emit a reset notice when /new is attempted during gateway drainsrc/auto-reply/reply/agent-runner-execution.test.tsreturns a restart-specific error when the gateway is drainingValidation
Current result: intentionally red with 3 failing regressions.