2226 Commits

Author SHA1 Message Date
Mauro ba4abff4a4 Merge pull request #2670 from david1gp/fix/tool-feedback-pretty-print
feat(agent): add pretty_print and disable_escape_html options for tool feedback
2026-05-04 21:47:32 +02:00
afjcjsbx a1b55fd4f9 fix(seahorse): enforce target token thresholds for leaf summaries 2026-05-04 14:10:42 +02:00
afjcjsbx d63430ab33 fix(agent): don't arm pending stop when /stop targets idle session 2026-05-04 13:10:02 +02:00
美電球 71c49812ae Merge pull request #2764 from alexhoshina/main
fix(agent): use runtime event kind for LLM retry
2026-05-04 15:48:11 +08:00
afjcjsbx 7a1f5fe8b9 fix test 2026-05-04 09:06:39 +02:00
Hoshina 057683d94c fix(agent): use runtime event kind for LLM retry 2026-05-04 15:06:34 +08:00
afjcjsbx a0245c7b02 feat(agent): stop command 2026-05-04 08:41:29 +02:00
afjcjsbx f3ef7090c5 feat(agent): stop command 2026-05-04 08:41:17 +02:00
Mauro be67aed4dc Merge pull request #2677 from alexhoshina/feat/runtime-events-plan
Feat/runtime events
2026-05-03 23:15:25 +02:00
Mauro f4a5d6e808 Merge pull request #2682 from dtapps/fix/docs-agent-defaults-model-format
docs: fix agents.defaults model configuration format
2026-05-03 23:14:26 +02:00
dependabot[bot] 330aa297e2 build(deps): bump github.com/aws/aws-sdk-go-v2/service/bedrockruntime
Bumps [github.com/aws/aws-sdk-go-v2/service/bedrockruntime](https://github.com/aws/aws-sdk-go-v2) from 1.50.5 to 1.50.6.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.50.5...service/ecr/v1.50.6)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/bedrockruntime
  dependency-version: 1.50.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-03 18:30:21 +00:00
Mauro 4e8bd73a58 Merge pull request #2735 from sipeed/dependabot/go_modules/github.com/aws/aws-sdk-go-v2/config-1.32.17
build(deps): bump github.com/aws/aws-sdk-go-v2/config from 1.32.16 to 1.32.17
2026-05-03 20:27:49 +02:00
Mauro 828a7cba70 Merge pull request #2681 from afjcjsbx/fix/gemini-mcp-schema-sanitization
fix(mcp): sanitize MCP tool schemas for Gemini function calling
2026-05-03 20:25:35 +02:00
Mauro 490d90749c Merge pull request #2717 from LiusCraft/feat/deepseek-vision-unsupported-error
feat: add DeepSeek vision unsupported error detection
2026-05-03 20:24:56 +02:00
Mauro 272dee3fca Merge pull request #2669 from david1gp/fix/network-error-retry
feat(agent): add network error retry with configurable max retries and backoff
2026-05-03 20:18:18 +02:00
BeaconCat a94ba82181 chore: update WeChat group QR code (#2747)
Co-authored-by: BeaconCat <BeaconCat@users.noreply.github.com>
2026-05-02 16:55:53 +08:00
lc6464 b00ff5bc5d fix(openai_compat): parse reasoning_content in streaming responses 2026-05-01 15:20:35 +08:00
dependabot[bot] b792d8b77b build(deps): bump github.com/aws/aws-sdk-go-v2/config
Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.32.16 to 1.32.17.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.32.16...config/v1.32.17)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 17:19:52 +00:00
lxowalle 6e1fab80e2 Fix/build macos launcher failed (#2724)
* fix(release): drop stale launcher tui goreleaser target

* * delete unused file
v0.2.8
2026-04-30 22:48:32 +08:00
lxowalle a7414608ed * fix build failed (#2723) 2026-04-30 18:04:48 +08:00
LC dbf5d9ce1f fix(seahorse): persist reasoning_content in sqlite history (#2707)
* fix(seahorse): persist reasoning_content in sqlite history

* fix(openai_compat): clarify DeepSeek reasoning replay rules

* style(seahorse): format files of seahorse

* fix(openai_compat): cover DeepSeek replay requirements

* fix(seahorse): repair missing reasoning_content during bootstrap

* fix(seahorse): repair reasoning_content on bootstrap prefix
2026-04-30 16:07:38 +08:00
Guoguo 5db008f384 fix(channels): dismiss tool feedback animation when turn ends via ResponseHandled (#2713)
* fix(channels): dismiss tool feedback animation when turn ends via ResponseHandled

When a tool sets ResponseHandled=true (e.g., send_file), the turn ends
without producing a final assistant response. This meant no outbound
message triggered FinalizeToolFeedbackMessage, leaving the animation
goroutine running indefinitely — editing the Feishu card every 3 seconds
with "." / ".." suffixes long after the tool had finished.

Fix: call DismissToolFeedback at "Tool output satisfied delivery" so the
tracker is cleared and the animation goroutine is stopped immediately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(adapters): add DismissToolFeedback to channelManagerAdapter

The adapter must implement the new interface method added in the
previous commit, otherwise the package fails to compile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(channels): pass InboundContext to DismissToolFeedback for topic-aware keys

Telegram forum topics use scoped tracker keys like "chatID/topicID",
resolved via ToolFeedbackMessageChatID with the InboundContext. The
previous nil context caused the lookup to fall back to the raw chatID,
missing the topic-scoped entry and leaving the animation goroutine
orphaned in forum-topic conversations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* style: wrap long function signatures for golines

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 11:17:55 +08:00
Guoguo cb1e1a3595 fix(feishu): fix image download with API fallback and post image support (#2708)
* fix(feishu): fix image download with API fallback and post image support

- Add Image.Get API fallback when MessageResource.Get fails (different
  permission scope: im:resource vs im:message:readonly)
- Extract and download images from post (rich text) messages
- Extract images from interactive card messages
- Deduplicate post image keys across locales
- Add comprehensive tests for new helpers

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

* feat(media): add image path tags alongside base64 for LLM file access

Images are still base64-encoded into msg.Media for multimodal LLMs,
but now also get [image:path] tags injected into message content so
the LLM knows the local file path for save/forward operations.

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

* refactor(media): only auto-inject images for tool results, not user messages

Channel-received images (role=user) now get path tags only, letting
the LLM decide whether to view via load_image or just operate on
the file. Tool result images (role=tool, e.g. load_image) are
base64-encoded into a synthetic user message appended after the tool
message, since many LLM APIs don't support image_url in tool messages.

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

* fix(media): preserve tool-message ordering for multi-tool-call scenarios

Move synthetic user message (carrying base64 tool images) to after the
entire contiguous tool-message block instead of immediately after each
tool message. This preserves the assistant→tool→tool ordering required
by OpenAI-compatible APIs.

Also fix load_image to use generic [image: photo] placeholder so
injectPathTags can properly replace it with the actual path.

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

* fix(test): update load_image test for [image: photo] placeholder

The test was checking ForLLM for the media:// ref, but load_image now
emits the generic [image: photo] placeholder instead.

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

* fix(media): match all channel image placeholders in injectPathTags

Different channels emit different placeholder formats — Telegram/Feishu
use [image: photo], WeCom/WeChat/Line use bare [image], QQ/Discord use
[image: <filename>]. The previous string-match code only handled
[image: photo], so for the other channels the path tag was appended as
a duplicate, producing content like "[image] [image:/path]".

Switch to per-type regex that matches all generic placeholder shapes
while leaving path tags ([image:/path]) untouched. Also fixes the same
issue for [audio], [video], [file] tags. Added test coverage for the
various placeholder shapes.

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

* fix(media): skip path tag append for JSON content (Feishu cards/posts)

When content is structured JSON (interactive cards, post messages),
injectPathTags now skips the fallback append — only placeholder
replacement is attempted. This prevents corrupting JSON payloads
like {"schema":"2.0",...} with appended [image:/path] tags.

Adds looksLikeJSON() helper and three test cases covering JSON
objects, arrays, and an end-to-end resolveMediaRefs scenario with
Feishu card content.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(media): prepend path tags for JSON content, narrow looksLikeJSON

Two fixes from code review:

1. looksLikeJSON now only checks for '{' prefix (not '['), avoiding
   false positives on regular text like "[update] see attached".

2. For JSON content (Feishu cards/posts), path tags are prepended
   before the JSON instead of being silently dropped. This ensures
   the LLM can discover attached images via the path tag while the
   JSON payload stays valid for downstream parsing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 11:08:00 +08:00
Andy Lo-A-Foe b03fa61764 test(bedrock): add unit tests for ChatStream/parseStreamResponse
Tests cover: text-only streaming with chunk accumulation, tool call
parsing with fragmented JSON, mixed text+tool responses, context
cancellation, invalid JSON fallback to raw payload, nil stream guard,
default finish reason, and all stop reason mappings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 21:17:16 +02:00
Andy Lo-A-Foe ad5232ade8 feat(bedrock): implement StreamingProvider for real-time token streaming
Adds ConverseStream API support to the Bedrock provider, implementing
the StreamingProvider interface. Tokens flow via onChunk callback for
real-time delivery to streaming-capable channels.

- Extract buildConverseParams to share request logic between Chat and ChatStream
- Add converseStreamReader interface for testability
- Preserve raw payload in Arguments on JSON parse failure
- Ensure Function.Arguments is always valid JSON
- Streaming timeout only applied when explicitly configured
- Capture stream Close() errors for diagnostics
- Consistent "bedrock conversestream" / "bedrock:" log prefixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 21:17:16 +02:00
LiusCraft 1722cfc282 feat: add DeepSeek vision unsupported error detection
Add detection for 'unknown variant' + 'image_url' error pattern used by
DeepSeek and other strict providers when vision is not supported.
These providers reject the image_url field at the JSON schema level
rather than returning a semantic 'not supported' message.
2026-04-30 02:24:29 +08:00
hehaijunandhenry 5c0492900e add MQTT channel support 2026-04-29 18:27:33 +08:00
taonyx a36472b55f Add CLI support for custom OpenAI-compatible endpoints and remove TUI (#2710)
* feat(model): add `picoclaw model add` for custom OpenAI-compatible endpoints

Onboards a model from a user-supplied API base + key by hitting
GET <base>/models, prompting the user to pick one, and writing the entry
into model_list[] (with api_keys) plus setting it as the default model.
This was previously only available in the TUI launcher (issue #2208) and
is now accessible from the CLI:

    picoclaw model add -b URL -k KEY [-m MODEL] [-n ALIAS]

* chore: remove deprecated picoclaw-launcher-tui

Per RFC #2208, the TUI launcher is deprecated in favor of the CLI; its
"online model picker" feature has been ported to `picoclaw model add` in
the previous commit. This drops the binary and all build/release/docs
references:

- delete cmd/picoclaw-launcher-tui/ and assets/launcher-tui.jpg
- Makefile: remove the `build-launcher-tui` target
- .goreleaser.yaml: drop the build entry plus the `picoclaw-launcher-tui`
  ids from the launcher docker image, macOS notarize list, and nfpms
  contents
- docker/Dockerfile.goreleaser.launcher: drop the COPY for the TUI binary
- READMEs (root + 8 locales): remove the "TUI Launcher" section and
  screenshot link
- docs/guides/docker.*: update the "launcher image includes …" sentence
  to reflect the two remaining binaries

`make build` still succeeds; `go build ./web/backend` (the launcher
target) still succeeds. `picoclaw-launcher` (web console) is unaffected.
2026-04-29 17:52:47 +08:00
Guoguo 62d0e34ec9 fix(docker): restore make docker-build by adding build directives and fixing Go version (#2700)
* fix(docker): restore `make docker-build` by adding build directives and fixing Go version

docker-compose.yml only had `image:` references with no `build:` sections,
so `docker compose build` had nothing to build. Also fixed golang:1.26.0-alpine
(nonexistent) to golang:1.25-alpine in Dockerfile.full/heavy, and removed
LICENSE from .dockerignore since scripts/copydir.go needs it as a repo-root anchor
during `go generate`.

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

* fix(docker): inject version metadata ldflags in Dockerfile.launcher

Mirror the ldflags from web/Makefile (Version, GitCommit, BuildTime,
GoVersion) into the picoclaw-launcher go build command so Docker-built
launcher images include proper version/build metadata.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 16:19:15 +08:00
美電球 db1bc6a1f8 Merge pull request #2689 from afjcjsbx/fix/cron-session-key-propagation
fix(cron): propagate sessionKey to prevent duplicate tool responses
2026-04-28 23:03:09 +08:00
LC 9b109dc7a8 fix(serial_windows): remove unused import (#2697) 2026-04-28 16:19:59 +08:00
Guoguo fc24676924 Add cross-platform serial tool support (#2673)
* feat(tools): add cross-platform serial hardware tool

* feat(config): wire serial tool into runtime and dashboard

* hardware/serial: tighten validation and error handling

* hardware/serial: improve unix cancellation and timeout polling

* hardware/serial: improve windows I/O handling

* hardware/serial: fix darwin cross-compilation build

* docs(design): summarize hardware support and serial limits

* build: keep go generate on host during cross builds

* onboard: drop unrelated go generate change from serial work

* style(tools): wrap serial lines for golines
2026-04-28 13:10:32 +08:00
SiYue-ZO bd867a16cd style(tools): wrap serial lines for golines 2026-04-28 12:58:26 +08:00
SiYue-ZO 29e7461837 onboard: drop unrelated go generate change from serial work 2026-04-28 12:58:26 +08:00
SiYue-ZO 688d47d236 build: keep go generate on host during cross builds 2026-04-28 12:57:44 +08:00
SiYue-ZO 2baeee2834 docs(design): summarize hardware support and serial limits 2026-04-28 12:57:44 +08:00
SiYue-ZO 893e61dc51 hardware/serial: fix darwin cross-compilation build 2026-04-28 12:57:44 +08:00
SiYue-ZO 64e48163d0 hardware/serial: improve windows I/O handling 2026-04-28 12:57:25 +08:00
SiYue-ZO 1f0a5f4eda hardware/serial: improve unix cancellation and timeout polling 2026-04-28 12:57:09 +08:00
SiYue-ZO 338fa258b3 hardware/serial: tighten validation and error handling 2026-04-28 12:56:47 +08:00
SiYue-ZO 2114e1a53f feat(config): wire serial tool into runtime and dashboard 2026-04-28 12:56:27 +08:00
SiYue-ZO 0f52076762 feat(tools): add cross-platform serial hardware tool 2026-04-28 12:54:28 +08:00
LC c44bd6138c refactor(pico): unify message kind handling of tool_calls and thought (#2680)
* refactor(pico): unify message kind handling of tool_calls and thought

* fix(pico): add legacy compatibility for thought payload in Send method

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-28 10:17:12 +08:00
afjcjsbx 23df824c77 fix test 2026-04-27 21:27:02 +02:00
afjcjsbx 87ee76b117 Merge remote-tracking branch 'origin/fix/gemini-mcp-schema-sanitization' into fix/gemini-mcp-schema-sanitization 2026-04-27 21:18:29 +02:00
afjcjsbx 7b3e800407 fix test 2026-04-27 21:18:19 +02:00
Mauro c731ecdc74 Merge branch 'main' into fix/gemini-mcp-schema-sanitization 2026-04-27 21:14:25 +02:00
afjcjsbx cd7717bc15 feat(tool): tool schema semplification 2026-04-27 21:10:30 +02:00
afjcjsbx 0bb0fc429a fix(cron): propagate sessionKey to prevent duplicate tool responses 2026-04-27 13:17:25 +02:00
David Siewert e656ddf5bb fix: align struct tag spacing in AgentDefaults config 2026-04-27 16:47:28 +06:00