Add passive mesh context awareness — observe channel traffic, inject into LLM prompts

New context.py module: ring buffer (50K hard cap, ~25MB ceiling) passively
records all channel broadcasts. Observations are formatted with relative
timestamps and injected into the system prompt when generating LLM responses.
Only public channel traffic is observed; DMs to the bot are excluded (already
in per-user history). Bot's own node ID is auto-added to ignore list.

Config: context.enabled, observe_channels, ignore_nodes, max_age, max_context_items
TUI: new Context settings submenu (menu item 7)
Hourly prune removes expired observations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-02-24 22:02:42 +00:00
commit 63a2caad37
7 changed files with 302 additions and 12 deletions

View file

@ -43,6 +43,13 @@ memory:
window_size: 4
summarize_threshold: 8
context:
enabled: true
observe_channels: []
ignore_nodes: []
max_age: 2592000
max_context_items: 20
llm:
backend: openai
api_key: ""