Skip to content

Commit 447c17a

Browse files
committed
merge: sync upstream/main (PR sipeed#213) into feat/multi-agent-routing
Resolve conflicts in pkg/providers/types.go and pkg/agent/loop.go: - types.go: use protocoltypes aliases from PR sipeed#213, keep fallback types - loop.go: drop old single-agent createToolRegistry (replaced by multi-agent pattern) Refactor to align with PR sipeed#213 patterns: - instance.go: use NewExecToolWithConfig (accept full config for deny patterns) - registry.go: pass full config to NewAgentInstance - loop.go: add Perplexity web search options to registerSharedTools
2 parents 12007b5 + e61786c commit 447c17a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4549
-858
lines changed

.github/pull_request_template.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## 📝 Description
2+
3+
<!-- Please briefly describe the changes and purpose of this PR -->
4+
5+
## 🗣️ Type of Change
6+
- [ ] 🐞 Bug fix (non-breaking change which fixes an issue)
7+
- [ ] ✨ New feature (non-breaking change which adds functionality)
8+
- [ ] 📖 Documentation update
9+
- [ ] ⚡ Code refactoring (no functional changes, no api changes)
10+
11+
## 🤖 AI Code Generation
12+
- [ ] 🤖 Fully AI-generated (100% AI, 0% Human)
13+
- [ ] 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
14+
- [ ] 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)
15+
16+
17+
## 🔗 Related Issue
18+
19+
<!-- Please link the related issue(s) (e.g., Fixes #123, Closes #456) -->
20+
21+
## 📚 Technical Context (Skip for Docs)
22+
- **Reference URL:**
23+
- **Reasoning:**
24+
25+
## 🧪 Test Environment
26+
- **Hardware:** <!-- e.g. Raspberry Pi 5, Orange Pi, PC-->
27+
- **OS:** <!-- e.g. Debian 12, Ubuntu 22.04 -->
28+
- **Model/Provider:** <!-- e.g. OpenAI GPT-4o, Kimi k2, DeepSeek-V3 -->
29+
- **Channels:** <!-- e.g. Discord, Telegram, Feishu, ... -->
30+
31+
32+
## 📸 Evidence (Optional)
33+
<details>
34+
<summary>Click to view Logs/Screenshots</summary>
35+
36+
<!-- Please paste relevant screenshots or logs here -->
37+
38+
</details>
39+
40+
## ☑️ Checklist
41+
- [ ] My code/docs follow the style of this project.
42+
- [ ] I have performed a self-review of my own changes.
43+
- [ ] I have updated the documentation accordingly.

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ jobs:
3232

3333
- name: Create and push tag
3434
shell: bash
35+
env:
36+
RELEASE_TAG: ${{ inputs.tag }}
3537
run: |
3638
git config user.name "github-actions[bot]"
3739
git config user.email "github-actions[bot]@users.noreply.github.com"
38-
git tag -a "${{ inputs.tag }}" -m "Release ${{ inputs.tag }}"
39-
git push origin "${{ inputs.tag }}"
40+
git tag -a "$RELEASE_TAG" -m "Release $RELEASE_TAG"
41+
git push origin "$RELEASE_TAG"
4042
4143
release:
4244
name: GoReleaser Release
@@ -53,6 +55,7 @@ jobs:
5355
ref: ${{ inputs.tag }}
5456

5557
- name: Setup Go from go.mod
58+
id: setup-go
5659
uses: actions/setup-go@v5
5760
with:
5861
go-version-file: go.mod
@@ -87,6 +90,7 @@ jobs:
8790
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8891
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
8992
DOCKERHUB_IMAGE_NAME: ${{ vars.DOCKERHUB_REPOSITORY }}
93+
GOVERSION: ${{ steps.setup-go.outputs.go-version }}
9094

9195
- name: Apply release flags
9296
shell: bash

.goreleaser.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ builds:
1111
- id: picoclaw
1212
env:
1313
- CGO_ENABLED=0
14+
tags:
15+
- stdjson
16+
ldflags:
17+
- -s -w
18+
- -X main.version={{ .Version }}
19+
- -X main.gitCommit={{ .ShortCommit }}
20+
- -X main.buildTime={{ .Date }}
21+
- -X main.goVersion={{ .Env.GOVERSION }}
1422
goos:
1523
- linux
1624
- windows

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
2929
# Copy binary
3030
COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw
3131

32-
# Create picoclaw home directory
32+
# Create non-root user and group
33+
RUN addgroup -g 1000 picoclaw && \
34+
adduser -D -u 1000 -G picoclaw picoclaw
35+
36+
# Switch to non-root user
37+
USER picoclaw
38+
39+
# Run onboard to create initial directories and config
3340
RUN /usr/local/bin/picoclaw onboard
3441

3542
ENTRYPOINT ["picoclaw"]

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ VERSION?=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
1111
GIT_COMMIT=$(shell git rev-parse --short=8 HEAD 2>/dev/null || echo "dev")
1212
BUILD_TIME=$(shell date +%FT%T%z)
1313
GO_VERSION=$(shell $(GO) version | awk '{print $$3}')
14-
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT) -X main.buildTime=$(BUILD_TIME) -X main.goVersion=$(GO_VERSION)"
14+
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT) -X main.buildTime=$(BUILD_TIME) -X main.goVersion=$(GO_VERSION) -s -w"
1515

1616
# Go variables
1717
GO?=go
18-
GOFLAGS?=-v
18+
GOFLAGS?=-v -tags stdjson
1919

2020
# Installation
2121
INSTALL_PREFIX?=$(HOME)/.local
@@ -39,6 +39,8 @@ ifeq ($(UNAME_S),Linux)
3939
ARCH=amd64
4040
else ifeq ($(UNAME_M),aarch64)
4141
ARCH=arm64
42+
else ifeq ($(UNAME_M),loongarch64)
43+
ARCH=loong64
4244
else ifeq ($(UNAME_M),riscv64)
4345
ARCH=riscv64
4446
else
@@ -84,6 +86,7 @@ build-all: generate
8486
@mkdir -p $(BUILD_DIR)
8587
GOOS=linux GOARCH=amd64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./$(CMD_DIR)
8688
GOOS=linux GOARCH=arm64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 ./$(CMD_DIR)
89+
GOOS=linux GOARCH=loong64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-loong64 ./$(CMD_DIR)
8790
GOOS=linux GOARCH=riscv64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-riscv64 ./$(CMD_DIR)
8891
GOOS=darwin GOARCH=arm64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 ./$(CMD_DIR)
8992
GOOS=windows GOARCH=amd64 $(GO) build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe ./$(CMD_DIR)

README.ja.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<h1>PicoClaw: Go で書かれた超効率 AI アシスタント</h1>
55

6-
<h3>$10 ハードウェア · 10MB RAM · 1秒起動 · 皮皮虾,我们走!</h3>
6+
<h3>$10 ハードウェア · 10MB RAM · 1秒起動 · 行くぜ、シャコ!</h3>
77
<h3></h3>
88

99
<p>
@@ -12,7 +12,7 @@
1212
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
1313
</p>
1414

15-
**日本語** | [English](README.md)
15+
[中文](README.zh.md) | **日本語** | [Português](README.pt-br.md) | [Tiếng Việt](README.vi.md) | [English](README.md)
1616

1717
</div>
1818

@@ -39,7 +39,7 @@
3939
</table>
4040

4141
## 📢 ニュース
42-
2026-02-09 🎉 PicoClaw リリース!$10 ハードウェアで 10MB 未満の RAM で動く AI エージェントを 1 日で構築。🦐 皮皮虾,我们走
42+
2026-02-09 🎉 PicoClaw リリース!$10 ハードウェアで 10MB 未満の RAM で動く AI エージェントを 1 日で構築。🦐 行くぜ、シャコ
4343

4444
## ✨ 特徴
4545

@@ -195,6 +195,9 @@ picoclaw onboard
195195
"api_key": "YOUR_BRAVE_API_KEY",
196196
"max_results": 5
197197
}
198+
},
199+
"cron": {
200+
"exec_timeout_minutes": 5
198201
}
199202
},
200203
"heartbeat": {
@@ -250,7 +253,7 @@ Telegram、Discord、QQ、DingTalk、LINE で PicoClaw と会話できます
250253
"telegram": {
251254
"enabled": true,
252255
"token": "YOUR_BOT_TOKEN",
253-
"allowFrom": ["YOUR_USER_ID"]
256+
"allow_from": ["YOUR_USER_ID"]
254257
}
255258
}
256259
}
@@ -290,7 +293,7 @@ picoclaw gateway
290293
"discord": {
291294
"enabled": true,
292295
"token": "YOUR_BOT_TOKEN",
293-
"allowFrom": ["YOUR_USER_ID"]
296+
"allow_from": ["YOUR_USER_ID"]
294297
}
295298
}
296299
}
@@ -673,7 +676,7 @@ HEARTBEAT_OK 応答 ユーザーが直接結果を受け取る
673676
"telegram": {
674677
"enabled": true,
675678
"token": "123456:ABC...",
676-
"allowFrom": ["123456789"]
679+
"allow_from": ["123456789"]
677680
},
678681
"discord": {
679682
"enabled": true,
@@ -689,14 +692,17 @@ HEARTBEAT_OK 応答 ユーザーが直接結果を受け取る
689692
"appSecret": "xxx",
690693
"encryptKey": "",
691694
"verificationToken": "",
692-
"allowFrom": []
695+
"allow_from": []
693696
}
694697
},
695698
"tools": {
696699
"web": {
697700
"search": {
698701
"apiKey": "BSA..."
699702
}
703+
},
704+
"cron": {
705+
"exec_timeout_minutes": 5
700706
}
701707
},
702708
"heartbeat": {
@@ -729,7 +735,7 @@ Discord: https://discord.gg/V4sAZ9XWpN
729735

730736
## 🐛 トラブルシューティング
731737

732-
### Web 検索で「API 配置问题」と表示される
738+
### Web 検索で「API 設定の問題」と表示される
733739

734740
検索 API キーをまだ設定していない場合、これは正常です。PicoClaw は手動検索用の便利なリンクを提供します。
735741

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<a href="https://x.com/SipeedIO"><img src="https://img.shields.io/badge/X_(Twitter)-SipeedIO-black?style=flat&logo=x&logoColor=white" alt="Twitter"></a>
1515
</p>
1616

17-
[中文](README.zh.md) | [日本語](README.ja.md) | **English**
17+
[中文](README.zh.md) | [日本語](README.ja.md) | [Português](README.pt-br.md) | [Tiếng Việt](README.vi.md) | **English**
1818
</div>
1919

2020
---
@@ -49,7 +49,7 @@
4949
5050

5151
## 📢 News
52-
2026-02-16 🎉 PicoClaw hit 12K stars in one week! Thank you all for your support! PicoClaw is growing faster than we ever imagined. Given the high volume of PRs, we urgently need community maintainers. Our volunteer roles and roadmap are officially posted [here](doc/picoclaw_community_roadmap_260216.md) —we can’t wait to have you on board!
52+
2026-02-16 🎉 PicoClaw hit 12K stars in one week! Thank you all for your support! PicoClaw is growing faster than we ever imagined. Given the high volume of PRs, we urgently need community maintainers. Our volunteer roles and roadmap are officially posted [here](docs/picoclaw_community_roadmap_260216.md) —we can’t wait to have you on board!
5353

5454
2026-02-13 🎉 PicoClaw hit 5000 stars in 4days! Thank you for the community! There are so many PRs&issues come in (during Chinese New Year holidays), we are finalizing the Project Roadmap and setting up the Developer Group to accelerate PicoClaw's development.
5555
🚀 Call to Action: Please submit your feature requests in GitHub Discussions. We will review and prioritize them during our upcoming weekly meeting.
@@ -99,6 +99,20 @@
9999
</tr>
100100
</table>
101101

102+
### 📱 Run on old Android Phones
103+
Give your decade-old phone a second life! Turn it into a smart AI Assistant with PicoClaw. Quick Start:
104+
1. **Install Termux** (Available on F-Droid or Google Play).
105+
2. **Execute cmds**
106+
```bash
107+
# Note: Replace v0.1.1 with the latest version from the Releases page
108+
wget https://github.com/sipeed/picoclaw/releases/download/v0.1.1/picoclaw-linux-arm64
109+
chmod +x picoclaw-linux-arm64
110+
pkg install proot
111+
termux-chroot ./picoclaw-linux-arm64 onboard
112+
```
113+
And then follow the instructions in the "Quick Start" section to complete the configuration!
114+
<img src="assets/termux.jpg" alt="PicoClaw" width="512">
115+
102116
### 🐜 Innovative Low-Footprint Deploy
103117

104118
PicoClaw can be deployed on almost any Linux device!
@@ -269,7 +283,7 @@ Talk to your picoclaw through Telegram, Discord, DingTalk, or LINE
269283
"telegram": {
270284
"enabled": true,
271285
"token": "YOUR_BOT_TOKEN",
272-
"allowFrom": ["YOUR_USER_ID"]
286+
"allow_from": ["YOUR_USER_ID"]
273287
}
274288
}
275289
}
@@ -312,7 +326,7 @@ picoclaw gateway
312326
"discord": {
313327
"enabled": true,
314328
"token": "YOUR_BOT_TOKEN",
315-
"allowFrom": ["YOUR_USER_ID"]
329+
"allow_from": ["YOUR_USER_ID"]
316330
}
317331
}
318332
}
@@ -665,6 +679,16 @@ The subagent has access to tools (message, web_search, etc.) and can communicate
665679
| `deepseek(To be tested)` | LLM (DeepSeek direct) | [platform.deepseek.com](https://platform.deepseek.com) |
666680
| `groq` | LLM + **Voice transcription** (Whisper) | [console.groq.com](https://console.groq.com) |
667681

682+
### Provider Architecture
683+
684+
PicoClaw routes providers by protocol family:
685+
686+
- OpenAI-compatible protocol: OpenRouter, OpenAI-compatible gateways, Groq, Zhipu, and vLLM-style endpoints.
687+
- Anthropic protocol: Claude-native API behavior.
688+
- Codex/OAuth path: OpenAI OAuth/token authentication route.
689+
690+
This keeps the runtime lightweight while making new OpenAI-compatible backends mostly a config operation (`api_base` + `api_key`).
691+
668692
<details>
669693
<summary><b>Zhipu</b></summary>
670694

@@ -760,6 +784,9 @@ picoclaw agent -m "Hello"
760784
"enabled": true,
761785
"max_results": 5
762786
}
787+
},
788+
"cron": {
789+
"exec_timeout_minutes": 5
763790
}
764791
},
765792
"heartbeat": {

0 commit comments

Comments
 (0)