Skip to content

Fix memory scheduling, Telegram topics, and context diagnostics - #263

Merged
iamwavecut merged 1 commit into
mainfrom
fix/memory-freshness-telegram-context
Oct 15, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
fix/memory-freshness-telegram-context

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Memory backfill can delay fresh windows for hours, stop admitting work at 5,000 queued runs, and leave older history waiting for the next nightly scan. Telegram direct-message topic IDs are also lost across dialog delivery, while oversized LLM requests lose useful context diagnostics when raw-body capture is omitted.

  • Remove the memory queue admission cap and scan all retained completed hours at startup and each hourly tick. Prioritize fresh windows and their continuations ahead of backfill, preserving their priority while they wait. Existing workers continue draining the queue through the current inference lane limits.
  • Carry the 64-bit Telegram direct-message topic ID from ingress through dialog metadata, rich/media delivery, outbox persistence, replay, and topic-scoped deduplication.
  • Persist numeric request and dialog-context shape diagnostics when raw bodies are disabled or exceed the capture limit. Do not add message content, tool arguments, or URLs to these counters.

Validation: tools/rust-fast-gate.sh passed formatting, Clippy across all workspace targets/features, and workspace tests (2,592 passed, 10 ignored). cargo test --locked -p openplotva-storage live_memory_ -- --test-threads=1 passed all five tests against local PostgreSQL 17 with pgvector. The regression admits 5,001 historical windows, then prioritizes a newly admitted fresh window and verifies repeated scans do not duplicate work. Telegram tests cover 64-bit topic IDs, dispatcher propagation, multipart fields, persistence/replay, and deduplication.

Operational changes: MEMORY_MAX_QUEUED_RUNS is obsolete and ignored; admin/telemetry limit fields return null. The full retained history is scanned hourly, but previously enqueued windows are not extracted again. Retention, per-run input limits, retries, and inference concurrency remain in force. No database migration is required. Production verification will check the deployed revision, queue progress, and new diagnostic metadata.

@github-actions

Copy link
Copy Markdown
Warnings
⚠️ Large PR (1065 changed lines). Consider splitting unless this is generated/mechanical.
Messages
📖 Danger checked 38 changed file(s).

Generated by 🚫 dangerJS against 4e0bac8

@iamwavecut

Copy link
Copy Markdown
Owner Author

The size warning is acknowledged. Most affected files propagate the same optional Telegram topic field through existing call sites. Behavioral changes and regression tests are concentrated in memory scheduling/storage, Telegram delivery, and context capture. This PR delivers the three requested runtime fixes together; the full workspace gate and PostgreSQL memory regressions passed.

@iamwavecut
iamwavecut merged commit 2402fe8 into main Oct 15, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the fix/memory-freshness-telegram-context branch October 15, 2026 14:37
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.

1 participant