Commit graph

159 commits

Author SHA1 Message Date
Mauro
34b4848214
Merge pull request #1838 from jonahzheng/patch-1
Update helpers.go
2026-03-30 14:23:38 +02:00
Cytown
50b8d9bf83 Merge branch 'main' into t3 2026-03-30 18:01:07 +08:00
daming大铭
cbe92286e9
Merge pull request #2184 from cytown/config
refactor config and add ModelConfig.Enabled
2026-03-30 17:23:07 +08:00
LC
ff0266a40e
feat(web): display backend version info in sidebar (#2087)
* feat(web): display backend version info in sidebar

* fix(web): improve version parsing and timeout behavior

* refactor(web): remove useless --version fallback

* feat(web): implement version info caching and improve retrieval logic

* fix(web): clarify version timeout rationale

* fix(web): harden gateway version probing and tests

* style(web): split regexp to two lines for lint
2026-03-30 16:44:50 +08:00
Cytown
93757812fc refactor config and add ModelConfig.Enabled 2026-03-30 14:01:20 +08:00
daming大铭
1fc5345857
refactor(cron): remove deliver and type params, unify agent execution path (#2147)
The agent path now publishes to outbound bus directly (since #2100),
making the deliver=true direct-to-bus shortcut and the directive type
prompt wrapping redundant. All cron jobs now uniformly route through
the agent. This is an intentional behavior change: old jobs with
deliver=true will execute through the agent instead of bypassing it.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 22:52:34 +08:00
Cytown
0bb561548f add pid file for gateway running and auth token for /reload and pico channel 2026-03-29 01:14:39 +08:00
Cytown
b646d3b8fe
refactor config and security to simplified the structure (#2068) 2026-03-28 00:03:34 +08:00
Liu Yuan
155af28841 feat(logger): add PICOCLAW_LOG_FILE env var for file-only logging 2026-03-25 21:34:27 +08:00
taorye
ee03d1247d
chore(tui): add build target for picoclaw-launcher TUI and create README for TUI launcher (#1995) 2026-03-25 16:17:26 +08:00
Hoshina
e760cb737c feat(auth): add wecom cli qr login 2026-03-24 20:23:29 +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
Cytown
df17684dd4 implement panic log for gateway and launcher
add file logger to gateway

ref issue: #1734

Signed-off-by: Cytown <cytown@gmail.com>
2026-03-23 15:40:30 +08:00
Cytown
36f9d20de1 Merge branch 'main' into version 2026-03-23 15:00:18 +08:00
Kunal Karmakar
40279c8dde
chore(config): move loglevel settings under gateway (#1912)
* Move log level config to gateway property

* Fix unit test

* Fix linting

* Fix linting

* Add comment for log level
2026-03-23 06:14:53 +01:00
Cytown
7bf4831059 Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
yinwm
c48954d32d merge: sync main into refactor/agent 2026-03-22 21:44:17 +08:00
Cytown
284ced1f5c Merge branch 'main' into version 2026-03-22 19:58:33 +08:00
Administrator
f7f27e237a merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
Hua Audio
dd82794255
Feat/weixin openclaw port (#1873)
* init

* fix lint

* fix go test

* update docs

* incorporate pr review

* Update pkg/channels/weixin/weixin.go

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

* Apply suggestions from code review

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

* feat(weixin): add media sync and typing support

* test(weixin): cover media and sync helpers

---------

Co-authored-by: zhangmikoto <i@electromaster.me>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Hoshina <hoshina@evaz.org>
2026-03-22 14:23:39 +08:00
Cytown
7c854fe6d7 Merge branch 'main' into version 2026-03-22 02:53:55 +08:00
Cytown
e455eb5e67 refactor: seperate security.yml for store keys 2026-03-22 01:55:00 +08:00
Kunal Karmakar
92b7687068 Add configurable logger 2026-03-21 06:54:49 +00:00
enoch.z
e4b104c0de
Update helpers.go
correction of the promt for the "picoclaw onboard" command.
2026-03-20 23:15:18 +08:00
liqianjie
0fe058254c
fix: add fallback DNS resolver for Android with multi-DNS support (#1835)
On Android, /etc/resolv.conf does not exist, causing Go's default DNS
resolution to fail. This adds an init() hook that:

1. Detects missing /etc/resolv.conf (Android environment)
2. Configures a custom resolver with PreferGo: true
3. Supports multiple DNS servers via PICOCLAW_DNS_SERVER env var
   - Semicolon-separated: "8.8.8.8:53;1.1.1.1:53"
   - Single server also works: "8.8.8.8"
   - Auto-appends :53 if port omitted
4. Round-robin rotation across configured servers
5. Defaults to Google DNS + Cloudflare DNS

Also patches http.DefaultTransport to use the custom resolver.
2026-03-20 22:32:21 +08:00
taorye
955d6e70f1
refactor: update interface types to use 'any' and improve code formatting 2026-03-20 19:41:59 +08:00
taorye
ed47d5f7c3
feat: add onboarding command execution for non-existent config directory 2026-03-20 19:28:58 +08:00
taorye
8c44597c3d
feat: add chat functionality to home page for interactive AI sessions 2026-03-20 19:28:58 +08:00
taorye
02da117199
feat: add gateway management page to TUI and integrate into home menu 2026-03-20 19:28:57 +08:00
taorye
7b4d5d4513
feat: add channels management page and integrate into home menu 2026-03-20 19:28:57 +08:00
taorye
545b7afe41
feat: add model selection synchronization to main config in TUI 2026-03-20 19:28:57 +08:00
taorye
74a145c291
style: apply cyberpunk theme to TUI components for enhanced visual appeal 2026-03-20 19:28:57 +08:00
taorye
119cc2e8e1
refactor: enhance TUI configuration and user management with improved UI elements and concurrency 2026-03-20 19:28:57 +08:00
taorye
5a199ec993
feat: implement TUI configuration and user management for picoclaw-launcher-tui 2026-03-20 19:28:54 +08:00
taorye
998b456b65
Remove UI components and gateway management for picoclaw-launcher-tui
- Deleted channel management UI from channel.go, including all associated forms and menu items.
- Removed platform-specific gateway process management from gateway_posix.go and gateway_windows.go.
- Eliminated menu structure and item management from menu.go.
- Removed model management and configuration handling from model.go.
- Deleted style definitions and application logic from style.go.
- Cleared main entry point in main.go.
2026-03-20 19:24:10 +08:00
Cytown
cfd3a1b441 Merge branch 'main' into version 2026-03-19 18:04:58 +08:00
dev-miro26
c07f5c948f
refactor: centralize environment variable key constants (#1730)
* refactor: centralize environment variable key constants

* refactor: update environment variable constants and usage in gateway
2026-03-18 18:03:24 +08:00
wenjie
8a44410e37
feat: add web gateway hot reload and polling state sync (#1684)
* feat(gateway): support hot reload and empty startup

- extract gateway runtime into pkg/gateway
- add gateway.hot_reload config with default and example values
- allow starting the gateway without a default model via --allow-empty
- stop treating missing enabled channels as a startup error
- update related tests

* feat: replace gateway SSE updates with polling-based state sync

- remove gateway SSE broadcasting and event endpoint
- add polling-based gateway status refresh with stopping state handling
- detect when gateway restart is required after default model changes
- resolve gateway health and websocket proxy targets from configured host
- update gateway UI labels and add backend/frontend test coverage
2026-03-17 18:46:00 +08:00
Cytown
be4a33cc15
refactor gateway/helpers and add server.pid to health (#1646) 2026-03-17 09:35:52 +08:00
sky5454
2f10b47f59
feat(credential): part1 add AES-GCM encryption, SecureStore, and onboard ke… (#1521)
* feat(credential): add AES-GCM encryption, SecureStore, and onboard keygen

- pkg/credential: new package with AES-256-GCM enc:// credential format,
  HKDF-SHA256 key derivation (passphrase + optional SSH key binding),
  ErrPassphraseRequired / ErrDecryptionFailed sentinel errors,
  and PassphraseProvider hook for runtime passphrase injection

- pkg/credential/store: lock-free SecureStore via atomic.Pointer[string];
  passphrase never written to disk or os.Environ

- pkg/credential/keygen: ed25519 SSH key generation helper used by onboard

- pkg/config: replace os.Getenv(PassphraseEnvVar) with
  credential.PassphraseProvider() at all three call sites so that
  LoadConfig and SaveConfig use whatever passphrase source is active

- cmd/picoclaw/onboard: prompt for passphrase with echo-off, generate
  picoclaw-specific SSH key, re-encrypt existing config on re-onboard

- docs/credential_encryption.md: design doc for the enc:// format

* fix(credential): address Copilot review comments on PR #1521

- credential.go: decouple ErrPassphraseRequired from env var name;
  message is now 'enc:// passphrase required' since PassphraseProvider
  may come from any source, not just os.Environ

- credential.go: Resolver resolves symlinks via EvalSymlinks before the
  isWithinDir containment check, preventing symlink-based path traversal
  for file:// credential references

- store.go: tighten comment to describe only what SecureStore guarantees
  (in-memory only); remove claims about how callers transport the value

- store_test.go: replace the meaningless GetReturnsCopy test (Go strings
  are immutable, equality across two calls proves nothing) with
  TestSecureStore_ConcurrentSetGet that exercises atomic.Pointer under
  10-goroutine concurrent Set/Get load

- config_test.go: update error-message assertion to match new sentinel text

- docs/credential_encryption.md: remove reference to non-existent
  'picoclaw encrypt' subcommand; describe the onboard flow instead

* fix(config): encryptPlaintextAPIKeys: struct-based encryption, fail-fast, remove raw []byte

* fix(credential): require SSH private key for encryption/decryption, remove passphrase-only mode

* lint: fix credential keygen lint, fix test keygen

* onboard: make encryption opt-in via --enc flag

Encryption (passphrase prompt + SSH key generation) is now only
triggered when the user passes --enc to 'picoclaw onboard'.
Without the flag, onboard skips the credential-encryption setup and
writes a plain config + workspace templates directly.

- Add --enc BoolFlag in NewOnboardCommand()
- Pass encrypt bool into onboard()
- Guard passphrase prompt, SSH key generation, and related env-var
  setup behind the encrypt branch
- Adjust 'Next steps' output so the passphrase reminder only appears
  when --enc was used
2026-03-16 14:06:32 +08:00
lxowalle
2f83c185ae
Fix the issue where the cursor moves inaccurately left and right after entering Chinese when running the picoclaw agent. (#1505) 2026-03-13 17:58:34 +08:00
Cytown
9676e51e89
make gateway aware of config.json change (#1187)
* make gateway aware of config.json change

* fix according to code review

* fix lint

* fix review comment

* fix for review

* refactor to fix review

* fix for review

* fix for review
2026-03-13 14:27:46 +08:00
Cytown
dfa36f39cb
add model command to set default model (#1250)
* add model command to set default model

* fix for ci

* fix test for model

* fix active agent not recognized

* implement test for model command

* fix local-model can not set as default issue

* fix review comment

* fix for comment
2026-03-13 14:10:11 +08:00
leamon
0fb92b21b6
enhance skill installer (#1252)
* enhance skill installer

* enhance install skills v2

* go file formate

* fix:use proxy download skills;many chunck download;simple code

* add default config to config.example.json, download skill from github use proxy and token

---------

Co-authored-by: FantasticCode2019 <1443996278@qq.com>
2026-03-13 14:04:02 +08:00
Guoguo
1e024321c0
refactor: update model name and add VolcEngine coding plan (#1412)
* docs: swap header logo to webp, move meme logo to bottom

Replace header logo with assets/logo.webp across all 6 README
language variants and move the original meme logo (logo.jpg)
to the bottom of each file.

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

* docs: update GPT model names to gpt-5.4 and refine provider descriptions

Update all 6 language README variants:
- Correct GPT model references from gpt-5.2/gpt4 to gpt-5.4
- Refine provider descriptions in API Key comparison tables

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

* chore: update default model to gpt-5.4, codex to gpt-5.3-codex

Update OpenAI default model references from gpt-5.2 to gpt-5.4
across source code, config examples, tests, and docs. Set Codex
default model to gpt-5.3-codex.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 16:10:29 +08:00
Cytown
1c123e0162 refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
Mauro
9cd2d21800
Merge pull request #1207 from afjcjsbx/feat/debug-mode-no-truncate
feat: no-truncate param for debug
2026-03-10 17:13:44 +01:00
lxowalle
680e845d61
feat:Modify the location where version is obtained, and insert version information into the context (#1300)
* feat:migrate version info from internal package to pkg/config

* * fix lint issue
2026-03-10 17:42:05 +08:00
is-Xiaoen
26f623ed32
feat(session): integrate JSONL persistence into agent loop (#1170)
* feat(session): add SessionStore interface and JSONL backend adapter

Extract a SessionStore interface from the methods the agent loop uses
(AddMessage, GetHistory, SetSummary, TruncateHistory, Save, etc.).
Both SessionManager and the new JSONLBackend satisfy this interface,
allowing the persistence layer to be swapped transparently.

JSONLBackend wraps memory.Store and maps its error-returning API to
the fire-and-forget contract that the agent loop expects — write
errors are logged, reads return empty defaults on failure. Save()
triggers compaction to reclaim space after logical truncation.

Part of #1169

* test(session): add JSONLBackend integration tests

8 tests covering the full SessionStore contract through the JSONL
backend: message roundtrip, tool calls, summary, truncation with
compaction, history replacement, empty sessions, session isolation,
and the complete summarization flow (SetSummary → TruncateHistory →
Save).

Includes compile-time interface satisfaction checks for both
SessionManager and JSONLBackend.

Part of #1169

* feat(agent): wire JSONL session store into agent loop

Replace the concrete *SessionManager field with the SessionStore
interface and initialize the JSONL backend by default. Legacy .json
session files are auto-migrated on first startup. Falls back to
SessionManager if the JSONL store cannot be initialized.

The agent loop code (loop.go) requires zero changes — all method
calls work identically through the interface.

Closes #1169

* fix(session): propagate compact error from Save

Save() was swallowing the error returned by Compact and always
returning nil. Callers checking Save's return value would never
see a compaction failure. Return the error directly so the agent
loop can log or handle it as needed.

* feat(session): add Close to SessionStore interface

Add Close() error to SessionStore so callers can release resources
through the interface. JSONLBackend already had Close; this adds
a no-op implementation to SessionManager for compatibility.

* fix(session): close session stores on shutdown and harden migration

- Add Close() to AgentInstance, AgentRegistry, and AgentLoop so JSONL
  file handles are released during gateway shutdown and CLI exit.
- Fall back to SessionManager when migration fails, preventing a split
  state where some sessions live in JSONL and others remain in JSON.
- Add defer agentLoop.Close() in the CLI agent command path.
- Document SessionStore interface methods (fire-and-forget contract).
2026-03-10 15:14:09 +08:00
afjcjsbx
86ce76219f no-truncate shorthand flag 2026-03-10 00:15:47 +01:00