Commit Graph

479 Commits

Author SHA1 Message Date
Achton Smidt Winther ec6da7a530 fix: reject empty task in spawn tool (#740)
The spawn tool accepts empty strings as valid task arguments, which
causes a subagent to run with no meaningful work. The subagent's
completion message is then routed back to the originating channel
(e.g. Signal, Discord), where the main agent processes it and may
hallucinate an unrelated response that gets sent to users.

Validate that the task parameter is non-empty after trimming whitespace.

Related: #545

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 07:39:49 +11:00
daming大铭 fd26fa7459 Merge pull request #587 from nayihz/feat_webtool_proxy
feat: add HTTP proxy support for web tools
2026-02-24 23:51:01 +08:00
daming大铭 eb138a3f13 Merge pull request #642 from Lixeer/main
fix: better session management for `github_copilot_provider`
2026-02-24 23:18:14 +08:00
Lixeer d09c64fcee fix: implement code review suggestions
Address all feedback from PR review:
- Lock granularity
- Empty response handling
- Shutdown race condition
- Interface naming
2026-02-24 22:33:04 +08:00
Kai Xia(夏恺) 100356e8ec refactor: cleanup dead code and turn on dead code detection in CI (#515)
* cleanup dead code.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* add these two back with flag.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* fix ci

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* remove this confusing line

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* make fmt

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* remove unused method.

picked up by golangci-lint run

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

---------

Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2026-02-24 21:52:25 +08:00
daming大铭 18ba88869a Merge pull request #722 from ihao/main
fix: add CGO_ENABLED=0 for static build to fix cross-platform GLIBC e…
2026-02-24 19:53:38 +08:00
daming大铭 b10555cad2 Merge pull request #726 from xiaket/devx-make-improvements
DevX: minor improvements in Makefile
2026-02-24 19:46:36 +08:00
daming大铭 9cc0f8e685 Merge pull request #724 from mqyang56/fix/model-list-default-value-leak
fix: prevent DefaultConfig template values from leaking into user model_list entries
2026-02-24 19:43:23 +08:00
daming大铭 d20cb364a2 Merge pull request #677 from yinwm/refactor/model-to-model-name
refactor(config): rename model field to model_name
2026-02-24 19:05:40 +08:00
yinwm 01e2354b97 fix: align map values for proper formatting 2026-02-24 19:04:38 +08:00
Kai Xia 78e5bdad29 minor improvements in Makefile
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2026-02-24 22:04:23 +11:00
yangmanqing 0d761ca608 fix: prevent DefaultConfig template values from leaking into user model_list entries 2026-02-24 17:57:28 +08:00
root 8405d390df fix: add CGO_ENABLED=0 for static build to fix cross-platform GLIBC errors 2026-02-24 04:19:18 -05:00
nayihz 76f2b42d5b feat: improve web proxy handling and coverage 2026-02-24 17:17:14 +08:00
Guoguo 8774526616 docs: add wechat and discord badge (#707)
Signed-off-by: Guoguo <i@qwq.trade>
2026-02-24 14:47:40 +08:00
daming大铭 b6e965e549 Merge pull request #604 from winterfx/fix/reasoning-content-missing
fix: preserve reasoning_content for OpenAI-compatible reasoning models
2026-02-24 14:20:36 +08:00
Guoguo 0434b49e8d docs: update wechat qrcode (#705) 2026-02-24 13:58:54 +08:00
Meng Zhuo 7cbfa89a96 Merge pull request #697 from xiaket/doc-remove-chinese-comments
[doc]translate Chinese comments
2026-02-24 08:36:18 +08:00
Kai Xia 6fb61539d7 translate Chinese comments
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2026-02-24 10:27:49 +11:00
mattn 6fe3920a4d perf: refactoring collecting skills (#688)
* perf: refactoring collecting skills

* Fix order to store dir.Name()

* Add tests
2026-02-24 10:07:09 +11:00
Goksu Ceylan 09b1992dd7 fix(security): ensure custom deny patterns extend defaults instead of replacing them (#479)
* fix (security): custom deny patterns denying default patterns

* fix formatting whitespace
2026-02-24 09:02:44 +11:00
0x5487 2fa51d7b86 fix(security): change gateway default bind to 127.0.0.1 (#393)
* chore: Update default host bindings from 0.0.0.0 to 127.0.0.1 for various services and examples.

* config: Update default host bindings to 0.0.0.0 for improved Docker accessibility and add related documentation.

* chore: resolve conflict

* chore: remove link

* docs: Add a tip for Docker users regarding gateway host configuration to the French and Vietnamese READMEs.

* fix: typo issue

* docs: Update Chinese README.zh.md.
2026-02-24 08:54:10 +11:00
Chujiang 8a53cb9665 fix: align Docker Go version with go.mod and optimize logger (#596)
- Update Dockerfile to use golang:1.25-alpine to match go.mod (go 1.25.7)
- Optimize logger by avoiding string concatenation in file writes
- Add explicit empty string assignment for fieldStr when no fields

These changes improve build consistency and reduce memory allocations
in the hot logging path, which is important for the project's goal
of running on resource-constrained devices (<10MB RAM).

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 08:52:16 +11:00
美電球 ae74fa3812 Merge pull request #541 from edouard-claude/feat/mistral-provider
feat: add native Mistral AI provider support
2026-02-23 21:06:26 +08:00
Zenix 6d487a12b2 fix: make install should be aware of the textfile busy since it tries to overwrite the file with non-atomic operation (#558) 2026-02-23 21:29:43 +11:00
0x5487 19c698356c fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464)
* chore: Update default host bindings from 0.0.0.0 to 127.0.0.1 for various services and examples.

* config: Update default host bindings to 0.0.0.0 for improved Docker accessibility and add related documentation.

* refactor: reimplement filesystem tools with `os.OpenRoot` for enhanced security and simplified path validation.

* chore: revert other PR content from this branch

* docs: Update Chinese README.

* docs: Update Chinese README.

* docs: Update Chinese README.

* refactor: Reorder filesystem helper functions, extract directory entry formatting logic, and enhance `WriteFileTool`'s result message.

* feat: Enhance `mkdirAllInRoot` to prevent creating directories over existing files and add tests for directory creation functionality.

* Refactor filesystem tools to use a `fileReadWriter` interface for both host and sandboxed I/O, improving atomic writes and error handling.

* refactor: unify filesystem read/write operations with atomic write guarantees and clearer naming.

* refactor: rename `appendFileWithRW` function to `appendFile`

* refactor: unify filesystem access by introducing a `fileSystem` interface and updating tools to use it directly, removing `os.Root` dependency from `sandboxFs`.

* chore: run make fmt

* fix: `validatePath` now returns an error when the workspace is empty.
2026-02-23 20:09:53 +11:00
yinwm e76e45f30f Merge remote-tracking branch 'origin/main' into refactor/model-to-model-name 2026-02-23 16:56:20 +08:00
yinwm 712f5a8300 refactor(config): rename model field to model_name
The configuration field for specifying the model has been renamed from
"model" to "model_name" for better clarity and consistency with the
model_list configuration.

A GetModelName() accessor method has been added to maintain backward
compatibility. Existing configurations using the old "model" field will
continue to work correctly.

This change affects:
- Configuration structure (AgentDefaults struct)
- All references across the codebase
- Documentation in all language variants
- Example configuration files
2026-02-23 16:55:06 +08:00
Vidish 4cc8b90da9 Fix: missing Tavily config in loop.go, and the invalid config param in web_search (#660) 2026-02-23 12:12:34 +08:00
Kai Xia(夏恺) 8928f83c7f remove old roadmap (#632) 2026-02-23 09:45:17 +11:00
美電球 6b429de927 golangci-lint run --fix on master (#656)
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2026-02-23 06:22:47 +08:00
Kai Xia 4a73415e05 golangci-lint run --fix on master
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
2026-02-23 08:09:26 +11:00
Vidish c6865fe852 feat: integrate Tavily search (#340)
* feat: integrate Tavily search

* fix: set include_raw_content to false in Tavily search as wealready get relevant data inside content

* refactor: update Go type declarations to `any`, apply formatting fixes.
2026-02-23 00:30:14 +08:00
Lixeer 3d605a4f53 fix: run fmt and lint 2026-02-22 23:02:29 +08:00
Lixeer a849e02917 fix: better session management for github_copilot_provider 2026-02-22 22:30:53 +08:00
King Tai cb0c8703fb test(tools,utils): add ToolRegistry unit tests and fix Truncate panic on negative maxLen (#517)
Add comprehensive unit tests for the ToolRegistry covering registration,
lookup, execution, context injection, async callbacks, schema generation,
provider definition conversion, and concurrent access.

Fix a defensive edge case in Truncate where a negative maxLen would cause
a slice bounds panic, and add table-driven tests covering boundary
conditions, zero/negative lengths, and Unicode handling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-22 21:40:59 +11:00
Ali Zulfiqar 6b55fb5f1d docs: fix typos, broken links and inconsistencies in README (#608)
* docs: fix typos, broken links and inconsistencies in README

* docs: revert unintentional bullet style changes

* docs: fix changes

* docs: fixing issues

* docs: updating roadmap link

* docs: removing *
2026-02-22 21:00:15 +11:00
Edouard CLAUDE 34a8ce5af0 fix: remove extra fields from ToolCall JSON serialization
Mistral's API strictly validates tool_calls in assistant messages and
rejects non-standard fields. The ToolCall struct had Name and Arguments
as top-level JSON fields, duplicating data already in Function.Name
and Function.Arguments. OpenAI silently ignored these extras but
Mistral returns 422.

Change json tags to "-" so these internal fields are no longer
serialized to API payloads while remaining available in Go code.
2026-02-22 11:40:21 +04:00
Edouard CLAUDE 65422a16a4 feat: add native Mistral AI provider support
Add Mistral as a first-class provider alongside the 17 existing ones.
Mistral uses the OpenAI-compatible API at https://api.mistral.ai/v1
with provider-specific model prefix stripping (mistral/model → model).

Changes:
- Add Mistral to ProvidersConfig, IsEmpty(), HasProvidersConfig()
- Add mistral entry in default model_list (defaults.go)
- Add mistral protocol in factory_provider.go and getDefaultAPIBase()
- Add mistral prefix stripping in openai_compat normalizeModel()
- Add mistral case in legacy factory.go resolveProviderSelection()
- Add mistral migration entry in ConvertProvidersToModelList()
- Add mistral to supported providers in migrate/config.go
- Add mistral section in config.example.json
- Update AllProviders test (17 → 18 providers)

Tested end-to-end with mistral-small-latest model.
2026-02-22 11:40:21 +04:00
Yoftahe Abraham cec6fd4cd4 fix: should use fmt.Printf instead of fmt.Print(fmt.Sprintf(...)) (#623) 2026-02-22 18:27:38 +11:00
kernoeb b9a66248d8 fix: resolve Groq STT key from model_list when providers.groq is absent (#602)
When users migrate from the legacy `providers` config to the new
`model_list` format, voice transcription silently breaks on Telegram,
Discord and Slack channels.

The gateway was reading the Groq API key exclusively from
`cfg.Providers.Groq.APIKey`, which is empty once the key is defined
only inside a `model_list` entry. The transcriber was never initialized,
so voice messages fell back to a plain `[voice]` placeholder.

This fix also scans `model_list` for any entry whose `model` field
starts with `groq/` and uses its `api_key` as a fallback, preserving
full backward compatibility with the legacy `providers.groq` field.
2026-02-22 11:32:44 +11:00
Albert Simon c51ceac70b fix: updated model configuration links at readme (#544)
Signed-off-by: Albert Simon <simon.albert75@gmail.com>
2026-02-22 09:53:53 +11:00
winterfx d224397f40 fix: preserve reasoning_content for OpenAI-compatible reasoning models
Models like Moonshot kimi-k2.5 and DeepSeek-R1 return a
reasoning_content field in assistant messages. When thinking is enabled,
the API requires this field to be echoed back in subsequent requests.
PicoClaw was silently dropping it, causing 400 errors on tool-call
round-trips.

- Add ReasoningContent to Message and LLMResponse types
- Parse reasoning_content in openai_compat parseResponse()
- Carry reasoning_content through assistant tool-call messages
- Add unit test for reasoning_content parsing

Fixes #588
2026-02-21 23:29:40 +08:00
daming大铭 40f9630eea Merge pull request #590 from alexhoshina/docs
docs: add Chinese channel documentation
2026-02-21 22:49:05 +08:00
zepan aea4f25c83 1. update wechat qrcode. 2. add CONTRIBUTING.md 2026-02-21 22:45:47 +08:00
Hoshina 023b245a28 docs: add Chinese channel documentation 2026-02-21 18:00:19 +08:00
美電球 bb8b9243b7 Merge pull request #592 from alexhoshina/main
fix: golangci-lint run --fix
2026-02-21 16:21:34 +08:00
Hoshina 0066602294 fix: golangci-lint run --fix 2026-02-21 16:20:15 +08:00
Hoshina 3df7f70540 fix: golangci-lint fmt 2026-02-21 16:05:39 +08:00
Luke Milby 80c8b57533 Fix Memory Write (#557)
* fix issue where memory will only trigger when asked to remember something

* updated prompt for memory usage
2026-02-21 08:21:38 +08:00