Commit Graph

2503 Commits

Author SHA1 Message Date
Ptah.ai 8c43768e27 fix: expose telegram topic names in agent context (#65973) (thanks @ptahdunbar)
* feat(telegram): expose forum topic names in agent context

Telegram Bot API does not provide a method to look up forum topic names
by thread ID. This adds an in-memory LRU cache that learns topic names
from service messages (forum_topic_created, forum_topic_edited,
forum_topic_closed, forum_topic_reopened) and seeds from
reply_to_message.forum_topic_created as a fallback for pre-existing
topics.

The resolved topic name is surfaced as:
- TopicName in MsgContext (available to {{TopicName}} in templates)
- topic_name in the agent prompt metadata block
- topicName in plugin hook event metadata

Includes unit tests for the topic-name-cache module (11 tests including
eviction and read-recency).

Known limitation: cache is in-memory only; after a restart it falls back
to the creation-time name until a rename event is observed.

* refactor(telegram): distill topic name flow

* fix: expose telegram topic names in agent context (#65973) (thanks @ptahdunbar)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-13 23:38:14 +05:30
Mariano Belinky fbdbd998d3 fix(session): clear stale thread route on system events 2026-04-13 19:55:15 +02:00
Mariano 527895f036 Gateway/sessions: preserve shared session route on system events (#66073)
Merged via squash.

Prepared head SHA: 314a93578ec9fce465ca94d0a90d6f642e5e4a05
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-13 19:19:58 +02:00
Vincent Koc df27091f5f fix(auto-reply): avoid leaking inbound debounce cleanup 2026-04-13 16:36:03 +01:00
Vincent Koc 7c91d0dbc9 fix(auto-reply): release inbound dedupe after dispatch errors 2026-04-13 16:34:35 +01:00
Bob 380de88a61 fix: extract shared session status runtime (#65807)
Merged via squash.

Prepared head SHA: f027bd640a7860ee978aaf891cd0f653f9d519f1
Co-authored-by: dutifulbob <261991368+dutifulbob@users.noreply.github.com>
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
Reviewed-by: @osolmaz
2026-04-13 11:51:26 +02:00
Pavan Kumar Gondhi 0a105c0900 fix(approval-auth): prevent empty approver list from granting explicit approval authorization [AI] (#65714)
* fix: address issue

* fix: address PR review feedback

* fix: address PR review feedback

* docs: add changelog entry for PR merge
2026-04-13 12:00:13 +05:30
Peter Steinberger feb8e1e81f fix(test): remove duplicate trace directive fixtures 2026-04-13 00:20:52 +01:00
Peter Steinberger 9dbbee8a02 fix(test): align trace directive type stubs 2026-04-13 00:20:52 +01:00
Peter Steinberger c8347e70da fix: align trace directive types 2026-04-12 11:30:44 -07:00
Peter Steinberger e76c2812b7 style: apply oxfmt 2026-04-12 11:28:43 -07:00
Tak Hoffman c37e49f275 Add /trace toggle and fix Active Memory diagnostics 2026-04-12 13:20:22 -05:00
Vincent Koc 6437aa8532 fix(inbound-meta): unblock Claude CLI and scrub NULs (#65467)
* fix(inbound-meta): rename schema and scrub NULs

* fix(inbound-meta): harden untrusted context blocks

* fix(inbound-meta): preserve fenced metadata blocks

* fix(inbound-meta): cap untrusted context payloads
2026-04-12 18:52:48 +01:00
Daniel Alkurdi 1f0431cd11 fix(media): surface OpenAI audio transcription failures (#65096)
* fix(media): surface audio transcription provider failures

* fix(media): prefer failed reasons in surfaced errors

* fix(media): import attempt outcome type

* fix(media): guard malformed decision arrays

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-12 17:05:18 +01:00
Peter Steinberger 485f4167e1 test(auto-reply): update WhatsApp group prompt expectation 2026-04-12 16:13:18 +01:00
Peter Steinberger 9f09001014 fix(reply): preserve active session state 2026-04-12 16:07:38 +01:00
Vincent Koc 74f31241ed fix(runtime): hide lazy command and context seams from static graph 2026-04-12 12:23:19 +01:00
Tak Hoffman 847739d82c Fix dreaming replay, repair polluted artifacts, and gate wiki tabs (#65138)
* fix(active-memory): preserve parent channel context for recall runs

* fix(active-memory): keep recall runs on the resolved channel

* fix(active-memory): prefer resolved recall channel over wrapper hints

* fix(active-memory): trust explicit recall channel hints

* fix(active-memory): rank recall channel fallbacks by trust

* Fix dreaming replay and recovery flows

* fix: prevent dreaming event loss and diary write races

* chore: add changelog entry for memory fixes

* fix: harden dreaming repair and diary writes

* fix: harden dreaming artifact archive naming
2026-04-12 00:25:11 -05:00
Vincent Koc f2f98d5613 test(auto-reply): share subagent dispatch context 2026-04-12 05:05:18 +01:00
Tak Hoffman 94340b9598 fix(agent-init): move session startup context into the runtime (#65055)
* fix: preload startup memory for bare session resets

* docs: align AGENTS template with startup context runtime

* fix(agent-init): harden startup context prompt handling

* fix(agent-init): tighten startup context parsing and limits

* fix(agent-init): honor calendar-day startup memory windows

* docs: clarify startup daily memory injection
2026-04-11 21:52:16 -05:00
Vincent Koc a767b0c98d test(gateway): consolidate archive import guards 2026-04-12 03:15:50 +01:00
Vincent Koc 159e6bc099 fix(reply): bypass embedded runner barrel for messaging types 2026-04-12 02:59:45 +01:00
Vincent Koc 9aa9c3ff62 fix(auto-reply): stop mention-only inline status turns 2026-04-12 00:19:16 +01:00
Vincent Koc 3059b36306 fix(config): split command flag helpers 2026-04-12 00:05:01 +01:00
Vincent Koc 09a41b2da4 fix(plugin-sdk): untangle tts runtime facade types 2026-04-11 23:58:44 +01:00
Vincent Koc d9357f9f39 fix(cycles): split command detection runtime types 2026-04-11 23:38:35 +01:00
Vincent Koc 10f2e81c04 fix(cycles): split abort runtime resolver types 2026-04-11 23:27:32 +01:00
Vincent Koc 0e8225c4a6 fix(cycles): narrow channel registry imports 2026-04-11 22:59:39 +01:00
Vincent Koc 8470dc8e06 fix(cycles): split reply config runtime seams 2026-04-11 22:52:51 +01:00
Vincent Koc 53fde90dc2 fix(cycles): use loaded channel prompt hints 2026-04-11 22:32:43 +01:00
Vincent Koc 8ec838a0d4 fix(cycles): split session hook event types 2026-04-11 22:25:33 +01:00
Vincent Koc a88fbf0f64 fix(cycles): split reply payload and option contracts 2026-04-11 22:24:55 +01:00
Vincent Koc 25665dd335 fix(runtime): bypass get-reply barrel exports 2026-04-11 21:56:48 +01:00
Vincent Koc 8a9ead6211 fix(reply): bypass heavy error helper imports 2026-04-11 21:47:40 +01:00
Vincent Koc d7fcd23091 fix(runtime): split cli provider and abort seams 2026-04-11 21:16:50 +01:00
Vincent Koc 44f02dbbc6 fix(agents): split effective tool inventory types 2026-04-11 20:24:20 +01:00
Vincent Koc 97b60b992c fix(channels): narrow runtime channel registry caching 2026-04-11 19:12:36 +01:00
Vincent Koc 1ce87cda52 fix(skills): bypass config and skills barrel imports 2026-04-11 18:58:31 +01:00
Nimrod Gutman 8923e9bcba fix(auto-reply): preserve image attachment notes (#64918)
* fix(auto-reply): preserve image attachment notes

* fix(auto-reply): harden media note rendering

* fix: preserve image attachment notes (#64918) (thanks @ngutman)
2026-04-11 20:49:36 +03:00
Vincent Koc 0f7d9c9570 fix(runtime): split approval and gateway client seams 2026-04-11 18:36:48 +01:00
Vincent Koc 4a799e77d7 fix(runtime): split reply dispatcher type surface 2026-04-11 17:46:58 +01:00
Vincent Koc f630e8d440 fix(utils): bypass delivery context wrapper for shared consumers 2026-04-11 17:26:38 +01:00
Josh Lehman 77a0ee7f9d fix: canonicalize topic session transcript fallback (#64869)
* fix: canonicalize topic session transcript fallback

When initSessionState has a topic-scoped SessionKey but no MessageThreadId, fallback transcript selection should still land on the topic-qualified JSONL path instead of the bare session file. Match the existing transcript resolver by parsing the thread id from the session key, and cover the regression with a session init test that loads the Telegram session-conversation grammar.

Regeneration-Prompt: |
  Investigate why a Telegram topic session could alternate between <session-id>.jsonl and <session-id>-topic-<n>.jsonl for the same logical session. The fix should be in OpenClaw's session initialization path, not in lossless-claw. Keep behavior unchanged when MessageThreadId is present, but when the inbound turn only carries a topic-scoped SessionKey, derive the same topic-specific transcript path that the canonical transcript resolver would use. Add a regression test that proves initSessionState chooses the topic-qualified file even without MessageThreadId, and make the test load the session-conversation registry needed to parse Telegram :topic: grammar.

* fix: preserve topic session transcript history
2026-04-11 09:06:49 -07:00
Vincent Koc 1f1b504980 fix(commands): split chat command listing surface 2026-04-11 16:58:43 +01:00
Vincent Koc 796d4dfc49 fix(reply): split dispatcher shared types 2026-04-11 16:52:18 +01:00
Vincent Koc 97d1b88e3f fix(cycles): split plugin runtime contract leaf types 2026-04-11 15:39:32 +01:00
Peter Steinberger bb0bfabec8 perf: trim agent test runtime imports 2026-04-11 13:55:07 +01:00
Vincent Koc 3b4de1ac14 fix(cycles): split reply and gateway leaf seams 2026-04-11 13:53:20 +01:00
Vincent Koc 81535d394d fix(cycles): repair broken type surfaces 2026-04-11 13:42:17 +01:00
Vincent Koc 74e7b8d47b fix(cycles): bulk extract leaf type surfaces 2026-04-11 13:26:50 +01:00