Commit Graph
6260 Commits
Author SHA1 Message Date
CaIon dc4732cfed feat(web): factory task plugins update only with the system
Marketplace install/upgrade on a factory-served plugin actually created
a permanent override shadowing every future built-in release. The card
now shows an informational "Updates with the system" badge instead of
the action, while keeping the built-in vs marketplace version line and
the upgradable state badge visible. Deliberate overrides are untouched:
upload and marketplace actions on overridden or third-party plugins
behave as before, and the plugins table now hints when an override
lags behind the shipped built-in version so operators know deleting it
restores the newer factory plugin.
2026-08-30 20:37:06 +08:00
PuppetKL 0bee5d4410 fix(ali): honor image response format (#5513) (#7048) 2026-08-30 20:33:15 +08:00
CaIon 66031a09d9 fix(model): disable PostgreSQL prepared statements for pooler compatibility
GORM v1.25.2 closes cached prepared statements asynchronously on any SQL
error and immediately re-Parses the same deterministic name (pgx's
stmt_<sha256>) on the same client connection. Transaction-pooling proxies
(PgBouncer >=1.21 with max_prepared_statements, Neon, Supabase) respond
with FATAL "prepared statement name is already in use" (SQLSTATE 08P01)
and drop the connection. PreferSimpleProtocol only disables pgx's
implicit prepare and never covered GORM's explicit PrepareStmt cache.

- PostgreSQL now runs with PrepareStmt disabled entirely; named prepared
  statements are fundamentally session state and cannot be made safe
  under transaction pooling. Parse/plan cost is noise for this workload.
- Upgrade gorm to v1.25.12 so MySQL/SQLite statement caches (still
  enabled) no longer churn close/re-prepare on ordinary SQL errors;
  v1.25.9+ restricts eviction to driver.ErrBadConn. Deliberately not
  v1.26+, whose LRU eviction has an open use-after-close race (#7831).
- sanitizeDBError now attaches a remediation hint on 08P01/42P05 so
  affected deployments can self-diagnose from the log line.
2026-08-30 20:06:32 +08:00
CaIon 6c22550ea3 feat(task): resolve channel-mapped aliases and case variants for plugin models
Channel model_mapping keys exposed in a channel's model list now act as
first-class aliases for task-plugin models across the whole line:

- Derived alias view (model/task_model_alias.go): built from enabled
  channels' model_mapping, chain-following with cycle detection, declared
  names always win, cross-plugin conflicts dropped. Rebuilt on channel
  cache refresh, registry generation change, and a 60s TTL.
- Request path: PinTaskPluginEndpoint resolves declared-name case folds
  and mapping aliases before endpoint lookup (never rewriting the body
  until the endpoint is claimed), pins with MappedModel, and the decode
  contract accepts alias echoes without loosening model ownership for
  normal pins. Legacy /v1/tasks submit folds case variants the same way.
  Fixes aliases on POST /v1/responses silently falling through to the
  main relay against task channels.
- Mapping order: ModelMappedHelper now runs before the plugin submit
  hook builds and caches the upstream body, so channel model_mapping
  actually reaches the upstream request. Plugins receive the mapped
  name as ctx.upstreamModel in both decode and submit contexts.
- Billing: identity stays the origin name; when the alias has no tiered
  expression, the selected channel's mapping tail expression applies.
  Pricing page and billing-expr smoke tests resolve aliases to the
  owning plugin's usage schema.
- Case folding: ASCII-only fold with exact-match priority; same-plugin
  and cross-plugin fold collisions rejected at registration.
- Plugins: model-keyed rate tables, req_key derivation, and combo
  validation in doubao/kling/jimeng/hailuo/vidu/sunoapi now key on
  ctx.upstreamModel || ctx.model; render/echo paths keep ctx.model.
2026-08-30 19:13:51 +08:00
CaIon 918427d8ab feat(auth): make password encryption opt-in #6743 2026-08-29 20:54:07 +08:00
憧憬Licoy 8454082f93 feat(chat): add AQBot preset (#7079) 2026-08-29 20:34:56 +08:00
CaIon b80d633cf5 feat(auth): encrypt password login transport
Closes #6743
2026-08-29 20:11:36 +08:00
Seefs 98d50d5383 fix(web): recheck setup status after page reload (#6968) 2026-08-29 19:24:14 +08:00
Alex Xiang 0f2a2075ab fix(relay): 请求参数校验错误返回 HTTP 400 (#6774)
* fix(relay): return 400 for invalid request parameters
2026-08-29 19:21:09 +08:00
Calcium-Ion eb48396d5f feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076) v1.0.0-rc.27 2026-08-29 18:51:57 +08:00
Uladzislau 7037ac15bd fix(docker): add relaykit go.mod to dev build context (#7072) 2026-08-29 18:40:21 +08:00
zcxads666andseefs001 ac381acf4b fix(billing): 修复时间规则恒真表达式导致倍率全天生效 (#6934)
Co-authored-by: seefs001 <i@seefs.me>
2026-08-29 13:42:33 +08:00
zcxads666 692e8d6ee6 fix(web): restore admin unbinding for built-in providers (#6987)
* fix(web): align admin binding types

Refs #6985

* test(web): restore animation mock
2026-08-29 13:34:22 +08:00
Seefs e468b73915 docs: update PR template and remove PR Check workflow (#7053)
* docs: update PR template and remove PR Check workflow

* docs: add hidden agent issue and PR templates
2026-08-27 22:36:44 +08:00
Seefs ba2e9287bb feat(ollama): passthrough Claude Messages and OpenAI Responses (#7051) 2026-08-27 21:51:07 +08:00
Seefs cae3676ec6 feat: glm chanel /v1/responses (#7050) 2026-08-27 21:25:35 +08:00
Seefs 8f6961c675 feat: vllm thinking_token_budget (#7027) v1.0.0-rc.26 2026-08-26 21:06:22 +08:00
CaIon 8c25eee71b chore(build): upgrade Bun to 1.4.0 2026-08-26 21:04:54 +08:00
Seefs a073f74b38 refactor: deprecate int32 (#7025)
* refactor: deprecate int32

* fix(db): reject legacy user quota schemas at startup

* fix(quota): enforce wallet bounds and saturating billing conversions

* fix(rate-limit): keep count*duration from wrapping int64

* fix: error message
2026-08-26 20:57:54 +08:00
Seefs 2d8e50bf36 refactor(web): prevent credential autofill in usage log filters (#6966) 2026-08-21 23:47:48 +08:00
Qi f116414284 fix: settle Responses cached token usage (#6892) v1.0.0-rc.25 2026-08-18 18:24:43 +08:00
RedwindA 137d1171f2 feat(web): fade in streamed response words and harden playground editor (#6895)
* feat(web): fade in newly streamed response words

Animate only new word-level deltas while markdown is still streaming, and
cache markdown-it instances per parser id so concurrent Response trees do
not rebuild or reparse on every render.

* fix(web): keep CodeMirror editor alive across keystroke re-renders

Deliver onKeyDown through a ref instead of the extensions memo so a new
handler identity no longer tears down the EditorView, which reset the
cursor to the document start and made typing appear right-to-left.

* feat(web): add unsaved changes confirmation dialog in PlaygroundMessageEditor

Implement a confirmation dialog to warn users about unsaved changes when attempting to leave the editor. This includes handling the beforeunload event to prevent accidental navigation away from the editor. Additionally, add tests to verify the dialog's behavior under various scenarios.

* test(web): cover beforeunload guard and fade hydration suppression

Address review feedback: add regression tests for the unsaved-changes
beforeunload guard and the first-render fade suppression of hydrated
content, and annotate getCachedMarkdown's return type.
2026-08-18 18:20:53 +08:00
Seefs 4add708ebe feat: channel test (#6917)
* feat: channel test

* fix: code smell
2026-08-18 18:03:59 +08:00
Seefs 2b0efd8484 refactor: advanced custom channel route editor (#6865)
* refactor: advanced custom channel route editor

* fix(channels): show raw balance response from balance cell
2026-08-18 17:31:21 +08:00
Seefs 3dda1d50c6 fix(relaykit): preserve parameterless tools in Claude conversion (#6862) 2026-08-18 17:30:59 +08:00
QuentinHsu e2c7aa7b10 test(web): standardize frontend tests on Vitest (#6569)
* test(web): standardize frontend tests on Vitest

- configure Vitest, jsdom, and React Testing Library with shared test scripts.
- migrate existing node:test suites to the Vitest runner.
- rewrite JsonCodeEditor component tests with RTL and remove the direct happy-dom dependency.

* fix(ci): run frontend tests with Vitest

- invoke the configured Vitest script so browser test setup loads in CI.
- migrate remaining node:test suites to Vitest lifecycle APIs.

* test(web): use shared jsdom environment for component tests

- migrate usage cost and tool price tests to React Testing Library.
- remove duplicate happy-dom globals and rely on the configured Vitest setup.

* test(web): verify behavior with shared vitest setup

- replace Node test assertions with Vitest expect across frontend suites.
- migrate Keys component tests to React Testing Library interactions.
- centralize jsdom browser mocks for consistent component execution.

* fix(web): unblock frozen installs and Vitest CI

- sync dompurify 3.4.13 metadata into the Bun lockfile.
- replace the bun:test and happy-dom redemption harness with Vitest and RTL.
- preserve quota conversion, error feedback, and stale-response coverage in jsdom.
2026-08-15 14:18:10 +08:00
Seefs 116255f076 fix(oauth): align custom binding response fields in frontend (#6818)
* fix(oauth): align custom binding response fields in frontend

* fix(oauth): restore custom access policy guidance
2026-08-15 13:56:06 +08:00
zcxads666 4442bb3028 fix(relay): stop injecting empty tools into Claude requests 2026-08-15 13:55:18 +08:00
Seefs e90a7c48e5 feat: add field passthrough controls for gateway channels (#6847) 2026-08-15 13:54:25 +08:00
Seefs 7d09c6954e fix: prompt_cache_key openai chat -> openai responses (#6861) 2026-08-15 13:09:50 +08:00
CaIon 47ba9d2c63 fix(topup): guard wallet quota during recharge 2026-08-14 17:34:57 +08:00
dependabot[bot] bbf67df049 chore(deps-dev): bump electron from 39.8.5 to 39.8.10 in /electron (#6705)
Bumps [electron](https://github.com/electron/electron) from 39.8.5 to 39.8.10.
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](https://github.com/electron/electron/compare/v39.8.5...v39.8.10)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 39.8.10
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 17:02:31 +08:00
dependabot[bot] cf38105a99 chore(deps-dev): bump js-yaml from 4.3.0 to 4.3.1 in /electron (#6704)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.0 to 4.3.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.3.0...4.3.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 17:01:35 +08:00
Shawn Wang 2a0ce3475c fix(topup): reject uncreditable orders before payment (#6845)
* fix(topup): reject uncreditable orders before payment

* fix(topup): align zero-ratio Stripe validation

* fix(topup): mirror settlement conversions in validation
2026-08-14 17:01:32 +08:00
dependabot[bot] e5efc73cdb chore(deps-dev): bump tar from 7.5.16 to 7.5.22 in /electron (#6468)
Bumps [tar](https://github.com/isaacs/node-tar) from 7.5.16 to 7.5.22.
- [Release notes](https://github.com/isaacs/node-tar/releases)
- [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-tar/compare/v7.5.16...v7.5.22)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 7.5.22
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 17:01:15 +08:00
dependabot[bot] 53a8739eed chore(deps-dev): bump fast-uri from 3.1.4 to 3.1.5 in /electron (#6846)
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](https://github.com/fastify/fast-uri/compare/v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 16:59:05 +08:00
dependabot[bot] f250f3b589 chore(deps): bump dompurify from 3.4.11 to 3.4.13 in /web (#6735)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.11 to 3.4.13.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.11...3.4.13)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-version: 3.4.13
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 16:58:37 +08:00
dependabot[bot] 6260580755 chore(deps): bump builder-util-runtime and electron-builder in /electron (#6467)
Bumps [builder-util-runtime](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/builder-util-runtime) to 9.7.0 and updates ancestor dependency [electron-builder](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-builder). These dependencies need to be updated together.


Updates `builder-util-runtime` from 9.5.1 to 9.7.0
- [Release notes](https://github.com/electron-userland/electron-builder/releases)
- [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/builder-util-runtime/CHANGELOG.md)
- [Commits](https://github.com/electron-userland/electron-builder/commits/HEAD/packages/builder-util-runtime)

Updates `electron-builder` from 26.7.0 to 26.15.3
- [Release notes](https://github.com/electron-userland/electron-builder/releases)
- [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder/CHANGELOG.md)
- [Commits](https://github.com/electron-userland/electron-builder/commits/electron-builder@26.15.3/packages/electron-builder)

---
updated-dependencies:
- dependency-name: builder-util-runtime
  dependency-version: 9.7.0
  dependency-type: indirect
- dependency-name: electron-builder
  dependency-version: 26.15.3
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-14 16:56:51 +08:00
Scott 93d2df85f8 fix(ali): 修复阿里图片模型映射后仍使用原始模型名判断协议的问题 (#6772)
* feat(ali): support Qwen Image 3 requests

* refactor(ali): narrow Qwen Image 3 support

* fix(ali): focus image model mapping fix
2026-08-14 16:43:39 +08:00
Shawn Wang 15cfdeddef fix(web): keep fetched model selection in sync with form (#6841)
* fix(web): keep fetched model selection in sync with form

* refactor(web): reuse parsed channel models
2026-08-14 16:40:34 +08:00
wans10andCaIon 58d4e9bd3b fix(billing): 异步任务退款时同步减少 used_quota (#6795)
* fix(billing): 异步任务退款时同步减少 used_quota
退款时仅恢复了 quota(剩余额度),但未同步减少 used_quota(已用额度),
导致"总额度"(quota + used_quota)随退款次数持续虚增,超出用户实际充值金额。

修复三处退款路径:
- RefundTaskQuota:任务失败完整退款
- RecalculateTaskQuota:差额结算退款分支
- controller/midjourney.go:Midjourney 任务失败退款

新增 model.UpdateUserUsedQuota 公开函数,仅调整 used_quota 不影响 request_count。

* fix(billing): 任务退款时同步扣减渠道 used_quota

* fix(billing): complete async task refund accounting

* style(model): group internal Midjourney fields

---------

Co-authored-by: CaIon <i@caion.me>
2026-08-13 22:06:40 +08:00
CaIon ccd535ef8e fix: harden concurrent quota and status updates 2026-08-11 22:03:47 +08:00
CaIon 50e5377ea5 fix(topup): settle recharge orders atomically 2026-08-11 22:03:47 +08:00
CaIon d7992672a6 fix(oauth): avoid overwriting user state when binding 2026-08-11 22:03:45 +08:00
zhibisora 3d5dc36f1d fix: 修复 Gemini 风格 /v1/models 列表请求 (#6199)
* fix: support Gemini model listing on v1 route

* test: cover Gemini query key model listing
2026-08-11 14:49:20 +08:00
Wodandmultica-agent ffeb1b24ef fix(web): refresh Turnstile token after login attempt (#6764)
Co-authored-by: multica-agent <github@multica.ai>
2026-08-11 13:55:01 +08:00
Seefs 4eaeefbdf5 fix: mobile sidebar (#6760)
* fix: mobile sidebar

* fix(web): prevent iOS sidebar taps from being swallowed
2026-08-11 13:50:39 +08:00
Seefs bb234ff418 refactor(responses): remove compact model suffix handling (#6770) 2026-08-11 13:42:32 +08:00
Uzuki Shion 253a74dd1b fix(relay): preserve presence/frequency penalty in Responses conversion (#6654) 2026-08-11 13:40:13 +08:00
Seefs 9c97e78ace fix(web): require confirmation before rotating access token (#6749) 2026-08-10 13:12:59 +08:00