Skip to content

feat: store watcher fallback for dispatcher#34

Merged
Oaklight merged 1 commit into
masterfrom
worktree-feat+33-store-watcher
Apr 8, 2026
Merged

feat: store watcher fallback for dispatcher#34
Oaklight merged 1 commit into
masterfrom
worktree-feat+33-store-watcher

Conversation

@Oaklight

@Oaklight Oaklight commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #33.

  • When the poll lock is held by another process (e.g. MCP server), the dispatcher now watches SQLite for new messages instead of polling iLink directly
  • on_message handlers and run_background() work alongside the MCP server without any code changes
  • Adds max_rowid() / query_since_rowid() to MessageStore, _store_watch_loop() and _dispatch_messages() to WeiLink

Test plan

  • 12 new tests in tests/test_store_watcher.py — all pass
  • Full test suite: 404 passed
  • ruff check + ruff format + ty check all clean

When the poll lock is held by another process (e.g. MCP server),
the dispatcher now watches SQLite for new messages instead of
polling iLink directly. This allows on_message handlers and
run_background() to work alongside the MCP server.

- Add max_rowid() and query_since_rowid() to MessageStore
- Add _store_watch_loop() as fallback dispatcher target
- Extract _dispatch_messages() to share logic between poll and watch loops
- _start_dispatcher() auto-detects poll lock state and chooses strategy
@Oaklight
Oaklight merged commit a647781 into master Apr 8, 2026
7 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.

Dispatcher fallback: store watcher when poll lock is held

1 participant