Skip to content

fix: restart the outbox TTL on polls only - #65

Merged
JarbasAl merged 1 commit into
devfrom
fix/outbox-ttl-counts-polls
Oct 21, 2026
Merged

JarbasAl merged 1 commit into
devfrom
fix/outbox-ttl-counts-polls

Conversation

@openvoiceos-bot

@openvoiceos-bot openvoiceos-bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Auto-generated by Claude Sonnet 5.5 (claude-sonnet-5-5) via Claude Code, reviewed by Claude Opus 5.5 — NOT human-reviewed. Verify before acting.

HIVEMIND-TRANSPORT-1 §4: "the node MUST retain a peer's outbound frames until the peer polls them, until the session closes, or until an implementation-defined retention bound elapses. [...] The implementation MUST document the bound."

The documented bound is undelivered_ttl: the README and docs/architecture.md both say a client that does not poll for that many seconds loses its queue. The code did not match. RetentionQueue.put() reset the idle timestamp, so a client that stopped polling but kept receiving frames was never swept. Only max_undelivered limited it.

put() no longer touches the timestamp. drain() still does, so a poll restarts the clock. The class docstring now says so.

The old test test_an_active_client_survives_the_sweep asserted the buggy behaviour and is replaced. The new test uses a fake clock, sends a frame every second for nine seconds with a 10 second TTL, and checks that the queue is gone once the clock passes 10 seconds with no poll. It fails on the unfixed code and passes with the fix. The test for poll activity puts a frame between polls and asserts that the last poll returns it. It fails when drain() stops restarting the clock. The README and docs/architecture.md now say to keep undelivered_ttl at least ten times the poll interval, because a later poll finds the queue gone and, under protocol v3, the client must reconnect. The full suite passes (109 tests). Ruff reports the same findings as the base on the touched files.
🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ffe6ee46-ea66-4b7b-9d3a-c27e3bd8f801
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the fix label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

I've gathered some intelligence on your latest changes. 🕵️‍♀️

I've aggregated the results of the automated checks for this PR below.

📋 Repo Health

Your repository is in great shape! ✅

✅ All required files present.

Latest Version: 0.0.18a1

✅ hivemind_http_protocol/version.py — Version file
✅ README.md — README
✅ LICENSE.md — License file (consider renaming to LICENSE)
✅ pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
✅ CHANGELOG.md — Changelog
✅ hivemind_http_protocol/version.py has valid version block markers

⚖️ License Check

Checking for any missing license headers. ✍️

✅ No license violations found.

Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed.

🔍 Lint

Just keeping you informed on the state of things. ℹ️

❌ ruff: issues found in 16 file(s) — see job log
✅ actionlint: 10 workflow file(s), no finding

🔒 Security (pip-audit)

I've scanned the dependencies for any hidden surprises. 🔍

✅ No known vulnerabilities found (88 packages scanned).

🔨 Build Tests

I've fired up the furnaces and forged your changes. ⚒️

✅ All versions pass

Python Build Install Tests pytest
3.10 ✅ ✅ ✅ 109 passed, 20 warnings in 7.34s
3.11 ✅ ✅ ✅ 109 passed, 20 warnings in 8.30s
3.12 ✅ ✅ ✅ 109 passed, 20 warnings in 6.15s
3.13 ✅ ✅ ✅ 109 passed, 20 warnings in 4.84s
3.14 ✅ ✅ ✅ 109 passed, 25 warnings in 8.45s

🏷️ Release Preview

Ensuring our release notes are clear and concise. ✍️

Current: 0.0.18a1 → Next: 0.0.19a1

Signal Value
Label fix
PR title fix: restart the outbox TTL on polls only
Bump build

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 0.0.19a1

Channel Status Note Current Constraint
Stable ⚪ Not in channel -
Testing ✅ Compatible hivemind-http-protocol>=0.0.1,<1.0.0
Alpha ✅ Compatible hivemind-http-protocol>=0.0.17a1

📊 Coverage

How well-protected is our logic? Let's find out! 🛡️

✅ 87.5% total coverage

Per-file coverage (2 files)
File Coverage Missing lines
hivemind_http_protocol/__init__.py 87.4% 64
hivemind_http_protocol/version.py 100.0% 0

Full report: download the coverage-report artifact.


Providing clarity through automated analysis 🔍

RetentionQueue.put() refreshed the idle timestamp, so a client that stopped
polling while frames kept arriving was never swept. Only the per-client
frame cap bounded it. The README and docs/architecture.md define
undelivered_ttl as the time a client may go without polling.

put() no longer touches the timestamp; drain() still does. The test that
asserted the old behaviour (a client that only receives survives the
sweep) is replaced by one asserting the documented behaviour.

The test for poll activity puts a frame between polls and asserts the
last drain returns it, so removing the reset in drain() fails it. The docs
say to keep undelivered_ttl at least ten times the poll interval.

Fail-before: the new test fails on the unfixed code (assert 'deaf' not in
store), passes with the fix, and the full suite passes (109).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JarbasAl
JarbasAl force-pushed the fix/outbox-ttl-counts-polls branch from ede7e39 to ad474c8 Compare October 21, 2026 00:58
@github-actions github-actions Bot added fix and removed fix labels Oct 21, 2026
@JarbasAl
JarbasAl marked this pull request as ready for review October 21, 2026 01:03
@JarbasAl
JarbasAl merged commit d283bb9 into dev Oct 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants