Commit Graph

6938 Commits

Author SHA1 Message Date
Colin 5bbbc3e3e6 Slack: show picker values in interaction confirmations 2026-02-16 23:51:44 +01:00
Colin 5f9a04604e Slack: add header and context blocks to arg menus 2026-02-16 23:51:44 +01:00
Colin 7c5529a153 Slack: enrich modal input payload normalization 2026-02-16 23:51:44 +01:00
Colin d1aa2323bd Slack: update action rows for select interactions 2026-02-16 23:51:44 +01:00
Colin 1bfdd4e237 Slack: add overflow menus for slash arg choices 2026-02-16 23:51:44 +01:00
Colin 296ba8e934 Slack: enrich block action context payloads 2026-02-16 23:51:44 +01:00
Colin 7e42408ade Slack: dedupe normalized interaction selections 2026-02-16 23:51:44 +01:00
Colin 6e790303df Slack: validate runtime blocks in send and edit paths 2026-02-16 23:51:44 +01:00
Colin c01c6b7079 Slack: expand interaction payload normalization coverage 2026-02-16 23:51:44 +01:00
Colin ac969e602c Slack: add modal private metadata utilities 2026-02-16 23:51:44 +01:00
Colin 82d132f1ba Slack: add send blocks behavior tests 2026-02-16 23:51:44 +01:00
Colin e8a1d4171d Slack: guard select option value length in slash menus 2026-02-16 23:51:44 +01:00
Colin c943ffab7c Slack: reject blocks plus media in send paths 2026-02-16 23:51:44 +01:00
Colin 10d876e319 Slack: validate blocks input shape centrally 2026-02-16 23:51:44 +01:00
Colin e023c84d78 Slack: infer interaction channel type from channel ID 2026-02-16 23:51:44 +01:00
Colin 378e18b75b Slack: support blocks in plugin edit action 2026-02-16 23:51:44 +01:00
Colin 3912a2264b Slack: support blocks in plugin send action 2026-02-16 23:51:44 +01:00
Colin 08bc1dce6a Slack: support Block Kit blocks in editMessage 2026-02-16 23:51:44 +01:00
Colin c9684a2678 Slack: support Block Kit blocks in sendMessage actions 2026-02-16 23:51:44 +01:00
Colin bd17587b2a Slack: route modal interactions via private metadata 2026-02-16 23:51:44 +01:00
Colin d57cbcf713 Slack: use static_select for large slash arg menus 2026-02-16 23:51:44 +01:00
Colin cf0ca47a82 Slack: capture Block Kit view closed events 2026-02-16 23:51:44 +01:00
Colin e7cded82b2 Slack: capture Block Kit modal submissions 2026-02-16 23:51:44 +01:00
Colin 21ba564fb0 Slack: fix CI typing for interaction handler 2026-02-16 23:51:44 +01:00
Colin 55b70aa8b4 Slack: register interaction event handler 2026-02-16 23:51:44 +01:00
Colin 9419d029c9 Slack: enrich Block Kit interaction events 2026-02-16 23:51:44 +01:00
Sean McLellan 06b961b037 fix: flatten remaining anyOf/oneOf in Gemini schema cleaning
The Cloud Code Assist API rejects anyOf/oneOf in tool schemas, not just
unsupported keywords. The image tool (index 21) had:
  image: { anyOf: [{ type: "string" }, { type: "array" }] }
which caused "JSON schema is invalid" errors when forwarded to Anthropic
via google-antigravity.

simplifyUnionVariants only handles literal unions and single non-null
variants. This adds a fallback in cleanSchemaForGeminiWithDefs that
flattens any remaining anyOf/oneOf to a simple type schema.

Also reverts the previous provider-aware normalizeToolParameters and
sanitizeToolsForGoogle changes, which were incorrect — the cleaning IS
needed for Google's API regardless of which downstream model is used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00
Sean McLellan 1bbf6206d5 fix: exclude google-antigravity from Gemini schema sanitization
google-antigravity serves Anthropic models (e.g. claude-opus-4-6-thinking),
not Gemini. sanitizeToolsForGoogle was stripping JSON Schema keywords
(minimum, maximum, format, etc.) needed for Anthropic's draft 2020-12
compliance, causing "JSON schema is invalid" rejections on tool 21
(web_search).

This was the actual root cause — the earlier normalizeToolParameters
fix was being overridden by this second sanitization pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00
Sean McLellan fe94e83f6b fix: make tool schema normalization provider-aware
The cleanSchemaForGemini function was being applied universally to all
tools for all providers, stripping out valid JSON Schema keywords like
minimum/maximum that are required by Anthropic's draft 2020-12 validation.

This caused the 21st tool (web_search) to fail with google-antigravity
because its count parameter's constraints were being removed.

Changes:
- Modified normalizeToolParameters to accept modelProvider option
- Only apply Gemini-specific cleaning when provider is Gemini/Google
- Skip aggressive cleaning for Anthropic/google-antigravity providers
- Updated call site in createOpenClawCodingTools to pass modelProvider

Fixes schema validation errors for Anthropic models served via google-antigravity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:41 +01:00
saurav470 d2dd282034 docs(exec): document pty for TTY-only CLIs (gog) 2026-02-16 23:51:22 +01:00
yinghaosang f275611862 fix(sandbox): restore SHA-1 in slugifySessionKey to preserve workspace dirs (#18503) 2026-02-16 23:51:19 +01:00
norunners d799a3994f fix(doctor): reconcile gateway service token drift after re-pair
`openclaw doctor` audited gateway service runtime/path settings but did not
check whether the daemon's `OPENCLAW_GATEWAY_TOKEN` matched
`gateway.auth.token` in `openclaw.json`.

After re-pairing or token rotation, the config token and service env token can
drift. The daemon may keep running with a stale service token, leading to
unauthorized handshake failures for cron/tool clients.

Add a gateway service audit check for token drift and pass
`cfg.gateway.auth.token` into service audits so doctor treats config as the
source of truth when deciding whether to reinstall the service.

Key design decisions:
- Use `gateway.auth.token` from `openclaw.json` as the authority for service
  token drift detection
- Only flag mismatch when an authoritative config token exists
- Keep fix in existing doctor service-repair flow (no separate migration step)
- Add focused tests for both audit mismatch behavior and doctor wiring

Fixes #18175
2026-02-16 23:51:16 +01:00
j2h4u 5f821ed067 fix(session): prevent stale threadId leaking into non-thread sessions
When a user interacts with the bot inside a DM topic (thread), the
session persists `lastThreadId`. If the user later sends a message
from the main DM (no topic), `ctx.MessageThreadId` is undefined and
the `||` fallback picks up the stale persisted value — causing the
bot to reply into the old topic instead of the main conversation.

Only fall back to `baseEntry.lastThreadId` for thread sessions where
the fallback is meaningful (e.g. consecutive messages in the same
thread). Non-thread sessions now correctly leave threadId unset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:51:12 +01:00
Brandon Wise 01b37f1d32 fix(telegram): handle large file getFile errors gracefully
Catch GrammyError when getFile fails for files >20MB (Telegram Bot API limit).
Log warning, skip attachment, but continue processing message text.

- Add FILE_TOO_BIG_RE regex to detect 'file is too big' errors
- Add isFileTooBigError() and isRetryableGetFileError() helpers
- Skip retrying permanent 400 errors (they'll fail every time)
- Log specific warning for file size limit errors
- Return null so message text is still processed

Fixes #18518
2026-02-16 23:51:09 +01:00
Dinakar Sarbada 1953b938e3 test(heartbeat): update runner tests to match current implementation 2026-02-16 23:51:05 +01:00
yinghaosang 0587e4cc73 fix(agents): restrict MEDIA: token parsing to line start in tool results (#18510) 2026-02-16 23:50:59 +01:00
Hudson 93fbe6482b fix(sessions): archive transcript files when pruning stale entries
pruneStaleEntries() removed entries from sessions.json but left the
corresponding .jsonl transcript files on disk indefinitely.

Added an onPruned callback to collect pruned session IDs, then
archives their transcript files via archiveSessionTranscripts()
after pruning completes. Only runs in enforce mode.
2026-02-16 23:50:56 +01:00
Hudson 441401221d fix(media): clean expired files in subdirectories
cleanOldMedia() only scanned the top-level media directory, but
saveMediaBuffer() writes to subdirs (inbound/, outbound/, browser/).
Files in those subdirs were never cleaned up.

Now recurses one level into subdirectories, deleting expired files
while preserving the subdirectory folders themselves.
2026-02-16 23:50:56 +01:00
gitwithuli c89eb351ea style: run oxfmt formatting on doctor-config-flow.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
gitwithuli 304bfefaf9 chore: remove unused channelName parameter from ensureWildcard
Addresses review feedback — channelName was declared but only
prefix was used for change messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
gitwithuli b05273de61 fix: doctor --fix auto-repairs dmPolicy="open" missing allowFrom wildcard
When a channel is configured with dmPolicy="open" but without
allowFrom: ["*"], the gateway rejects the config and exits.
The error message suggests running "openclaw doctor --fix", but
the doctor had no repair logic for this case.

This adds a repair step that automatically adds "*" to allowFrom
(or creates it) when dmPolicy="open" is set without the required
wildcard. Handles both top-level and nested dm.allowFrom, as well
as per-account configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 23:50:53 +01:00
Colin 89ce1460e1 feat(slack): add configurable stream modes 2026-02-16 23:50:42 +01:00
Colin 087edec93f feat(slack): add draft preview cleanup lifecycle 2026-02-16 23:50:42 +01:00
Colin dfd5a79631 fix(slack): pass account token for draft final chat.update 2026-02-16 23:50:42 +01:00
Colin bec974aba9 feat(slack): stream partial replies via draft message updates 2026-02-16 23:50:42 +01:00
gleb 78c34bcf33 Add runtime quiting functionality to doctor.ts 2026-02-16 23:50:37 +01:00
gleb 2540417170 Add to exit process when doctor has finished 2026-02-16 23:50:37 +01:00
Mrseenz b6d934c2c7 Agents: improve Windows scaffold helpers for venture studio 2026-02-16 23:50:34 +01:00
Winry c15385fc94 fix(telegram): enable voice-note transcription in DMs and add CLI fallback
The preflight transcription condition only triggered for group chats
(isGroup && requireMention), so voice notes sent in direct messages
were never transcribed — they arrived as raw <media:audio> placeholders.

This patch widens the condition to fire whenever there is audio and no
accompanying text, regardless of chat type.

It also adds a fallback path: if the standard media pipeline returns no
transcript (e.g. format mismatch, missing config), OpenClaw now calls
the configured whisper CLI command directly with the audio file, using
the same {{MediaPath}}/{{OutputBase}} template variables from config.

Co-Authored-By: TH <tzhsn.huang@gmail.com>
2026-02-16 23:50:31 +01:00
HAL e8b03a8622 fix(agents): replace anyOf with string in image tool schema
Anthropic's API rejects `anyOf` in `input_schema`, causing all Claude
requests to fail when the image tool is registered. Replace
`Type.Union([Type.String(), Type.Array(Type.String())])` with
`Type.String()` — the execute handler already normalizes both string
and array inputs, so this is schema-only.

Fixes #18551
2026-02-16 23:50:27 +01:00