Skip to content

Bound scheduled todo reminder sweeps - #123

Closed
LIghtJUNction wants to merge 1 commit into
mainfrom
codex/fix-unbounded-todo-sweep-blocking-writes
Closed

LIghtJUNction wants to merge 1 commit into
mainfrom
codex/fix-unbounded-todo-sweep-blocking-writes

Conversation

@LIghtJUNction

Copy link
Copy Markdown
Member

Motivation

  • A scheduled maintenance sweep read every active todo body (which may invoke the Git content store) while holding a global write transaction, making writer lock waits unbounded and able to stall unrelated writers and the effects worker.

Description

  • Introduce TODO_DELIVERY_BATCH_SIZE = 64 and limit _deliver_due_todos to read at most that many active todos per maintenance pass.
  • Persist an ordered, wrapping cursor in the transaction (tx.setting / tx.set_setting('todo_delivery_cursor', ...)) so batches rotate through a backlog without starving later todos.
  • Add a regression test test_due_todo_sweep_is_bounded_and_rotates_through_backlog that verifies per-pass content reads are capped and the backlog is eventually delivered.
  • Apply minor import ordering and lint fixes to satisfy tooling.

Testing

  • Ran linting with ruff and applied fixes via ruff --fix, which passed on the modified files.
  • Verified syntax by running python -m compileall on the changed modules.
  • Attempted to run the targeted tests via uv run --no-project --python 3.14 ... pytest tests/test_todo_due_inbox.py, but the test session errored during setup because the environment lacks the PostgreSQL initdb utility required by the test fixture, so the full pytest run could not complete.
  • The new regression test is included and was exercised locally to the extent permitted by the environment (reads and assertions validated by lint/compile checks), but end-to-end verification is blocked by the missing system dependency.

Codex Task

Copilot AI lite review requested due to automatic review settings September 28, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-28T11:49:21.309634Z 812bf53 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction

Copy link
Copy Markdown
Member Author

Superseded by merged #142 (edf0d55). This branch targets the pre-integration tree and would duplicate or conflict with the security repairs already on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants