Commit Graph

1641 Commits

Author SHA1 Message Date
Mauro 415abc8cd4 Merge pull request #2092 from badgerbees/fix/telegram-edit-timeout
fix(telegram): avoid duplicate messages on streaming edit timeouts
2026-04-01 23:47:08 +02:00
Badgerbees 33ce6ed482 resolve conflicts 2026-04-02 04:33:08 +07:00
Liu Yuan 7eba27c3c4 feat: add ContextManager abstraction for pluggable context management (#2203)
- Define ContextManager interface with Assemble/Compact/Ingest methods
- Implement legacyContextManager wrapping existing summarization logic
- Wire Assemble (before BuildMessages), Compact (post-turn + overflow),
  and Ingest (after message persistence) into agent loop
- Add ContextManager config field and factory registry with config passthrough
- Remove old maybeSummarize/summarizeSession/summarizeBatch/etc from loop.go
- All existing tests pass with default (legacy) config

Co-authored-by: Liu Yuan <namei.unix@gmail.com>
2026-04-02 00:08:15 +08:00
Cytown 2973b30ad7 implement create dmg for macOS 10.11 & above (#2252) 2026-04-01 23:56:46 +08:00
LC bbcfeaa361 feat(provider): add Venice AI support and update related documentation (#2238)
* feat(provider): add Venice AI support and update related documentation

* revert(asr): restore asr files to previous commit

* feat(config): add Venice API base URL and local LM Studio configuration

* fix(config): update Venice API base URL to correct endpoint
2026-04-01 23:50:29 +08:00
Cytown 9ac21c5908 add missing recover panic in subturn.go (#2253) 2026-04-01 23:44:41 +08:00
sky5454 49e61fa07f feat(updater): robust self-update selection & extraction (nightly default) (#2201)
* feat(updater): add web self-update endpoint and updater package

* feat(selfupgrade): when url empty, using GetTestReleaseAPIURL for test .

* feat(selfupgrade):  only GetTestReleaseAPIURL  .

* feat(upgrade): cli  $0 update work well!

* fix(ci): fix ci err

* fix(test): fix ci test

* fix(ci): fix ci  lint fmt err

* test(updater): add test for updater

* fix(ci): fix ci  lint var copy err

* fix(ci): retry ci

* updater: require checksum verification, prefer API digest, verify SHA256, fix zip extraction, update tests

* fix(lint): lint fixed

* fix(lint): lint fixed2

* updater: stream download and verify sha256; add http client timeout and progress

Avoid double-download by streaming asset into temp file while computing SHA256 and verifying against checksum; replace http.Get with shared httpClient (2m timeout) to prevent hangs; add simple stderr progress display; remove unused helpers.
2026-04-01 23:41:32 +08:00
Cytown e2a9bb97c7 unify all panic event to panic log file (#2250) 2026-04-01 23:26:49 +08:00
reusu 31afad6e87 feat: add load_image tool for local file vision (#2116)
* feat: add load_image tool for local file vision

* fix: address load_image PR review feedback

- Exclude load_image from sub-agent tools via Unregister after Clone,
  since RunToolLoop does not call resolveMediaRefs
- Add ToolRegistry.Unregister() method
- Fix scope collision: use channel:chatID instead of filename
- Add channel/chatID context resolution matching send_file pattern
- Add comment explaining iteration > 1 guard on resolveMediaRefs
- Remove emoji from ForUser for consistency with send_file
- Add load_image_test.go

* feat: enable load_image for subagents via MediaResolver in RunToolLoop

Instead of removing load_image from sub-agent tools (28f69e71), inject a
MediaResolver into the legacy RunToolLoop fallback path so media:// refs
are resolved to base64 before each LLM call — matching the main agent
loop behavior.

- Add MediaResolver field to ToolLoopConfig and call it on iteration > 1
- Add SubagentManager.SetMediaResolver() and wire it through runTask
- Remove ToolRegistry.Unregister() (no longer needed)
- Restore load_image in sub-agent tool set (revert Clone+Unregister)
- Add TestSubagentManager_SetMediaResolver_StoresResolver

* refactor(load_image): remove prompt parameter from tool schema

* test(tools): add success-path test for LoadImageTool

Add TestLoadImage_SuccessPath that creates a real PNG file with valid
magic bytes, calls Execute with WithToolContext, and verifies:
- result.IsError == false
- ToolResult.Media contains a media:// ref
- ToolResult.ForLLM contains the [image: marker
- media ref is resolvable in the store

Add explanatory comment in loop.go for why Media and ArtifactTags
coexist on non-ResponseHandled tool results (e.g. load_image).

* fix: preallocate slice in tests and add ResponseHandled guard in toolloop

Fix prealloc linter failure in load_image_test.go.

Prevent double-resolving media by checking ResponseHandled in toolloop.go.

* Register TTS tool if provider is available

---------

Co-authored-by: Reusu <admin@yumao.name>
Co-authored-by: 美電球 <hoshina@evaz.org>
2026-04-01 21:32:10 +08:00
wenjie c0464bdd5d feat(web): add skill marketplace hub and registry install flow (#2246)
- add backend APIs for searching and installing registry skills, including origin metadata and concurrency-safe workspace writes
- introduce /agent/hub as the default agent entry with marketplace search and install UI
- refactor the skills and tools pages with filtering, dialogs, detail views, import validation, and updated i18n
- expand backend tests for search, install, import, rollback, and concurrent requests
2026-04-01 19:25:31 +08:00
Cytown a9c76eca21 bug: fix picoToken is empty when gateway started by launcher (#2241) 2026-04-01 14:59:18 +08:00
LC f327859cce fix(api): enhance model availability probing with backoff and caching mechanisms (#2231)
* fix(api): enhance model availability probing with backoff and caching mechanisms

* fix(lint): resolve gci and predeclared issues in model probe

* fix(api): address copilot review feedback on probe cache key and test stability

* fix(api): reduce probe cache key fragmentation
2026-04-01 14:15:28 +08:00
Hua Audio 0f395ce110 Refactor/asr tts (#1939)
* refactor: update ASR and TTS implementations

* fix lint

* Integrating asr/tts models w/ new security config

* update documents

* add arbitrary whisper transcriptor support

* update documents

* fix lint

* add mimo tts
2026-04-01 12:21:21 +08:00
lxowalle ff90a65814 docs: update support android news (#2228) 2026-04-01 10:50:15 +08:00
Badgerbees b90a6d12ea fix(telegram): refine duplicate-message protection with narrow error classification
Addresses reviewer concerns regarding silent message loss by narrowing the
error swallowing logic in EditMessage:
- Excludes context.DeadlineExceeded and context.Canceled from being swallowed,
  ensuring local timeouts before transmission still trigger a fallback send.
- Adds an explicit check for the 'message is not modified' error to safely
  identify edits that have already landed on Telegram's servers.
- Narrowly targets confirmed post-connect dropouts (e.g., connection reset)
  instead of broad network-ish string matching.
- Fixes the missing isPostConnectError definition and required errors import.
2026-04-01 03:13:34 +07:00
Mauro c7461f9e96 Merge pull request #2221 from Alexandersfg4/doc/option-use-markdown-v2
doc: added documentaion for use_markdown_v2
2026-03-31 20:35:05 +02:00
LC 3b3f95c44c feat(web): refine model availability states and preserve API key preview placeholder (#2226)
* feat(web): clarify model availability and status display

- Rename model availability field from configured to available across backend API and frontend usage

- Keep status as reason classification (configured/unconfigured/unreachable) and show unreachable in UI

- Preserve API key preview even when local service is unreachable

- Update backend tests to assert both availability and status semantics

* fix(web): clarify unreachable model status and wording

- Show unreachable status in model cards instead of API key preview when service is down

- Keep API key placeholder preview in model settings whenever an API key is already saved

- Rename model status wording from configured to available across backend, frontend, and i18n

- Update backend model status tests to match renamed status semantics

* style(web): standardize formatting in handleListModels function

* refactor(web): enforce status field as required to follow backend behavior
2026-03-31 22:52:04 +08:00
wenjie 2bf842e460 feat(web): add service log level controls (#2227)
- centralize gateway log level resolution and normalization
- propagate debug flags to spawned launcher and gateway processes
- add a log level selector to the logs page
- cover the new behavior with backend and config tests
2026-03-31 20:32:42 +08:00
Mauro 848f9dd2e9 Merge pull request #2014 from badgerbees/fix/context-pruning-guards
fix(agent): include SystemParts in token estimation and add reasoning guards
2026-03-31 13:30:00 +02:00
Badgerbees 1a44752dc5 fix(agent): prevent double-counting system message tokens in estimator
Treat SystemParts as an alternative representation of message Content
rather than an additive one. This prevents systematic overestimation
of system message tokens which could trigger premature context
pruning or summarization.
- Picks the maximum of Content vs. SystemParts to stay conservative.
- Adds a per-part overhead (20 chars) to account for JSON metadata.
- Streamlines the ReasoningContent counting logic.
Fixes a deficiency where structured blocks for cache-aware adapters
caused overestimated budgets or hidden overflows.
2026-03-31 17:09:01 +07:00
Badgerbees 93f391a6bf fix(agent): include SystemParts in token estimation and add reasoning guards 2026-03-31 16:33:24 +07:00
wenjie dd54601f2d fix(web): hydrate cached Pico token for websocket proxy (#2222)
Load the Pico token from config before validating websocket proxy requests
when the launcher attaches to an existing gateway and the in-memory cache
is still empty
2026-03-31 17:01:44 +08:00
Meng Zhuo a098dfba84 Merge pull request #1957 from lepotatoguy/web-ui-input-fix
fix: detecting the external port that is being used, returning correct websocket
2026-03-31 16:57:40 +08:00
Aleksandr Bortnikov c783bab2d7 doc: added documentaion for use_markdown_v2 2026-03-31 10:53:24 +03:00
Cytown e4893d27d7 fix test and lint in web (#2219) 2026-03-31 15:50:55 +08:00
LePotatoGuy 61a31df168 use explicit port headers before falling back to wsPort in picoWebUIAddr 2026-03-31 02:11:17 -05:00
Cytown 31fcf55297 fix linter (#2206) 2026-03-31 15:06:47 +08:00
LC ee02e30992 feat(provider): add lmstudio and align local provider default auth/base handling (#2193)
* feat(provider): add lmstudio vendor and local no-key behavior

* refactor(provider): consolidate protocol metadata and local tests

* fix(provider): sync lmstudio probing and model normalization

* test(web): format lmstudio model status cases for golines
2026-03-31 14:48:18 +08:00
BeaconCat d11f1bc064 assets: update WeChat QR code image (#2207)
Co-authored-by: BeaconCat <BeaconCat@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 14:21:42 +08:00
DimonB c36b06a901 Fix Telegram HTML links broken by italic regex matching inside href URLs (#2164)
reItalic (_text_) ran after reLink converted [text](url) to <a href>,
injecting <i> tags into URLs containing underscores (e.g. Google Flights
URL-safe base64 in the tfs param). Telegram silently dropped such malformed
<a> tags, causing only 1 of 3 links to appear in messages.

Fix: extract markdown links into placeholders before any formatting runs,
restore them as <a href> last — same pattern used for code blocks.
2026-03-31 11:46:06 +08:00
DimonB 6c0798ca3f feat(channels): make Channel.Send return delivered message IDs (#2190)
* feat(channels): Channel.Send and MediaSender.SendMedia return delivered message IDs

Change Channel.Send signature from (ctx, msg) error to (ctx, msg) ([]string, error)
and MediaSender.SendMedia similarly, so callers can capture platform message IDs
for threading, reactions, and history annotation.

Adapters that return real IDs: Telegram (per-chunk MessageID), Discord (Message.ID),
Slack Send (ts), QQ (sentMsg.ID), Matrix (EventID). Slack SendMedia returns nil
because UploadFileV2 does not expose the posted message timestamp in its response.
All other adapters return nil IDs.

preSend and sendWithRetry in manager.go updated to propagate ([]string, bool).
README examples updated for both English and Chinese docs.

* style: apply golangci-lint fixes (golines)

* docs: fix Send migration guide — restore old error-only signature in before/after example
2026-03-31 11:07:32 +08:00
Mauro 2d8556205f feat(telegram): include quoted reply context and media in inbound turns (#2200) 2026-03-31 10:46:41 +08:00
daming大铭 073cc3f65e Merge pull request #2196 from SiYue-ZO/feature/tour-guide
feat: add first-time tour guide for new users
2026-03-31 10:28:32 +08:00
Mauro 4d34824737 Merge pull request #2088 from badgerbees/fix/telegram-dm-policy-security
fix(channels): add security audit for open-by-default bots
2026-03-30 23:58:25 +02:00
Mauro a995a94990 Merge pull request #1826 from 3mp3ri0r/fix/container-run-app-stopped-on-sigint-sigterm
fix: container run but app stopped on SIGINT or SIGTERM
2026-03-30 23:47:05 +02:00
Mauro 4125f8ac14 Merge pull request #1849 from gaaralbakuu/main
Fix: Provider github copilot cannot create session
2026-03-30 23:37:26 +02:00
SiYue-ZO b8327462f9 feat: add first-time tour guide for new users
- Add tour guide component with floating bubbles
- Guide users through: Welcome -> Configure Models -> Start Gateway -> View Docs
- Use localStorage to persist tour state
- Support i18n (Chinese and English)
- Highlight target elements with spotlight mask
- Allow skipping tour at any time
2026-03-31 00:43:35 +08:00
Mauro 7b3f47128f Merge pull request #2176 from Alix-007/fix/issue-2135-retry-after
fix(utils): honor Retry-After for 429 retries
2026-03-30 16:27:46 +02:00
Alix-007 711685192c utils: gofumpt http retry formatting 2026-03-30 22:08:21 +08:00
Alix-007 345d4fddc9 utils: make retry-after numeric clamp overflow-safe 2026-03-30 22:02:16 +08:00
Alix-007 9440bebca6 utils: anchor date retry-after to response date and cap delay 2026-03-30 21:58:12 +08:00
Mauro 187b2c2185 Merge pull request #2004 from Huangting-xy/docs-add-security-config-ref
docs(configuration): add security config reference at document start
2026-03-30 14:24:34 +02:00
Mauro ffa65b53ed Merge pull request #1982 from Kathent/fix-deny-pattern
fix: more accurate deny pattern for disk wiping
2026-03-30 14:24:17 +02:00
Mauro 34b4848214 Merge pull request #1838 from jonahzheng/patch-1
Update helpers.go
2026-03-30 14:23:38 +02:00
Mauro 174c4e5d3b Merge pull request #2000 from Alix-007/docs/issue-1868-cron-docs
docs: add cron job behavior guide
2026-03-30 14:18:43 +02:00
Mauro 0fb45505bf Merge pull request #1988 from loafoe/main
feat(bedrock): detect SSO token expiration and provide actionable error
2026-03-30 14:17:19 +02:00
Mauro 45582b0b52 Merge pull request #1510 from dim/matrix/improved-formatting
Improve white-space and general rendering of CommonMark in Matrix
2026-03-30 14:02:19 +02:00
daming大铭 a5f8b0f98d Merge pull request #2134 from cytown/t3
add pid file for gateway running and auth token for /reload and pico channel
2026-03-30 18:55:01 +08:00
Mauro 1154017563 Merge pull request #2129 from kunalk16/chore-azure-openai-responses-tests
chore(tests): update tests and error cases handling for azure openai provider
2026-03-30 12:29:41 +02:00
Cytown f9bfa6b9a8 Merge branch 'main' into t3 2026-03-30 18:07:20 +08:00