Commit Graph

1439 Commits

Author SHA1 Message Date
RussellLuo fab9603547 feat(matrix): support encrypted messages with E2EE
- Add `crypto_database_path` and `crypto_passphrase` configuration
- Integrate cryptohelper for decrypting `m.room.encrypted` events
- Handle both plaintext and encrypted messages in `handleMessageEvent`
- Enable `goolm` build tag for libsignal crypto support

Fixes #1840.
2026-03-24 21:46:10 +08:00
wenjie 4d7a629b79 feat(web): improve Weixin channel binding flow (#1968)
- persist Weixin bindings, enable the channel automatically, and try to restart the gateway
- refresh frontend channel and gateway state after successful binding
- harden QR polling state handling and update related channel UI behavior
- localize sidebar channel priority, add Weixin icon support, and add backend test coverage
2026-03-24 20:33:32 +08:00
lxowalle 8b6cbd9909 Fix: Prevent security.yml from being overwritten during config migration (#1966) 2026-03-24 20:02:58 +08:00
美電球 f2f6987f00 test(agent): allow mock custom tool args (#1965) 2026-03-24 19:27:29 +08:00
hsguo fa5ab72022 WeChat Web QR Code Integration (#1961) 2026-03-24 18:37:41 +08:00
Sabyasachi Patra fcc20ec72c feat(tools): add tool argument schema validation before execution (#1877)
Validate tool call arguments against each tool's Parameters() JSON Schema
in ExecuteWithContext() before calling Execute(). This prevents type
confusion, argument injection, and missing-field errors from reaching tools.

Validates: required fields, type matching (string/integer/number/boolean/
array/object), enum membership, nested objects (recursive), array element
types. Rejects unexpected extra properties unless additionalProperties is
set to true (for MCP tool compatibility).

Returns ToolResult{IsError: true} on failure so the LLM can self-correct.

Ref: Security Hardening > Tool abuse prevention via strict parameter validation
2026-03-24 18:35:56 +08:00
taorye ff50ffa123 Merge pull request #1962 from wj-xiao/fix/configure-pico-channel
fix(web): auto-configure Pico channel on launcher startup
2026-03-24 18:26:25 +08:00
wenjie dea99da7d9 fix(web): auto-configure Pico channel on launcher startup
Export EnsurePicoChannel and reuse it during launcher and gateway startup
so the Pico channel is initialized earlier with a generated token when
needed.

Also extend backend tests to cover startup-time Pico setup behavior and
keep the setup path idempotent.
2026-03-24 18:06:29 +08:00
wenjie ffbcbea4dc fix(web): persist api_key when adding models (#1958)
Make POST /api/models capture the request's api_key and store it via
ModelConfig.SetAPIKey before saving config, so newly added models keep
their credentials in the security config.

Add a backend API test covering model creation with api_key persistence.
2026-03-24 17:31:28 +08:00
wenjie d23c24ce72 fix(config): normalize empty security config before save/load (#1956)
Normalize missing security sections when attaching, loading, and saving
security config so existing config files without `.security.yml` can still
be updated safely. This fixes Pico channel setup for legacy/existing configs
and adds coverage for the missing security file path and unexported JSON
field behavior.
2026-03-24 17:03:28 +08:00
daming大铭 b17cbe5234 fix: apply security credentials before config validation in web handlers
Merge PR #1929
2026-03-24 16:27:57 +08:00
Cytown d921bbb667 bug fix for security initial cause can't save model in launcher (#1952) 2026-03-24 16:24:12 +08:00
daming大铭 6e31f15467 fix(web): ensure at least 40% of the characters are hidden for api key
Merge pull request #1944 from lc6464/fix/web/mask-api-key
2026-03-24 15:54:51 +08:00
lc6464 1ef2b6903d test(web): add percentage checking of characters displaying in APIKey 2026-03-24 13:54:04 +08:00
Hua Audio b23a6b3f54 Feat/move weixin login to auth and update docs (#1945)
* move weixin to auth and update docs

* fix ci test
2026-03-24 06:33:35 +01:00
lc6464 66d2efc9d1 test(web): add test for maskAPIKey 2026-03-24 12:36:31 +08:00
lc6464 f1ac1a1072 fix(web): ensure at least 40% of the characters are masked for api key
- keys longer than 12 chars show prefix + last 4 chars
- keys 9-12 chars show prefix + last 2 chars
- shorter keys are fully masked
2026-03-24 12:20:57 +08:00
LC ce1619051d fix(chat): avoid full secret exposure for 7-char secrets (#1942)
- ensure at least 40% of the characters are masked for secrets of length 4 or more
- secrets with length <= 6 now show first and last char with mask
- secrets with length <= 12 now show first two and last two chars
- longer secrets show 3 prefix and 4 suffix
2026-03-24 11:26:20 +08:00
Cytown cf9e0496f7 fix launcher can't save model api_key issue (#1928)
* fix launcher can't save model api_key issue

* add backup for old data before migrate config and fix migrate to empty
security issue
2026-03-24 03:26:11 +01:00
Mauro aa3300c1bd feat(web): Tool feedback on UI (#1933)
* feat(web): tool feedback

* feat(web): tool feedback

* fix test
2026-03-24 09:19:51 +08:00
美電球 69cf9342e1 Merge pull request #1938 from huaaudio/fix/weixin-load
fix weixin config loading incorrectly
2026-03-24 08:37:34 +08:00
Huaaudio 6ea9636861 fix weixin config 2026-03-24 01:33:05 +01:00
Orkun Manap dd9adf8a04 feat: add ElevenLabs Scribe STT transcriber and Telegram SendVoice support (#1905)
* feat: add ElevenLabs Scribe STT transcriber and Telegram SendVoice support

Add ElevenLabsTranscriber as an alternative speech-to-text provider using
the ElevenLabs Scribe API (scribe_v1). This enables voice message
transcription for users who already have an ElevenLabs API key, without
requiring a separate Groq account.

Changes:
- Add ElevenLabsTranscriber implementing the Transcriber interface
- Update DetectTranscriber to check providers.elevenlabs.api_key first,
  falling back to Groq for backward compatibility
- Add ElevenLabs to ProvidersConfig
- Add "voice" media type for OGG files with "voice" in filename
- Add SendVoice support in Telegram channel for voice bubble messages
- Add comprehensive tests for ElevenLabs transcriber

Configuration:
  "providers": {
    "elevenlabs": {
      "api_key": "sk_your_key_here"
    }
  }

Closes #1503 (partial)

* fix: move voice-bubble detection into Telegram channel to avoid regression in other channels

Address review feedback: keep inferMediaType returning "audio" for all
OGG files. Voice-bubble detection (SendVoice vs SendAudio) is now done
inside the Telegram channel based on filename, so other channels that
map "audio" explicitly are unaffected.

* fix: align VoiceConfig struct tags to pass golines formatter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(agent): use ModelName in loop test added by upstream

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:11:10 +01:00
美電球 f06173a5e0 fix(qq): preserve filenames in file uploads (#1913) 2026-03-23 22:00:15 +01:00
daming大铭 2c48cd3461 Merge pull request #1907 from xiwuqi/wuxi/fix-reasoning-channel-content
fix(agent): route reasoning_content to reasoning channel
2026-03-24 01:24:14 +08:00
Andy Lo-A-Foe b787131c82 feat(providers): add AWS Bedrock provider (#1903)
Add support for AWS Bedrock as an LLM provider using the Converse API.
The implementation is behind a build tag (-tags bedrock) to keep the
default binary size small.

Features:
- AWS SDK v2 with automatic credential chain (env vars, profiles, IAM roles)
- Converse API for unified access to Claude, Llama, Mistral models
- Tool/function calling support with proper document handling
- Image support with base64 decoding and size limits
- Request timeout configuration
- Region validation and endpoint resolution for all AWS partitions

Usage:
  go build -tags bedrock
  model: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
  api_base: us-east-1  (or full endpoint URL)
2026-03-24 01:10:56 +08:00
daming大铭 40571996b1 Merge pull request #1930 from uiYzzi/feat/filter-sensitive-data-from-tool-results
feat(security): filter sensitive data from tool results before sending to LLM
2026-03-24 00:07:17 +08:00
uiyzzi cf80ec8382 Update config_test.go 2026-03-23 20:58:14 +08:00
uiyzzi 16d23d8cdc feat(security): add sensitive data filtering for tool results sent to
LLM

Prevent LLM from seeing its own credentials (API keys, tokens, secrets)
by filtering sensitive values from tool call results before sending to
the
model. Values are collected from .security.yml and replaced with
[FILTERED] using an efficient strings.Replacer (O(n+m)).

- Add FilterSensitiveData and FilterMinLength to ToolsConfig
- Implement SensitiveDataReplacer() with sync.Once caching in
  SecurityConfig
- Use reflection to collect all sensitive values (Model API keys,
  channel
  tokens, web tool API keys, skills tokens)
- Apply filtering in agent loop at 4 tool result locations
- Add comprehensive tests covering all token types
2026-03-23 20:55:41 +08:00
Kristjan Kruus 1f9d390a64 fix: apply security credentials before config validation in web handlers
- Move SecurityCopyFrom() before validateConfig() in PUT and PATCH handlers
- Make SecurityCopyFrom() call applySecurityConfig() to populate private fields
- Add tests for config save with security-only channel tokens

Without this fix, saving config via the web UI fails with 'channels.pico.token
is required' (and similar for Telegram/Discord) when tokens are stored in
.security.yml, because the validation ran before security credentials were
copied to the config struct.
2026-03-23 14:26:51 +02:00
美電球 96e312680d Merge pull request #1926 from cytown/fix
fix for ci/cd
2026-03-23 18:25:34 +08:00
Cytown d77375721a fix for ci/cd 2026-03-23 18:15:16 +08:00
美電球 4e3769e989 fix(agent): use ModelName in loop tests (#1923) 2026-03-23 17:28:15 +08:00
LC 8e3e517135 feat: render mixed Markdown+HTML in assistant messages and skills (#1900)
* feat(chat): render mixed Markdown+HTML in assistant messages using rehype-raw + rehype-sanitize (safe default)

* build: remove irrelevant changes of pnpm-lock.yaml

* feat(skills): enable rendering of Markdown with HTML in skill details using rehype-raw and rehype-sanitize

* fix(agent): use ModelName in loop tests
2026-03-23 17:25:27 +08:00
Liqiang Liu f81b44bf19 fix(provider): deduplicate tool results and merge consecutive tool_result blocks for Anthropic API (#1793)
Anthropic API returns 400 when multiple tool_result blocks share the same
tool_use_id, or when consecutive tool results are sent as separate user
messages. This fix:

1. Adds ToolCallID deduplication in sanitizeHistoryForProvider (context.go)
   to drop duplicate tool results before sending to any provider.
2. Merges consecutive tool result messages into a single user message with
   multiple tool_result content blocks in Anthropic's buildRequestBody,
   for both "user" (with ToolCallID) and "tool" role messages.
3. Adds tests for both behaviors.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:24:46 +08:00
lc6464 1961aab850 fix(agent): use ModelName in loop tests 2026-03-23 17:23:33 +08:00
daming大铭 e7ee80ff32 Merge pull request #1878 from uiYzzi/feat/provider-extra-body-config
feat(providers): add extra_body config to inject custom fields into request body
2026-03-23 17:23:21 +08:00
daming大铭 c3285625b0 Merge pull request #1918 from cytown/panic
Merging - approved after code review with Codex adversarial check. All CI checks passed.
2026-03-23 17:20:11 +08:00
uiyzzi 02393b3087 Merge branch 'feat/provider-extra-body-config' of github.com:uiYzzi/picoclaw into feat/provider-extra-body-config
# Conflicts:
#	pkg/config/config_test.go
2026-03-23 16:49:43 +08:00
uiyzzi d1d2155edb Use ModelName instead of Model in test config structs 2026-03-23 16:47:13 +08:00
uiyzzi c7544f7cb9 feat(providers): add extra_body config to inject custom fields into request body
Allow configuring provider-specific fields like reasoning_split for minimax via
the model config's extra_body map. These fields are merged into the request
body last, giving them precedence over default values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 16:44:12 +08:00
uiyzzi 79df938696 Use getter/setter methods for API key access in ModelConfig 2026-03-23 16:39:43 +08:00
uiyzzi 608ec6d329 Move minimax reasoning_split injection to provider factory
Inject reasoning_split at provider creation time to allow user ExtraBody
settings to be preserved
2026-03-23 16:39:43 +08:00
uiyzzi f2985b8bee feat(providers): add extra_body config to inject custom fields into request body
Allow configuring provider-specific fields like reasoning_split for minimax via
the model config's extra_body map. These fields are merged into the request
body last, giving them precedence over default values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 16:39:42 +08:00
uiyzzi b24c577e38 Add security config to ExtraBody round-trip test 2026-03-23 16:29:25 +08:00
Mauro 054b55fdfc Merge pull request #1893 from afjcjsbx/feat/skill-channel-commands
feat(skills): add channel commands to list and force installed skills
2026-03-23 09:04:06 +01:00
uiyzzi 7767feb724 Merge branch 'feat/provider-extra-body-config' of github.com:uiYzzi/picoclaw into feat/provider-extra-body-config
# Conflicts:
#	pkg/config/config_test.go
#	pkg/providers/factory_provider.go
#	pkg/providers/factory_provider_test.go
2026-03-23 15:54:02 +08:00
uiyzzi 2d9517c655 Use getter/setter methods for API key access in ModelConfig 2026-03-23 15:51:13 +08:00
uiyzzi 53c6dd3812 Move minimax reasoning_split injection to provider factory
Inject reasoning_split at provider creation time to allow user ExtraBody
settings to be preserved
2026-03-23 15:46:04 +08:00
uiyzzi 8a046e951a feat(providers): add extra_body config to inject custom fields into request body
Allow configuring provider-specific fields like reasoning_split for minimax via
the model config's extra_body map. These fields are merged into the request
body last, giving them precedence over default values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 15:45:45 +08:00