Commit Graph

1386 Commits

Author SHA1 Message Date
Peter Steinberger
6817c0ec7b fix(security): tighten elevated allowFrom sender matching 2026-02-22 22:00:08 +01:00
Peter Steinberger
382785c6ce refactor(webchat): extract shared chat state helpers 2026-02-22 21:37:19 +01:00
Peter Steinberger
19046e0cfc fix(webchat): preserve session labels across /new resets (#23755)
Co-authored-by: ThunderStormer <16649514+ThunderStormer@users.noreply.github.com>
2026-02-22 21:37:19 +01:00
Peter Steinberger
8a83ca54a1 fix(webchat): preserve session channel routing on internal turns (#23258)
Co-authored-by: binary64 <1680627+binary64@users.noreply.github.com>
2026-02-22 21:37:18 +01:00
Peter Steinberger
5e8b1f5ac8 refactor(test): centralize trigger and cron test helpers 2026-02-22 20:04:51 +00:00
Vincent Koc
5e73f33448 fix(slack): keep thread session fork/history context after first turn (#23843)
* Slack thread sessions: keep forking and history context after first turn

* Update CHANGELOG.md
2026-02-22 14:39:00 -05:00
Peter Steinberger
02772b029d fix(security): require sender-only matching for elevated allowFrom
Co-authored-by: coygeek <coygeek@users.noreply.github.com>
2026-02-22 20:37:22 +01:00
Peter Steinberger
95d7b0bbe1 fix(replies): normalize media path variants for dedupe
Co-authored-by: Ho Lim <subhoya@gmail.com>
2026-02-22 19:34:30 +01:00
Peter Steinberger
0342bed289 fix(replies): keep finals for cross-target messaging sends
Co-authored-by: Ion Mudreac <mudreac@gmail.com>
2026-02-22 19:34:30 +01:00
Vincent Koc
89a1e99815 fix(slack): finalize replyToMode off threading behavior (#23799)
* fix: make replyToMode 'off' actually prevent threading in Slack

Three independent bugs caused Slack replies to always create threads
even when replyToMode was set to 'off':

1. Typing indicator created threads via statusThreadTs fallback (#16868)
   - resolveSlackThreadTargets fell back to messageTs for statusThreadTs
   - 'is typing...' was posted as thread reply, creating a thread
   - Fix: remove messageTs fallback, let statusThreadTs be undefined

2. [[reply_to_current]] tags bypassed replyToMode entirely (#16080)
   - Slack dock had allowExplicitReplyTagsWhenOff: true
   - Reply tags from system prompt always threaded regardless of config
   - Fix: set allowExplicitReplyTagsWhenOff to false for Slack

3. Contradictory replyToMode defaults in codebase (#20827)
   - monitor/provider.ts defaulted to 'all'
   - accounts.ts defaulted to 'off' (matching docs)
   - Fix: align provider.ts default to 'off' per documentation

Fixes: openclaw/openclaw#16868, openclaw/openclaw#16080, openclaw/openclaw#20827

* fix(slack): respect replyToMode in DMs even with typing indicator thread

When replyToMode is 'off' in DMs, replies should stay in the main
conversation even when the typing indicator creates a thread context.

Previously, when incomingThreadTs was set (from the typing indicator's
thread), replyToMode was forced to 'all', causing all replies to go
into the thread.

Now, for direct messages, the user's configured replyToMode is always
respected. For channels/groups, the existing behavior is preserved
(stay in thread if already in one).

This fix:
- Keeps the typing indicator working (statusThreadTs fallback preserved)
- Prevents DM replies from being forced into threads
- Maintains channel thread continuity

Fixes #16868

* refactor(slack): eliminate redundant resolveSlackThreadContext call

- Add isThreadReply to resolveSlackThreadTargets return value
- Remove duplicate call in dispatch.ts
- Addresses greptile review feedback with cleaner DRY approach

* docs(slack): add JSDoc to resolveSlackThreadTargets

Document return values including isThreadReply distinction between
genuine user thread replies vs bot status message thread context.

* docs(changelog): record Slack replyToMode off threading fixes

---------

Co-authored-by: James <jamesrp13@gmail.com>
Co-authored-by: theoseo <suhong.seo@gmail.com>
2026-02-22 13:27:50 -05:00
Vincent Koc
cd7b2814af fix(slack): preserve string thread context in queue + DM route (#23804)
* fix(slack): preserve thread_ts in queue drain and deliveryContext

Two related fixes for Slack thread reply routing:

1. Queue drain drops string thread_ts (#11195)
   - `typeof threadId === "number"` in drain.ts only matches Telegram numeric
     topic IDs. Slack thread_ts is a string like "1770474140.187459" which
     fails the check, causing threadKey to become empty.
   - Changed to `threadId != null && threadId !== ""` to accept both number
     and string thread IDs.
   - Applies to all 3 occurrences in drain.ts: cross-channel detection,
     thread key building, and collected originatingThreadId extraction.

2. DM deliveryContext missing thread_ts (#10837)
   - updateLastRoute calls for Slack DMs in both prepare.ts and dispatch.ts
     built deliveryContext without threadId, so the session's delivery context
     never included thread_ts for DM threads.
   - Added threadId from threadContext.messageThreadId / ctxPayload.MessageThreadId
     to both updateLastRoute call sites.

Tests: 3 new cases in queue.collect-routing.test.ts
- Collects messages with matching string thread_ts (same Slack thread)
- Separates messages with different string thread_ts (different threads)
- Treats empty string threadId same as absent

Closes #10837, closes #11195

* fix(slack): preserve string thread context in queue + DM route updates

---------

Co-authored-by: RobClawd <clawd@RobClawds-Mac-mini.local>
2026-02-22 13:26:31 -05:00
Peter Steinberger
dacb3d1aa2 refactor(queue): share drain helpers across announce and reply 2026-02-22 17:54:51 +00:00
Vincent Koc
24fd8cbdc8 fix(auto-reply): preserve OpenRouter @preset model directives (#23769)
* Auto-reply: preserve OpenRouter @preset model directives

* Changelog: move OpenRouter preset fix into 2026.2.22 unreleased
2026-02-22 12:46:04 -05:00
zwffff
c543994e90 Default reasoning to on when model has reasoning: true (fix #22456) (#22513)
* Default reasoning to on when model has reasoning: true (fix #22456)

What: When a model is configured with reasoning: true in openclaw.json (e.g. OpenRouter x-ai/grok-4.1-fast), the session now defaults reasoningLevel to on if the user has not set it via /reasoning or session store.

Why: Users expected setting reasoning: true on the model to enable reasoning; previously only session/directive reasoningLevel was used and it always defaulted to off, so Think stayed off despite the model config.

* Chore: sync formatted files from main for CI

* Changelog: note zwffff/main OpenRouter fix

* Changelog: fix OpenRouter entry text

* Update msteams.md

* Update msteams.md

* Update msteams.md

---------

Co-authored-by: 曾文锋0668000834 <zeng.wenfeng@xydigit.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:19:36 -05:00
Peter Steinberger
24ea941e28 test: dedupe auto-reply web and signal flows 2026-02-22 17:11:54 +00:00
Nikolay Petrov
13690d406a Telegram: coalesce forwarded text+media bursts into one inbound turn (#19476)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 09e0b4e9bd1a799c30249f21b87782429a8f8e32
Co-authored-by: napetrov <18015221+napetrov@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
2026-02-22 21:41:09 +05:30
Marcus Castro
337eef55d7 fix(telegram): link forwarded messages with comments (#9720)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 5f81061b5f613903422a624d95aab8b0fc04027a
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
2026-02-22 21:23:56 +05:30
Peter Steinberger
d116bcfb14 refactor(runtime): consolidate followup, gateway, and provider dedupe paths 2026-02-22 14:08:51 +00:00
Peter Steinberger
adfbbcf1f6 chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
Peter Steinberger
83a2926328 test: align remaining trigger configs with fast harness defaults 2026-02-22 12:43:10 +00:00
Peter Steinberger
829236afa7 test: reuse trigger harness defaults in custom configs 2026-02-22 12:41:37 +00:00
Peter Steinberger
8e29160eaa test: remove fixed waits from tool-result ordering tests 2026-02-22 12:29:08 +00:00
Peter Steinberger
89e2928204 test: speed up trigger harness queue defaults 2026-02-22 12:18:15 +00:00
Peter Steinberger
c343132dbb fix(agents): harden bash tool and reply directive handling 2026-02-22 11:29:31 +00:00
Peter Steinberger
2d133d3ec2 test: reclassify auto-reply behavior suites out of e2e 2026-02-22 11:04:10 +00:00
Peter Steinberger
b77e53da67 refactor(session): centralize transcript path option resolution 2026-02-22 12:02:38 +01:00
Peter Steinberger
8ad85de800 test(reply): align native trigger suite with fast-test fixture patterns 2026-02-22 10:28:42 +00:00
Peter Steinberger
6c2e999776 refactor(security): unify secure id paths and guard weak patterns 2026-02-22 10:16:19 +01:00
Peter Steinberger
ae8d4a8eec fix(security): harden channel token and id generation 2026-02-22 10:16:02 +01:00
Peter Steinberger
aa2b16abe8 test(commands): replace subagent gateway reset with lightweight clear 2026-02-22 09:06:54 +00:00
Peter Steinberger
27bd6f4c54 test(reply): use lightweight clears for runner-level mocks 2026-02-22 09:02:53 +00:00
Peter Steinberger
ee3abb2278 test(reply): merge duplicate runReplyAgent streaming and fallback cases 2026-02-22 08:59:46 +00:00
Peter Steinberger
d625f888a9 test(core): dedupe command gating and trim announce reset overhead 2026-02-22 08:54:11 +00:00
Peter Steinberger
48c0acc26f test(commands): dedupe subagent status assertions 2026-02-22 08:51:43 +00:00
Peter Steinberger
ccc00d874c test(core): reduce mock reset overhead in targeted suites 2026-02-22 08:40:29 +00:00
Peter Steinberger
e67f813b0e test(core): continue reset-to-clear cleanup in subagent focus and web fetch 2026-02-22 08:30:05 +00:00
Peter Steinberger
d06ad6bc55 chore: remove verified dead code paths 2026-02-22 09:21:09 +01:00
Peter Steinberger
991e3184b7 test(reply): replace heavy resets in media and runner helper specs 2026-02-22 08:15:28 +00:00
Peter Steinberger
d6d73d0ed9 test(core): trim redundant test resets and use mockClear 2026-02-22 08:12:55 +00:00
Peter Steinberger
e893157600 test(core): use lightweight clears in runtime and telegram setup 2026-02-22 08:09:14 +00:00
Peter Steinberger
2557945a8d test(core): use lightweight clears in subagent and browser setup 2026-02-22 08:07:41 +00:00
Peter Steinberger
6e253096ed test(core): use lightweight clears in command and dispatch setup 2026-02-22 08:06:06 +00:00
Peter Steinberger
9df896e5b9 test(auto-reply): use lightweight clears in agent runner setup 2026-02-22 08:01:16 +00:00
Peter Steinberger
b25b1812e8 test(auto-reply): use lightweight clears in dispatch setup 2026-02-22 08:01:16 +00:00
Peter Steinberger
8acf5ffca7 test(auto-reply): centralize subagent command test reset setup 2026-02-22 08:00:41 +00:00
Peter Steinberger
ad1c07e7c0 refactor: eliminate remaining duplicate blocks across draft streams and tests 2026-02-22 07:44:57 +00:00
Peter Steinberger
d069f8b23a test(subagents): dedupe focus thread setup fixtures 2026-02-22 07:44:57 +00:00
Vignesh Natarajan
aab20e58d7 Sessions: persist prompt-token totals without usage 2026-02-21 23:37:42 -08:00
Peter Steinberger
fad2c0c8a1 test(auto-reply): trim setup resets in block streaming and subagent focus 2026-02-22 07:35:55 +00:00
Peter Steinberger
843a037532 fix(test): repair readonly case table typing 2026-02-22 00:10:07 +01:00