Commit Graph

126 Commits

Author SHA1 Message Date
Lixeer
4b886b6573 fix: not used result 2026-02-15 08:02:23 +08:00
Lixeer
0a4bf32e81 try after workflow fix 2026-02-15 07:54:04 +08:00
Lixeer
5a6ad37dab code fmt 2026-02-15 07:34:12 +08:00
Lixeer
f6d6221c09 make fmt 2026-02-15 07:00:40 +08:00
Lixeer
7a9659971d make fmt 2026-02-15 06:55:20 +08:00
Lixeer
ecbe31599e chore: remove redundant debug output 2026-02-15 06:30:31 +08:00
Lixeer
6c392c3387 fix: openclaw crash because of empty config 2026-02-15 06:11:07 +08:00
Lixeer
0aab8d8afc feat:add github_copilot to providers factory 2026-02-15 06:10:00 +08:00
Lixeer
5faa67b77d feat: add Github Copilot provider 2026-02-15 05:23:42 +08:00
Meng Zhuo
1cb690df32 Merge pull request #169 from PixelTux/architecture-32-bit
Architecture 32 bit
2026-02-14 17:27:20 +08:00
Meng Zhuo
59c7aa1628 Merge pull request #167 from Lixeer/main
feat: add provider `deepseek`
2026-02-14 17:27:01 +08:00
Meng Zhuo
b805ec8bde Merge pull request #158 from easyzoom/feat/device-hotplug-notifications
feat: add device hotplug event notifications (USB on Linux)
2026-02-14 17:17:53 +08:00
easyzoom
378045510d feat: add device hotplug event notifications (USB on Linux) 2026-02-14 17:03:04 +08:00
karan
2720fa71c7 add I2C and SPI tools for hardware interaction (#140)
* add I2C and SPI tools for hardware interaction

- Implemented I2CTool for I2C bus interaction, including device scanning, reading, and writing.
- Implemented SPITool for SPI bus communication, supporting device listing, data transfer, and reading.
- Added platform-specific implementations for Linux and stubs for non-Linux platforms.
- Updated agent loop to register new I2C and SPI tools.
- Created documentation for hardware skills, including usage examples and pinmux setup instructions.

* Remove build constraints for Linux from I2C and SPI tool files.
2026-02-14 16:53:17 +08:00
Lixeer
18d3634f1b feat: Improve parameter fault tolerance for DeepSeek 2026-02-14 16:47:46 +08:00
Lixeer
afc3a2cda3 feat: add provider deepseek 2026-02-14 16:35:49 +08:00
PixelTux
ba0ef4b62c Merge branch 'main' into architecture-32-bit 2026-02-14 09:32:24 +01:00
moveyield
1299b20465 refactor: remove unused min func
Signed-off-by: moveyield <moveyield@outlook.com>
2026-02-14 16:24:20 +08:00
ex-takashima
6463796fa1 fix: update tests to match upstream API changes
Fix web_test.go and config_test.go to use current function signatures
after merging upstream changes (WebSearchToolOptions, BraveConfig).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 11:32:42 +09:00
ex-takashima
ac79a23e0a style: fix gofmt formatting (CRLF -> LF)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 11:21:47 +09:00
ex-takashima
aa7a8b89c3 merge: resolve conflict with upstream main
Merge upstream changes (HeartbeatConfig addition) alongside LINEConfig.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:47:06 +09:00
ex-takashima
f294a71bc5 feat(channels): add LINE Official Account channel support
Add LINE Messaging API as the 9th messaging channel using HTTP Webhook.
Supports text/image/audio messages, group chat @mention detection,
reply with quote, and loading animation.

- No external SDK required (standard library only)
- HMAC-SHA256 webhook signature verification
- Reply Token (free) with Push API fallback
- Group chat: respond only when @mentioned
- Quote original message in replies using quoteToken

Closes #146

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 10:01:20 +09:00
PixelTux
2cb90f2fe6 Merge branch 'main' into architecture-32-bit 2026-02-13 21:18:34 +01:00
Avisek
45351a6a79 refactor: Trim trailing slashes from the API base URL and enhance API error messages with status codes. 2026-02-14 02:09:55 +08:00
lxowalle
1aea912fcd Merge pull request #83 from carzygod/main
update telegram username support
2026-02-14 00:49:14 +08:00
lxowalle
bd9c9d7efc Merge branch 'main' into main 2026-02-14 00:16:10 +08:00
Meng Zhuo
82a9a80d94 Merge pull request #130 from MHCP000/fix/codeblock-index-bug
fix: correct index bug in extractCodeBlocks and extractInlineCodes
2026-02-13 22:52:42 +08:00
lxowalle
878650c459 * fix: heartbeat/service_test.go test failed 2026-02-13 22:19:18 +08:00
lxowalle
bc27707671 Merge branch 'main' into main 2026-02-13 22:08:20 +08:00
zeo
1e17bac9f0 fix: correct index bug in extractCodeBlocks and extractInlineCodes
The previous implementation used len(codes)-1 in ReplaceAllStringFunc,
which caused all placeholders to point to the same (last) index.
This resulted in only the last code block being displayed correctly
when multiple code blocks were present in a message.

Now using a proper counter variable that increments for each match,
ensuring each code block gets a unique placeholder index.
2026-02-13 21:38:14 +08:00
Satyam Tiwari
c86e121688 refactor: update tool registry usage and enhance WebSearchTool execution result handling 2026-02-13 15:41:37 +05:30
Satyam Tiwari
e0a766243e Merge branch 'main' of https://github.com/sipeed/picoclaw 2026-02-13 15:36:43 +05:30
Meng Zhuo
584a3dcc87 misc: fmt code 2026-02-13 17:51:47 +08:00
Meng Zhuo
c58f8b740f Merge pull request #111 from shengsuan/ssy
add ShengSuanYun (胜算云) as a models provider
2026-02-13 17:41:15 +08:00
Satyam Tiwari
2f5849b39d feat: add support for DuckDuckGo and refactor Brave search configuration support the control with config.js 2026-02-13 14:42:55 +05:30
Zhaoyikaiii
cf5a84aac1 merge: resolve conflicts with upstream/main
Merge upstream/main into bugfix/fix-duplicate-telegram-messages.

Conflict resolutions:
- pkg/agent/loop.go: Adopt upstream's processSystemMessage which removes
  runAgentLoop call entirely (subagents now communicate via message tool
  directly). Keep PR's HasSentInRound() check in Run() for normal
  message processing path.
- pkg/tools/message.go: Merge both changes - keep sentInRound tracking
  from PR and adopt upstream's *ToolResult return type with Silent: true.
2026-02-13 16:52:33 +08:00
coohu
896eae4c56 feat: add ShengSuanYun(胜算云) as a models provider. 2026-02-13 15:55:59 +08:00
yinwm
8851152cbd refactor(tools): extract shared logic for internal channels and tool definitions
- Add constants package with IsInternalChannel helper to centralize internal channel checks across agent, channels, and heartbeat services
- Add ToProviderDefs method to ToolRegistry to consolidate tool definition conversion logic used in agent loop and tool loop
- Refactor SubagentTool.Execute to use RunToolLoop for consistent tool execution with iteration tracking
- Remove duplicate inline map definitions and type assertion code throughout codebase
2026-02-13 15:05:16 +08:00
Zhaoyikaiii
132fe7db51 bugfix: fix duplicate Telegram message sending
Two issues caused duplicate messages to be sent to users:

1. System messages (from subagent): processSystemMessage set SendResponse:true,
   causing runAgentLoop to publish outbound. Then Run() also published outbound
   using the returned response string, resulting in two identical messages.
   Fix: processSystemMessage now returns empty string since runAgentLoop already
   handles the send.

2. Message tool double-send: When LLM called the "message" tool during
   processing, it published outbound immediately. Then Run() published the
   final response again. Fix: Track whether MessageTool sent a message in the
   current round (sentInRound flag, reset on each SetContext call). Run()
   checks HasSentInRound() before publishing to avoid duplicates.
2026-02-13 14:41:21 +08:00
yinwm
0cce9fc905 refactor(agent): extract reusable tool loop and make subagents independent
Extract core LLM tool loop logic into shared RunToolLoop function that can be
used by both main agent and subagents. Subagents now run their own tool loop
with dedicated tool registry, enabling full independence.

Key changes:
- New pkg/tools/toolloop.go with reusable tool execution logic
- Subagents use message tool to communicate directly with users
- Heartbeat processing is now stateless via ProcessHeartbeat
- Simplified system message routing without result forwarding
- Shared tool registry creation for consistency between agents

This architecture follows openclaw's design where async tools notify via
bus and subagents handle their own user communication.
2026-02-13 14:39:39 +08:00
yinwm
4dfa133cb8 refactor(heartbeat): add configurable interval and channel-aware routing
feat(config): add heartbeat interval configuration with default 30 minutes

feat(state): migrate state file from workspace root to state directory

feat(channels): skip internal channels in outbound dispatcher

feat(agent): record last active channel for heartbeat context

refactor(subagent): use configurable default model instead of provider default
2026-02-13 11:13:32 +08:00
yinwm
8fbbb67f70 refactor(heartbeat): simplify service with single handler and direct bus usage
- Remove redundant ChannelSender interface, use *bus.MessageBus directly
- Consolidate two handlers (onHeartbeat, onHeartbeatWithTools) into one
- Move HEARTBEAT.md and heartbeat.log to workspace root
- Simplify NewHeartbeatService signature (remove handler param)
- Add SetBus and SetHandler methods for dependency injection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:51:51 +08:00
esubaalew
7fa341c449 fix concurrency and persistence safety in session/cron/heartbeat services 2026-02-12 23:11:28 +03:00
yinwm
b59464230a perf(cron): use read lock for concurrent reads in addJob 2026-02-13 02:15:56 +08:00
Wikig
875a16d2d6 update telegram username support 2026-02-13 02:09:59 +08:00
yinwm
e353844dfb feat: re-enable cronTool service after refactor completion
Re-enable cronTool service integration after completing the ToolResult
refactor (US-016). Removed all temporary disable comments and restored
full cron service lifecycle including start/stop operations.

Additional improvements:
- Add thread-safe access to onHeartbeatWithTools handler
- Fix channel parsing to handle user IDs with special characters
- Add error handling for state file loading failures
2026-02-13 02:09:49 +08:00
yinwm
474f3dbf90 fix: resolve code review issues in tool-result-refactor
1. Remove duplicate ToolResult definition in heartbeat package
   - Import tools.ToolResult instead of local definition
   - Add nil check for handler before execution

2. Fix SpawnTool to return AsyncResult and implement AsyncTool
   - Add callback field and SetCallback method
   - Return AsyncResult instead of NewToolResult

3. Add context cancellation support to SubagentManager
   - Check ctx.Done() before and during task execution
   - Set task status to "cancelled" on cancellation
   - Call callback with result on completion

4. Fix data race window in CronTool.addJob
   - Use Lock instead of RLock for channel/chatID access
   - Ensure consistent snapshot during job creation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:59:50 +08:00
yinwm
e7e086155e feat: merge heartbeat service improvements from feat-heartbeat branch
- Add ChannelSender interface for sending heartbeat results to users
- Add sendResponse() to automatically deliver results to last channel
- Add createDefaultHeartbeatTemplate() for first-run setup
- Support HEARTBEAT_OK silent response (legacy compatibility)
- Add structured logging with INFO/ERROR levels
- Move integration tests to separate file with build tag

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:42:22 +08:00
yinwm
ab20314882 Merge upstream/main into ralph/tool-result-refactor
Resolved conflicts:
- pkg/heartbeat/service.go: merged both 'started' field and 'onHeartbeatWithTools'
- pkg/tools/edit.go: use validatePath() with ToolResult return
- pkg/tools/filesystem.go: fixed return values to use ToolResult
- cmd/picoclaw/main.go: kept active setupCronTool, fixed toolsPkg import
- pkg/tools/cron.go: fixed Execute return value handling

Fixed tests for new function signatures (NewEditFileTool, NewAppendFileTool, NewExecTool)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:00:26 +08:00
Satyam Tiwari
53df8d1f3d feat: Add DuckDuckGo search fallback.
- Refactor web tool to use Provider pattern (Brave/DuckDuckGo)
- Add robust HTML scraping for keyless DuckDuckGo search
- Update README with search provider guidelines
2026-02-12 21:48:51 +05:30