Repository navigation
fix(daemon): keep Codex append identity hot - #1461
Conversation
Problem: live catch-up could fall back to full-file replay for a hot Codex session when the latest conversation identity for that source path was linked through an append-only raw record. That path is valid convergence state, but the planner filtered it out and then treated the next tail as requiring full ingest.\n\nWhat changed: Codex append identity lookup now accepts any conversation linked to the source path, including append-only raw records. A regression seeds that exact archive shape and asserts append planning still produces a bounded tail plan with the Codex session metadata prefix.\n\nVerification: pytest tests/unit/sources/test_live_batch_support.py tests/unit/sources/test_live_catchup_planning.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_live_hot_session_convergence.py -q; ruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py; mypy polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py; devtools verify --quick.\n\nRef #1447
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 46 minutes and 18 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 774cb9da8f
ℹ️ 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".
Live full ingest now suspends FTS triggers at the same 8 MiB threshold where it already switches to streaming blob ingestion. Large same-size source rewrites still fully converge, but they use one bounded FTS repair at commit instead of per-row trigger churn.\n\nThis follows live #1447 evidence after #1461: append-planned hot Codex tails were fixed, but an 18 MiB same-size full replay in a 37.8 MiB chunk still drove read_bytes past 24 GB and hit database locking.\n\nVerification:\n- pytest tests/unit/sources/test_live_batch_support.py -q\n- ruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py\n- mypy polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py\n- devtools verify --quick\n- PR checks: Analyze (python), CodeQL, container builds, GitGuardian, CodeRabbit\n\nRef #1447
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Codex live append planning now accepts an existing conversation identity even when that conversation is currently linked through an append-only raw record. This prevents hot long-running sessions from falling back to full-file replay when the archive has already converged through append ingest.
Problem
Live deployment of #1460 through Sinnix still showed unsafe catch-up behavior under #1447. The daemon replayed an 81 MB Codex file as ~10.5k changed messages and then started a 234 MB full replay. Inspection of the 234 MB source showed the append planner returned
Nonebecause_existing_provider_conversation_id()filtered outraw_conversations.source_index = -1; the only linked conversation identity for that path came from an append raw record, so the planner treated the next tail as requiring full ingest.Solution
Remove the full-raw-only filter from Codex conversation identity lookup. Append-only raw records are valid convergence state for source identity, and using them preserves full daemon scope while keeping hot-session catch-up on the bounded append path. A regression seeds the exact archive shape and asserts
_append_plan()produces a bounded Codex append payload with the session metadata prefix.Verification
pytest tests/unit/sources/test_live_batch_support.py -q-> 13 passedpytest tests/unit/sources/test_live_batch_support.py tests/unit/sources/test_live_catchup_planning.py tests/unit/sources/test_live_watcher.py tests/unit/sources/test_live_hot_session_convergence.py -q-> 81 passedruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py-> passedmypy polylogue/sources/live/batch.py tests/unit/sources/test_live_batch_support.py-> passeddevtools verify --quick-> exit_code 0, total_duration_s 37.29devtools verify --quick-> exit_code 0, total_duration_s 34.94/home/sinity/.codex/sessions/2026/05/16/rollout-2026-05-16T13-50-17-019e309f-7614-7381-a8ac-f9080f304ee6.jsonl: before fix_append_plan()returnedNone; after fix it returns_AppendPlanwithstart=232985578,last=234554166,bytes_read=1568588,payload_len=1568668.Ref #1447