Commit Graph
6456 Commits
Author SHA1 Message Date
CaIon f5e54ccdb2 fix(web): revalidate marketplace fetches so stale caches do not fail integrity checks
Marketplace hosts serve versioned plugin sources as immutable. When a file
is republished in place, a browser that cached the earlier bytes keeps
reading them, while the index is fetched fresh and declares the new hash,
so the install dialog reports a sha256 mismatch for a correct source.

Fetch the plugin source, the sidecar icon and the index with
cache: 'no-cache' so each request revalidates with the host (a 304 when
unchanged).
2026-09-30 17:24:18 +08:00
Seefs 789c970199 fix(claude): preserve auto mode safeguards in native requests (#7598) 2026-09-28 20:48:08 +08:00
Zane-0x5a c2b7a9a9e0 fix(claude): preserve per-message output_config in Claude messages (#7561) 2026-09-25 12:43:11 +08:00
zenor0 d04c118c88 fix(channel): preserve Responses WebSocket setting on save (#7468) 2026-09-23 21:00:00 +08:00
指短琴长 c76452d224 fix(playground): add break-all to playground input (#6600) 2026-09-23 17:06:35 +08:00
feitianbubu 6c14c0762d feat: highlight differing values in source price expressions (#7543) 2026-09-23 13:47:12 +08:00
feitianbubu a46f045d6d fix: match current price column width to source columns so expressions wrap alike (#7542) 2026-09-23 12:53:14 +08:00
musenlinc 5401874c63 fix(ci): align ldflags -X package path with module path so release binaries embed the real version (#7536)
The -X flag in release.yml and electron-build.yml used 'new-api/common.Version',
but the module path is github.com/QuantumNous/new-api, so the linker silently
dropped the injection and every bare-binary release asset reports v0.0.0
(GET /api/status, startup log). The Dockerfile already uses the correct
github.com/QuantumNous/new-api/common.Version path, which is why Docker
images are unaffected.

Fixes the intent of #2242 (closed as 'by design' before the -X injection
existed; the current flag is present but inert due to the path mismatch).
2026-09-23 12:07:17 +08:00
RedwindA 996adffe51 fix(web): keep text selection when opening a model pricing row for editing (#7403) 2026-09-22 16:40:59 +08:00
feitianbubu 8cb88ebd17 fix: move force operation into confirm slot so plugin-in-use dialog has one cancel button (#7528) 2026-09-22 16:37:08 +08:00
Yorick 9310231b3c fix(logs): keep model badge text readable and compact (#7504)
* fix(logs): prevent model badge descenders from clipping

* fix(logs): constrain wrapped model badge width

* fix(logs): preserve compact model name line spacing

* fix(logs): give wrapped model names sufficient line height
2026-09-22 00:07:07 +08:00
CaIonandByebyDoggy 0aec08fee8 chore: credit #7444 author for the Claude tool_result fix landed in #7512
Co-Authored-By: ByebyDoggy <ByebyDoggy@users.noreply.github.com>
v1.0.0-rc.40 relaykit/v0.2.1
2026-09-21 23:02:57 +08:00
CaIon b6809a52df fix(web): resolve safe constants in plugin metadata previews 2026-09-21 23:02:37 +08:00
Calcium-IonandMOON-DREAM-STARS 4eb3b91605 fix(relayconvert): hoist Claude tool_result images and segment Responses reasoning items (#7512)
Claude Messages -> Chat: a tool_result whose content is a block array was
stringified into the Chat tool message, so image base64 travelled upstream
as text instead of vision input. Text blocks now stay on the tool message
(joined with newlines) and image blocks become image_url parts on the user
message the same Claude message produces, which lands after the tool batch
and keeps parallel tool messages contiguous. Image-only results carry an
"[image]" placeholder; arrays with other block types keep the stringified
form.

Chat stream -> Responses stream: reasoning items now emit
response.reasoning_summary_part.added and .done around the summary text,
and deltas that arrive after a mid-stream finish_reason open a new
reasoning or message item instead of appending to the closed one. Closed
items are snapshotted so the completed response lists every segment.

Closes #7407
Closes #7495

Co-Authored-By: MOON-DREAM-STARS <110315488+MOON-DREAM-STARS@users.noreply.github.com>
2026-09-21 22:50:27 +08:00
Calcium-IonandMOON-DREAM-STARS 6e9de44a7d fix(relayconvert): hoist Responses tool-output media into a user message (#7510)
A function_call_output whose output is a Responses content-part array was
stringified into the Chat tool message, so image data URLs travelled
upstream as base64 text instead of vision input.

Text parts now stay on the tool message (joined with newlines) and media
parts are mapped like regular content parts, then emitted as one user
message once the contiguous tool batch ends so parallel tool outputs stay
adjacent to their assistant tool_calls message. Media-only outputs carry
an "[image]"-style placeholder because upstreams reject empty tool
content; payloads that are not content-part arrays keep the stringified
form.

Closes #7498

Co-Authored-By: MOON-DREAM-STARS <110315488+MOON-DREAM-STARS@users.noreply.github.com>
2026-09-21 22:11:21 +08:00
CaIon 54eee488be fix(web): isolate theme preferences in local storage 2026-09-21 21:01:16 +08:00
CaIon d61d6be759 fix(task): accept any 2xx upstream status on task submission
The submit relay treated every status other than 200 as an upstream
failure, so a task API that answers 201 Created or 202 Accepted (for
example Tencent's wand-vega-video-1.0-lite) returned fail_to_fetch_task
and parseSubmitResponse never ran. The check predates the plugin system,
when every built-in adaptor answered 200; the plugin adaptor already
passes the exact statusCode to parseSubmitResponse and polling has
always classified 2xx as a successful response.

Accept any 2xx before parsing and keep failing other statuses with the
upstream status and body. Add a relay regression that drives a plugin
submission against a real upstream returning 200/201/202 and 400/502,
and document the submit-side 2xx contract in the plugin API.

Fixes #7478
2026-09-21 21:01:16 +08:00
CaIon 2c175190c4 perf(plugins): sync task plugins from hashes and load source only for changed rows
Every node polls the active override set every 30 seconds, and the
snapshot query selected whole rows, so each poll pulled every plugin's
full source and icon from the database only to compare source_hash and
discard them. With sources allowed up to 8 MiB that is real traffic.

Skip the source and icon columns in the sync snapshot and fetch source by
row id only for plugins whose hash changed. A row never changes source in
place, so the id from the snapshot identifies exactly the text its hash
describes. A failed source load is handled like a compile failure: the
running plugin stays and the next poll retries.
2026-09-21 21:01:16 +08:00
CaIon c0cff23a3a fix(plugins): store task plugin source as longtext on MySQL and raise the upload cap to 8 MiB
A bare TEXT column holds 64 KiB on MySQL, and the shipped alibaba plugin
is already 73 KB, so uploading an override of it failed with "Data too
long for column 'source'" or was silently truncated. The 1 MiB upload
cap also blocks the larger plugins planned next.

Add model.LongText, a string type that picks longtext on MySQL and text
on PostgreSQL and SQLite through GormDBDataType, and use it for source
and icon. Neither type carries a length, so AutoMigrate leaves an
up-to-date column alone and widens the shipped MySQL text column once
without data loss. Raise the source cap to 8 MiB on the backend and in
the frontend picker, importers and locale strings.

Verified fresh and rc.39-upgrade startups twice each on SQLite, MySQL
5.7.44 and 8.4.11, PostgreSQL 9.6.24 and 17.11; the second start issues
no DDL and a 73 KB source round-trips on every engine.
2026-09-21 21:01:16 +08:00
CaIon e537dc380b fix(web): expose plugin activation after upload 2026-09-21 21:01:15 +08:00
CaIon 00e8a00cb4 fix(web): include provider icons in Windows builds 2026-09-21 21:01:15 +08:00
feitianbubu 474ed66fb1 fix(plugins/alibaba): keep upstream metadata in openai_image render (#7507) 2026-09-21 20:46:28 +08:00
feitianbubu 9c293e8c02 test(billing): fix websocket rejection refund test after pre-consume dropped output estimation (#7491) 2026-09-21 12:48:24 +08:00
CaIon 9a0be8750a fix(web): keep task pricing editable after a plugin narrows its enum values
When a task plugin stops declaring an enum value (Seedance 2.0 mini now
offers 480p and 720p only), an expression saved with 1080p and 4k
branches no longer opened in the visual price table: the parser rejected
the whole tier chain on the first undeclared value, the editor fell back
to expression mode with a "cannot be represented" notice, and switching
to the visual editor reset every price to zero.

Treat a branch on an undeclared enum value as unreachable and skip it,
so the remaining tiers stay editable with their prices preserved. Nested
conditions in the pricing display treat such a comparison as never
matching. Editing a price regenerates the expression without the
unreachable branches; opening the editor alone leaves the stored
expression unchanged.
2026-09-20 23:27:57 +08:00
CaIon 47713bcb17 feat: update plugins 2026-09-20 23:23:48 +08:00
CaIon 9978ee1e25 feat(billing): configure trust threshold and input pre-consume multiplier v1.0.0-rc.39 2026-09-20 22:17:20 +08:00
CaIon 65d3a2171f fix(plugins): price only the resolutions each Seedance and Wan model offers
The doubao plugin shared one usage schema across every Seedance model, so
the pricing matrix listed 1080p and 4k rows for Seedance 2.0 mini and fast
and a 4k row for Seedance 2.5, none of which Ark offers, and priced 1.0
and 1.5 pro by a reference-video dimension they do not accept. Describe
each video model with its resolutions, reference-video and audio
capabilities from the Ark model list and derive the usage schema,
examples and profiles from that table; reject unsupported resolutions at
submission, reserve the model's highest tier when the resolution is left
to Ark and ignore an out-of-profile resolution on completion. Seedance
1.5 pro gains the generate_audio fact its audio and silent prices need.

The alibaba plugin likewise derives one Wan video profile per resolution
set from the model capability table instead of listing 480P/720P/1080P
for every model, and adds the audio fact for wan2.6-i2v-flash.
2026-09-20 22:17:20 +08:00
feitianbubu 3abbb8198e feat: record perf metrics when async tasks reach terminal status (#7481) 2026-09-20 20:16:50 +08:00
CaIon 2fddb863f2 feat(models): add bulk field selection to metadata sync 2026-09-20 19:27:37 +08:00
CaIon a5bf940220 fix(web): correct dialog viewport fallbacks and editor gutter alignment 2026-09-20 18:24:39 +08:00
CaIon 03563a4a79 feat(plugins): serve OpenAI Images API through task plugins
Add the synchronous openai_image host protocol so a task plugin can claim
POST /v1/images/generations and /v1/images/edits; the host submits the
task, polls it inside the request and lets the plugin render the OpenAI
image response. Unclaimed models still fall back to the HTTP image relay.

- Migrate Ali (Bailian) image models to the alibaba plugin and remove the
  ali channel image/wan adaptors and the qwen model setting
- Add Doubao Seedream image generation to the doubao plugin
- Support retainResult on routes and indexed multipart file references
- Settle image counts from upstream usage or image payloads; document the
  rule in the billing conventions and plugin API docs
- Show billing source and task artifacts in usage logs; rename the
  DoubaoVideo channel display name to Doubao and refresh the favicon
2026-09-20 17:58:45 +08:00
CaIon c49972441e fix(web): keep mobile dialog actions within visible viewport 2026-09-20 17:51:53 +08:00
CaIon 585c4610e5 feat(keys): show and copy configured API addresses 2026-09-20 17:51:53 +08:00
CaIon d904b97000 feat(settings): improve group configuration UX and drag sorting 2026-09-20 17:51:53 +08:00
CaIon da2540dda1 fix(channels): align card metrics and remove badge spacing 2026-09-20 17:51:53 +08:00
CaIon 3fdf9083dc fix(settings): move documentation link to site settings 2026-09-20 17:51:52 +08:00
CaIon 58a9eff4c8 style: refresh logo 2026-09-20 17:51:52 +08:00
CaIon db536ec8bc fix(channels): simplify model redirects and clarify panel controls 2026-09-20 17:51:52 +08:00
CaIon 6b638788c6 fix(channels): preview upstream model changes before applying 2026-09-20 17:51:52 +08:00
CaIon 2d7aef7414 fix(web): restore CC Switch model dropdown 2026-09-20 17:51:52 +08:00
CaIon 4c34f25a49 feat(channel): bind multiple task plugins to New API channels
A New API (type 60) channel proxies another gateway that may host many
task plugins, so the channel setting gains task_extend_plugin_keys; the
single task_plugin_key stays valid there as well. Channel selection,
shared-model candidate rebinding, the task_plugin.bind permission gate,
plugin usage counting and the disable cascade (which now unbinds gateway
channels instead of disabling them) all honour the union of both fields,
and plugins may no longer claim channel type 60 in channelTypes.

Plugins declare meta.upstreams and the host injects ctx.upstream into
every driver hook context. On a type-60 channel the driver addresses its
own prefixed native routes (doubao, alibaba, kling, jimeng) and the host
sends the channel key as a Bearer header for every auth type; polling
threads the channel type through ChannelMeta and tasks keep the key
that submitted them. Only plugins declaring new_api can be bound.

The channel form offers an "Upstream task plugins" selector for type-60
channels, MultiSelect options can carry an icon, and the plugin API docs,
type declarations and schema describe the additive apiVersion 1
extension.
2026-09-20 17:51:51 +08:00
CaIon 33320407f4 fix(web): isolate OIDC discovery when saving OAuth settings
Run discovery only when its URL changes or OIDC is enabled. Show URL validation errors beside the field and keep save actions disabled throughout submission. Correct Well-Known terminology in translations and cover provider-independent saves, validation, discovery failures, and loading state.

Validation from web/: bun run test src/features/system-settings/auth/__tests__/oauth-settings.test.tsx src/features/system-settings/auth/__tests__/passkey-settings.test.tsx (30 passed); bun run typecheck; bunx oxlint -c .oxlintrc.json src/features/system-settings/auth/oauth-section.tsx src/features/system-settings/auth/__tests__/oauth-settings.test.tsx; bunx oxfmt --check on both files; bun run build; bun run i18n:sync. In-app browser checked GitHub save and inline OIDC error using an isolated fixture with mocked API responses.

Security scope: settings form only. Consulted OWASP ASVS 5.0.0 section 8.3.1 and the Authentication, Session Management, and OAuth2 Cheat Sheets. Server authorization and authentication protocol flows are unchanged; this is not a full authentication compliance assessment.
2026-09-20 17:51:51 +08:00
CaIon 9c3d3aeb3c perf(web): lazy-load provider icons and reduce page rerenders 2026-09-20 17:51:51 +08:00
CaIon b932e6d876 fix(web): robustly display conditional task billing prices 2026-09-20 17:49:37 +08:00
CaIon ef70d1b799 chore: drop trailing blank line from .gitignore 2026-09-20 17:49:37 +08:00
CaIon a89037d0b9 fix(web): start linked-account verification from the provider button
When the security verification dialog only offers OAuth, the provider
button was a no-op selector for an already selected provider and the
actual OAuth popup only opened from the footer Verify button.

Make the provider button trigger verification directly, hide the footer
Verify button on the OAuth tab, and let onVerify accept an explicit
input so the clicked provider is used instead of stale state.
2026-09-20 17:46:33 +08:00
Seefs 972aed1972 fix(log): derive response model mismatch from names instead of a stored flag (#7464) 2026-09-19 13:51:18 +08:00
CaIon b0bf2580e2 docs: restore README badge and partner placement 2026-09-19 02:30:22 +08:00
zuiho e04c05c2b9 fix(web): 修复小数输入限制和日志分组选项未遮挡的问题 (#7453)
* fix(web): accept fractional group ratios and tool prices

* fix(web): mask portaled group options in usage log privacy mode

* fix(web): limit pricing input steps to four decimal places
2026-09-19 02:28:28 +08:00
CaIon 1ea24a050d docs: refresh project README across languages 2026-09-19 02:21:58 +08:00