Изменение Hermes
feat(gateway): opt-in prompt-cache notifications and Telegram pin
Исходный PR автора в Hermes. Описание и обсуждение — на английском в источнике.
Это изменение Hermes из исходного PR. Статус и обсуждение доступны в исходном PR; включение в релиз проверяется отдельно.
Данные GitHub проверены:
Состояние PR
Открыт — предложение
Включение PR в релиз не проверено
Источник: GitHub
feat(gateway): opt-in prompt-cache notifications and Telegram pin
## Summary
Extend the prompt-cache visibility introduced in #161103 to messaging conversations. That foundational PR by @teknium1 added the shared cache deadline and CLI/TUI/Desktop indicators plus `/usage`. This PR reuses that clock; it does not implement another cache policy or warm the cache.
- `/usage cache notify`: opt-in state-change notifications.
- `/usage cache pinned`: one updated Telegram message, quietly pinned where permitted; falls back to notifications when pinning is unsupported or denied.
- `/usage cache off`: default; ordinary messaging remains unchanged.
Status is an estimate, not a provider cache-hit or billing guarantee. Unknown and cold are distinct. Text labels and timestamps make the status usable without relying on icons or color.
## Safety and lifecycle
- No model requests or model-context modifications for status updates.
- Session/profile/receiving-bot/chat/topic isolation and explicit group administrator authorization.
- Durable message claims avoid duplicate sends after ambiguous transport outcomes; this deliberately favors a missed notification over a duplicate.
- Bounded edit retries preserve server cooldowns and retry budgets across restart.
- Revalidate status and deadline after asynchronous persistence, before sending/editing; session-ID fencing prevents stale metadata writes across reset.
- Restore enabled transport slots without restart-only notification spam. Do not repeatedly pin messages users unpin; no replacement-pin loop after deletion.
- Side messages preserve native stream-final behavior. Shutdown cancels watchers. Errors remain isolated from normal replies.
## Verification
Independent review identified defects that were reproduced in regression tests, repaired, and independently re-reviewed with an ACCEPT verdict.
- Fresh independent canonical runner: 47 passed in four feature/Telegram files; 35 passed in four additional usage, multiplex, clock and stream-final files (82 total, no failures).
- Separate author/parent selected run: 92 passed, 2 failed including the shutdown file. The same two `test_start_gateway_turns_a_failed_stop_into_an_exit_verdict[stop/service_restart]` cases also fail on the pristine base (18 passed, 2 failed in that file). These are disclosed, not counted as green or repaired here.
- `scripts/check --base HEAD` on the pre-commit candidate: all 22 checks passed; boundary lint and `git diff --check` passed.
- Race/restart regression probes were demonstrated failing before their corresponding repairs, then passing.
- Tests use isolated session stores and fake transport effects through the real Telegram adapter. No live Telegram or provider test is claimed; upstream CI is pending.
## Privacy
Reviewed the complete 14-file candidate and scanned for secrets, private host paths and personal identifiers before publication. No runtime configuration, credentials, chat history, logs or local planning files are included. Commit uses a GitHub noreply identity.
Maintainer context: @teknium1 — this is a messaging-surface follow-up to your #161103, not a change to its warming behavior.
Изменённые файлы (14)
gateway/messaging_cache_indicator.pygateway/platforms/base.pygateway/run_bootstrap.pygateway/run_shutdown.pygateway/session.pygateway/slash_commands_status.pylocales/en.yamlplugins/platforms/telegram/adapter.pyplugins/platforms/telegram/message_pinning.pytests/gateway/test_messaging_cache_final_review_races.pytests/gateway/test_messaging_cache_indicator.pytests/gateway/test_messaging_cache_review_probes.pytests/plugins/test_messaging_cache_telegram.pywebsite/docs/user-guide/messaging/index.md
Темы этого объекта
Помощь с этой задачей
ИИ-консультация и workflow-разбор
Диагностика процесса, узких мест, рисков и ROI: что стоит автоматизировать, где нужен агент, а где проще оставить ручной контроль.
Обсудить задачуУстановка и настройка ИИ-агента под бизнес-задачу
Агент под конкретный процесс: источники данных, правила, проверки качества, безопасные границы автономности и сопровождение.
Обсудить задачуTelegram-боты, backend, API и автоматизация
Реализационный слой после диагностики: боты, API, интеграции, мониторинги, внутренние панели и self-hosted инструменты на Node.js.
Обсудить задачу