Skip to content

fix: event-driven local listeners and permission-safe remote recovery - #242

Merged
LIghtJUNction merged 3 commits into
mainfrom
fix/listener-reliability-events
Oct 12, 2026
Merged

LIghtJUNction merged 3 commits into
mainfrom
fix/listener-reliability-events

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Implemented

  • Linux local listeners subscribe to native file events before reading the mailbox. Each reader has an independent descriptor and durable cursor. SQLite remains the source; notifications contain no bodies. Overflow causes a reread; a lost watch fails explicitly.
  • Explicit --wait-mode auto|events|poll. Remote auto is bounded adaptive HTTP polling, not push. Fixed polling remains available. Unchanged checkpoints no longer cause repeated idle writes/fsyncs.
  • Remote version-2 checkpoints store page-start cursors and processed IDs, not private bodies. Restart rereads under current permissions. Old mailbox caches become ID references before reauthorization. Old account-event caches without a safe reread fail closed, with migration instructions.
  • Reject hard-linked checkpoints; validate event IDs and limits. Delivery remains at least once, not a task ACK or an exactly-once execution guarantee.
  • Add real SIGKILL fault injection, account/context and same-account limited/revoked-credential regressions, signed in-process HTTP request counts with PostgreSQL, and a reproducible local serial/concurrent benchmark against the actual old listener at 459f3f7be28eaa2f5639669d05add2a342bab20f.
  • Update the subagent/offline guides and add docs/LISTENER_BENCHMARKS.md. Integrate main at 8070d65, preserving its new collaboration skills, Pi integration, and private-config exclusions.

Final-commit validation

Head: 8d3f06d69072693f45e561b36bcf4e3c725b9259.

Listener run 38322756736 passed on this exact commit: 87 tests, zero errors/failures/skips, Python 3.15 and PostgreSQL 16. The benchmark also completed. Artifact listener-reliability-8d3f06d69072693f45e561b36bcf4e3c725b9259 contains the exact source, commit, JUnit, local JSON and remote JSON.

Python quality run 38322760502 passed: zero Ruff findings and exact formatting. The initial callback-binding findings were fixed without relaxing checks. Other repository-wide workflows were still running or queued at final review; this is not an assertion that all repository CI has finished.

Baseline 38319245219: 49 existing tests passed before code changes. Initial implementation 38321407285, commit a6263ab: 87 passed. The documentation's historical measurements are explicitly tied to that initial run; do not mix them with the final run below.

Final-run observations, not a harness ranking

Three seeded eight-task synthetic trials, real local SQLite mailbox operations. CI uses shortened 0.1-second polling and 0.4-second idle windows, not default settings. Values are arithmetic means across the applicable trials.

Measurement Native local events Actual old listener
Eight tasks, one worker 0.401024 s 0.837090 s
Eight tasks, four workers 0.135516 s 0.217886 s
Four-worker per-trial median result-observation delay, averaged 2.178982 ms 65.633476 ms
Additional reads in each idle window 0 3
Process CPU in each idle window, averaged across six runs 0.139948 ms 4.824171 ms
HTTP attempts in local runs 0 0

Absolute batch time improved in this sample. Improved parallel scaling is not established: mean serial/parallel speedups were 2.984 and 3.842 respectively. The measured workload uses concurrent sleep tasks, not real LLM or CPU-bound coding tasks.

In the final remote idle pair, fixed polling and adaptive polling both started 8 HTTP requests and completed 2 inbox reads. Windows were 2.020 and 2.219 seconds; client-plus-server process CPU was 1.495 and 1.502 seconds. Thus this short final sample does not demonstrate fewer requests or lower CPU. The initial run's 14-vs-10 observation was not consistently repeated. This in-process HTTP experiment is not a WAN, steady-state cost, or remote completion-time benchmark.

All three real SIGKILL phases recovered the three expected message IDs. The after-flush/before-checkpoint phase had one expected replay. This checks message delivery, not arbitrary consumer side effects.

Unfinished comparisons and limits

Remote native events are not implemented. Native harness comparisons, real LLM task completion, and token measurements were not performed. There is no cross-harness ranking. Remote backoff trades fewer possible idle reads for longer idle-to-message delay; it does not remove HTTP polling. Local labels are not an isolation boundary for untrusted processes sharing one OS user. Already delivered plaintext cannot be revoked. Consumers must persist work, deduplicate task IDs, and make side effects idempotent.

Ten-minute periodic polling has a five-minute mean extra delay only under uniform completion times. This is a mathematical model, not a measured harness result. No production deployment or merge to main was performed.

Keep remote checkpoints free of message bodies, bound idle polling, and measure
actual mailbox/HTTP costs without claiming a cross-harness ranking. Add real
SIGKILL recovery and scoped-credential regression tests.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 23:18
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

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.

Bind retry callbacks explicitly, apply the pinned Ruff formatting, and document
measured local/remote costs without a native-harness performance ranking.

Integrate main at 8070d65, preserving the new collaboration skills, Pi submodule
and private configuration exclusions. No merge to main or production deployment.
@LIghtJUNction
LIghtJUNction merged commit 3be2574 into main Oct 12, 2026
20 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants