Commit Graph

422 Commits

Author SHA1 Message Date
danieldd df2c42466c Merge pull request #435 from mymmrac/fix-formatting
feat(fmt): Run formatters
2026-02-21 03:04:42 +07:00
danieldd 1e3a9eb3c4 Merge pull request #546 from harshbansal7/readme_fix
[Fix] Fix Readme Reference for Model Configuration.
2026-02-21 02:38:08 +07:00
harshbansal7 123cffa85a fix 2 2026-02-21 01:04:48 +05:30
harshbansal7 5ca239b5c5 fix 2026-02-21 01:02:35 +05:30
Artem Yadelskyi 0675ce7c38 feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
Artem Yadelskyi ad8c2d48c8 Merge branch 'main' into fix-formatting
# Conflicts:
#	cmd/picoclaw/main.go
#	pkg/agent/context.go
#	pkg/agent/loop.go
#	pkg/channels/dingtalk.go
#	pkg/channels/feishu_64.go
#	pkg/channels/line.go
#	pkg/channels/manager.go
#	pkg/config/config.go
#	pkg/migrate/migrate_test.go
#	pkg/providers/anthropic/provider_test.go
#	pkg/providers/claude_provider_test.go
#	pkg/providers/http_provider.go
#	pkg/providers/openai_compat/provider.go
#	pkg/providers/protocoltypes/types.go
#	pkg/providers/types.go
2026-02-20 20:02:53 +02:00
daming大铭 e23795e51b Merge pull request #537 from Esubaalew/main
fix: correct documentation misalignment across translations and guides
2026-02-21 00:01:36 +08:00
Meng Zhuo 5b525f6139 Merge pull request #378 from lunareed720/fix/exec-timeout-process-tree
fix(exec): kill child process tree on timeout to prevent orphaned tasks
2026-02-20 23:32:05 +08:00
Meng Zhuo 55227762e4 Merge pull request #524 from mattn/perf/strings-builder
Use strings.Builder instead of += concatenation in loops
2026-02-20 23:24:47 +08:00
esubaalew 838a69085b fix: correct docs misalignment across translations and guides
- Fix DingTalk section referencing "QQ numbers" instead of DingTalk user IDs
- Fix Anthropic example showing OAuth when code uses paste-token auth
- Replace OpenClaw references in ANTIGRAVITY_AUTH.md with actual PicoClaw paths and Go patterns
- Fix auth file path from auth-profiles.json to auth.json in ANTIGRAVITY_USAGE.md
- Remove non-existent approval tool from tools_configuration.md, add skills tool docs
- Update Quick Start configs in fr/pt-br/vi/ja translations to use model_list format
- Fix allowFrom camelCase to allow_from in fr/pt-br translations
- Fix camelCase config keys in ja translation
- Update zh/ja web search config from old flat format to brave/duckduckgo
- Fix broken ClawdChat link and trailing commas in zh translation
- Add missing qwen/cerebras providers to fr/pt-br/vi translation tables
- Add missing protocol prefixes to migration guide
- Fix typos in community roadmap
2026-02-20 18:23:22 +03:00
daming大铭 1ef33c90ed Merge pull request #474 from swordkee/main
add wecom and wecomApp
2026-02-20 21:17:59 +08:00
swordkee 0f70f783bd feat: add wecom and wecomApp test 2026-02-20 20:01:22 +08:00
Yasuhiro Matsumoto df49f6698a Fix 2026-02-20 20:48:43 +09:00
swordkee ca481035a4 feat: add wecom and wecomApp test 2026-02-20 19:39:12 +08:00
Vernon Stinebaker 2fb2a733d4 feat(discord): add mention_only option for @-mention responses (#518)
* feat(discord): add mention_only option for @-mention responses

Add MentionOnly config option to Discord channel. When enabled, the bot
only responds when explicitly @-mentioned, useful for shared servers.

- Add MentionOnly bool field to DiscordConfig
- Store botUserID on startup for mention checking
- Check m.Mentions before processing messages when MentionOnly is true
- Update config example and README documentation

* fix(discord): resolve race condition and strip mention from content

- Get botUserID before opening session to avoid race condition
- Add stripBotMention to remove @mention from message content
- Handles both <@USER_ID> and <@!USER_ID> mention formats

* fix(discord): skip mention_only check for DMs

DMs should always be responded to regardless of mention_only setting.
Added check to skip the mention_only logic when GuildID is empty.

* Update README.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Hua Audio <161028864+Huaaudio@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-20 12:18:37 +01:00
Yasuhiro Matsumoto bca92433ba Use strings.Builder instead of += concatenation in loops 2026-02-20 20:09:13 +09:00
Harsh Bansal d692cc0cc6 Feature: Implement Skill Discovery - With Clawhub Integration and Caching (#332)
* Add Find Skills and Install Skills

* Improvements

* fix file name

* Update pkg/skills/clawhub_registry.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix

* Comments addressed

* Resolve comments

* fix tests

* fixes

* Comments resolved

* Update pkg/skills/search_cache_repro_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* minor fix

* fix test

* fixes

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-20 18:55:04 +08:00
swordkee 14ccfb39d9 feat: add wecom and wecomApp test 2026-02-20 18:28:10 +08:00
swordkee 59772cdbf2 feat: add wecom and wecomApp channel support 2026-02-20 17:40:59 +08:00
lxowalle f1223eec42 fix: revert enable endy patterns (#519) 2026-02-20 17:16:42 +08:00
daming大铭 36a8a038ee Merge pull request #514 from CrisisAlpha/docs/config-example-add-missing-sections
docs(config): add missing duckduckgo, exec, and qq sections to example config
2026-02-20 16:46:12 +08:00
CrisisAlpha be55204696 docs(config): add missing duckduckgo, exec, and qq sections to example config
config.example.json was missing three sections that exist in the Go
config structs and defaults:

- tools.web.duckduckgo: DuckDuckGo is enabled by default in
  defaults.go and requires no API key (free search provider), but
  users who copy the example config silently lose it since the
  section was omitted.

- tools.exec: The ExecConfig struct supports enable_deny_patterns
  and custom_deny_patterns for security hardening, but users had
  no way to discover these options from the example.

- channels.qq: The QQ channel was the only channel in ChannelsConfig
  missing from the example while all others were present.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 15:11:40 +08:00
daming大铭 e599573ed4 Merge pull request #492 from yinwm/feat/refactor-provider-by-protocol
feat(config): refactor provider architecture to protocol-based model_list
2026-02-20 13:31:30 +08:00
yinwm 723f4e84ef Merge upstream main into feat/refactor-provider-by-protocol
Resolved conflicts:
- pkg/config/config.go: Removed duplicate DefaultConfig() (already in defaults.go)

Upstream changes:
- Added Session.DMScope default value ("main")
- Various channel improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:29:30 +08:00
hsohinna 4adafa8890 fix(channels): channels session key routing (#489)
* fix(onebot): add metadata for direct and group message handling
* fix(qq): add metadata for direct and group message handling
* fix(dingtalk): add metadata for direct and group message handling
* fix(feishu): add metadata for direct and group message handling
* fix(whatsapp): add metadata for direct and group message handlinga
* fix(line): add metadata for direct and group message handling
* fix(maixcam): add metadata for person detection handling
* fix(config): add default session configuration with DMScope
2026-02-20 13:27:08 +08:00
yinwm 23c39f41df Merge upstream main into feat/refactor-provider-by-protocol
Resolved conflicts:
- pkg/config/config.go: Removed duplicate DefaultConfig() (already in defaults.go)
- pkg/config/defaults.go: Updated Temperature to *float64 (nil default)

Upstream changes included:
- Temperature changed from float64 to *float64 (nil means use provider default)
- New HeartbeatConfig and DevicesConfig
- Various agent and tool improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:25:26 +08:00
yinwm ea447c6b68 refactor(auth): extract supported providers message as constant
Address review comment from @xiaket - the "Supported providers" message
was printed in multiple places. Now extracted as a constant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:20:59 +08:00
yinwm dc9fb327c2 chore: update Claude model references to claude-sonnet-4.6
Replace all claude-sonnet-4 references with claude-sonnet-4.6 across
codebase including documentation, tests, and configuration examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:15:04 +08:00
yinwm 7572e3b95d fix(config): allow duplicate model_name for load balancing
Remove duplicate model_name check in ValidateModelList to support
load balancing feature where multiple configs can share the same
model_name for round-robin selection.

Update tests to reflect the new behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:46:28 +08:00
yinwm a1d694b8f1 fix(migrate): add github_copilot to supportedProviders
Add github_copilot to the supportedProviders map to match
the providers handled in MergeConfig.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:43:45 +08:00
yinwm 5cd1597674 fix: remove unnecessary lock mechanism and upgrade Claude 3 to Claude 4
- Remove sync.RWMutex and rrCounters from Config struct
- Simplify GetModelConfig to use global atomic counter for load balancing
- Remove unnecessary locks from HasProvidersConfig, SaveConfig, etc.
- Add buildModelWithProtocol helper to handle models with existing prefix
- Fix TestCreateProviderReturnsHTTPProviderForOpenRouter to use model_list
- Upgrade all Claude 3 references to Claude 4 across documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:34:52 +08:00
yinwm b7c906fe18 docs: update providers deprecation comment
Change "removed in v2.0" to "removed in a future version"
for the deprecated providers section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:52:03 +08:00
yinwm 6ad85d225b fix(auth): preserve model_list and use gpt-5.2 for Codex API
Auth fixes:
- Fix OpenAI/Anthropic OAuth and token login to update ModelList
- Fix logout to clear AuthMethod in ModelList
- Add helper functions: isOpenAIModel, isAnthropicModel, isAntigravityModel
- Fix slice bounds panic in isAntigravityModel using strings.HasPrefix
- All auth operations now preserve existing model_list configuration

Factory provider fixes:
- Add OAuth support for openai protocol in CreateProviderFromConfig
- CodexAuthProvider is now used when auth_method is oauth/token

Default model updates:
- OpenAI login: set default model to gpt-5.2
- Anthropic login: set default model to claude-sonnet-4
- Antigravity login: set default model to gemini-flash (remove provider field)

Model changes:
- Change default OpenAI model from gpt-4o to gpt-5.2
- gpt-5.2 is compatible with Codex API (chatgpt.com backend)
- Update all README files, config examples, and migration code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:48:27 +08:00
yinwm df6958f312 feat(config): add complete model_list template with all 17 providers
- Include all 17 supported providers in default config as templates
- Each entry has model_name, model, api_base, and empty api_key
- Add comments with API key links for each provider
- Keep onboard message simple (only OpenRouter and Ollama)
- Fix duplicate model_name (cerebras-llama-3.3-70b)

Providers included:
Zhipu, OpenAI, Anthropic, DeepSeek, Gemini, Qwen, Moonshot,
Groq, OpenRouter, NVIDIA, Cerebras, Volcengine, ShengsuanYun,
Antigravity, GitHub Copilot, Ollama, VLLM

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:30:09 +08:00
Artem Yadelskyi a896831903 feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
Artem Yadelskyi 2038f04d0d Merge branch 'main' into fix-formatting
# Conflicts:
#	pkg/agent/loop.go
#	pkg/agent/loop_test.go
#	pkg/channels/discord.go
#	pkg/channels/onebot.go
#	pkg/config/config.go
#	pkg/tools/subagent_tool_test.go
2026-02-19 22:04:48 +02:00
cointem 394d1d1197 fix: Templates update (#485)
* fix: add MaxTokens and Temperature fields to AgentInstance and update related logic

* feat: add MaxTokens and Temperature options to SubagentManager and update tool loop logic

* feat: add default temperature handling and update related tests

* feat: allow temperature 0 and distinguish unset

* fix: format MockLLMProvider struct in subagent_tool_test.go
2026-02-19 19:16:37 +01:00
yinwm e2d37f09bf style: run gofmt to fix code formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 01:27:00 +08:00
yinwm 9f5ff95cc2 docs: add model_list configuration to all language READMEs
Add comprehensive Model Configuration (model_list) section to all 6 language versions:
- English, Chinese (zh), French (fr), Japanese (ja), Portuguese (pt-br), Vietnamese (vi)

Key additions:
- Complete vendor list (17 providers) with protocol prefixes and API base URLs
- Basic and vendor-specific configuration examples
- Load balancing documentation
- Migration guide from legacy providers config
- Multi-agent support design rationale

Replace Chinese vendor names with English/Pinyin in non-Chinese versions for better readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 01:22:06 +08:00
yinwm c08deb93d1 refactor(config): use provider-specific protocol instead of generic openai protocol
Update model configurations to use provider-specific protocols (zhipu, vllm,
gemini, shengsuanyun, deepseek, volcengine) instead of using the generic
"openai" protocol for all providers. This change ensures each provider
uses its correct protocol identifier and model naming convention.
2026-02-20 01:07:36 +08:00
yinwm 7f241647be feat(providers): add thought_signature support for gemini
Add support for persisting thought_signature metadata from Google/Gemini 3
models. This introduces ExtraContent and GoogleExtra types to handle
provider-specific metadata, and ensures thought signatures are properly
preserved through the tool call lifecycle.
2026-02-20 00:36:31 +08:00
yinwm 68cdafc5f2 refactor(providers): restructure provider creation with protocol-based configuration
- Move provider creation logic to factory_provider.go with protocol-based approach
- Add OpenAIProviderConfig with WebSearch support and embedded ProviderConfig
- Add maxTokensField to OpenAI-compatible provider for configurable token field
- Introduce new providers: Ollama, DeepSeek, GitHubCopilot, Antigravity, Qwen
- Remove redundant CreateProvider function from factory.go
- Add ThoughtSignature field to FunctionCall for tool response handling
- Remove duplicate Name field assignment in tool loop
- Update tests to reflect new provider configuration structure
2026-02-20 00:12:01 +08:00
yinwm f8f1d539d4 Merge remote-tracking branch 'origin/main' into feat/refactor-provider-by-protocol 2026-02-20 00:11:46 +08:00
yinwm 1e96733435 fix(agent): avoid consecutive system messages in compression
Append emergency compression note to the original system prompt
instead of creating a separate system message. Some APIs like
Zhipu reject two consecutive system messages.
2026-02-19 22:47:03 +08:00
Edouard CLAUDE 521359ed4f docs: add French README (README.fr.md) (#408) 2026-02-19 14:23:06 +01:00
Jex 213274002a fix: keep Discord typing indicator alive during agent processing (#391)
* fix: keep Discord typing indicator alive during agent processing

Discord's ChannelTyping() expires after ~10s, but agent processing
(LLM + tool execution) typically takes 30-60s+. Replace single-fire
ChannelTyping() with a self-managed typing loop inside DiscordChannel.

- startTyping(chatID): goroutine refreshes ChannelTyping every 8s
- stopTyping(chatID): called in Send() when response is dispatched
- Stop() cleans up all typing goroutines on shutdown
- startTyping placed after all early returns to prevent goroutine leaks

Typing lifecycle fully contained in channel layer, no interface changes.

Fixes #390

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

* fix: add goroutine safety to Discord typing indicator

- Add 5-minute timeout as safety net to prevent indefinite goroutine leaks
  when agent produces no outbound message (empty response, panic, etc.)
- Listen on c.ctx.Done() so goroutine exits when channel context is cancelled
- Log ChannelTyping() errors at debug level for diagnostics (rate limits, session closed)

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 13:28:58 +01:00
tpkeeper 12f0c4a6cf fix: ensure tool name is correctly assigned in LLM iteration(missing tool call name in debug mode logs) (#454)
* fix: ensure tool name is correctly assigned in LLM iteration

* fix: ensure tool name is correctly included in assistant message
2026-02-19 12:06:09 +01:00
Ruslan Semagin 32c5c4b3a4 refactor: replace bool map with set-style map for internal channels (#472)
* refactor: replace bool map with set-style map for internal channels

Use map[string]struct{} and comma-ok idiom for clearer and more idiomatic membership checks.

* Update pkg/constants/channels.go

Co-authored-by: Harsh Bansal <122075346+harshbansal7@users.noreply.github.com>

---------

Co-authored-by: Harsh Bansal <122075346+harshbansal7@users.noreply.github.com>
2026-02-19 11:48:17 +01:00
hsohinna 56a060ff61 feat(onebot): enhance OneBot channel (#192)
* fix: change BotStatus type to json.RawMessage and add isAPIResponse function

* feat(onebot): add rich media, API callback, keepalive and voice transcription

   Comprehensive improvements to the OneBot channel for better NapCatQQ
   compatibility:

   - Add echo-based API callback mechanism (sendAPIRequest) for
     request/response correlation via pending map
   - Add WebSocket ping/pong keepalive (30s ping, 60s read deadline)
   - Fetch bot self ID via get_login_info on connect/reconnect
   - Refactor parseMessageContentEx into parseMessageSegments supporting
     image, record, video, file, reply, face, forward segments
   - Add voice transcription via Groq transcriber (SetTranscriber)
   - Switch to message segment array format for sending with auto reply
     quote via lastMessageID tracking
   - Add message_sent event handling and detailed notice event processing
     (recall, poke, group increase/decrease, friend add, etc.)
   - Use sync/atomic for echoCounter, optimize listen() lock pattern
   - Clean up pending callbacks on Stop(), defer temp file cleanup
   - Mount Groq transcriber on OneBot channel in main.go gateway

* feat(onebot): add user ID allowlist check for incoming messages

- Currently, the agent does not respond to messages sent by users outside the allowlist.

* refactor(onebot): simplify channel implementation and add emoji reaction

- onebot.go from 1179 to 980 lines (~17%)
2026-02-19 14:39:35 +08:00
yinwm 58b5e21d90 fix(config): support legacy config without provider field
When no provider field is set but model is specified, use the user's model
as ModelName for the first provider. This maintains backward compatibility
with old configs that relied on implicit provider selection and ensures
GetModelConfig(model) can find the model by its configured name.
2026-02-19 13:05:21 +08:00