test(#5572): cover messaging clear watermark semantics - #5589
3 commits merged into
Conversation
🔬 Gate certification — GREEN ✅ (test-only: meaningful messaging-clear regression coverage)Certified head: What I ran (rebased worktree
|
| Gate | Result |
|---|---|
| Rebase onto current master | ✅ git apply clean; diff = one new tests/ file only (test-only, no shipped code) |
| Codex (meaningfulness/accuracy) | SAFE TO SHIP — 0 findings (real clear path + assertions, not vacuous/over-mocked, accurate regression lock) |
| The new file | ✅ 2/2 pass (real Session load/clear, concrete assertions) |
| Related messaging/clear/session subset (#5572/#5532/#5570/messaging) | ✅ 63 passed (no collision/duplication) |
Findings
✅ Meaningful + accurate: the tests exercise /api/session/clear on an imported messaging session and assert real loaded state — preserves source_tag/raw_source/session_source=="messaging"/source_label/is_cli_session while zeroing messages==[]/context_messages==[]/tool_calls==[]/truncation_watermark==0.0/truncation_boundary==0.0, and locks that state.db replay is blocked. Concrete assertions on a real re-loaded Session (not a mock), sqlite/tmp-isolated, no flakiness. Codex confirmed the assertions match current clear semantics (accurate regression lock, not encoding a wrong expectation) and it doesn't duplicate/conflict with the existing #5532/#5570 tests. This locks in exactly the messaging-clear behavior that the #5504/#5556 findings care about — good defensive coverage.
Recommendation to the next agent
Ready to merge — use branch gate-rebase/5589-messaging-clear-test (sha:9a213c92), NOT the PR's stale head cc7896cf. Pure test-only regression coverage for messaging-clear watermark semantics (#5572), meaningful (real clear path + concrete assertions, not vacuous), Codex SAFE, 2/2 + 63 related tests pass, no shipped-code risk. This is the mergeable-autonomously test-only class. concept 4/5 (locks a behavior the clear-family bugs touched — valuable regression net). Author @rodboev (T1). crit=2.
Gate-certifier layer (warm-up → gate → release). I do not merge/tag/deploy. Rebased onto current master; verified test-only (one new tests/ file, no shipped code) + meaningful (real /api/session/clear on imported messaging session, concrete assertions on re-loaded Session state, not vacuous/over-mocked), Codex SAFE + 2/2 + 63 related messaging/clear tests pass (no collision). Cert valid for sha:9a213c92.
866a25b
…teway approval docs (nesquena#5549), utf-8 test reads (nesquena#5537), messaging-clear watermark test (nesquena#5589) + CHANGELOG
|
Shipped in v0.51.886. Thanks @rodboev for the messaging clear-watermark regression coverage. 🙏 |
Thinking Path
What Changed
tests/test_issue5572_messaging_clear_semantics.py: adds focused coverage for imported messaging clear semantics, the0.0clear watermark, state.db replay suppression, and external transcript preservation.Why It Matters
Imported messaging sessions should keep their channel-owned transcript intact even when the WebUI-visible sidecar is cleared. The tests make that boundary explicit so future clear-session changes cannot blur ownership again.
Verification
python -m pytest tests/test_issue5572_messaging_clear_semantics.py -v --timeout=60 python scripts/ruff_lint.py --diff origin/masterFull-suite CI context, not a required local check unless requested:
python -m pytest tests/ -v --timeout=60.Upstream
Closes #5572.
Model Used
GPT 5.5 via Codex CLI