Commit Graph

1239 Commits (e18cf138a3e96edbb2cc3e706ceb89ae40e24e21)

Author SHA1 Message Date
vicfei a57e97c4e1 fix(frontend): keep agent editor dependency loading alive for contributors
The agent editor's dependency chain resolves storage engine info through
editorResources.ensureStorageEngine, which awaited the admin-only
tenants/kv/storage-engine-config call and the Viewer-safe status call in
one Promise.all. A Contributor opening the editor got 403 on the config
call (it carries integration secrets), which rejected the whole chain and
skipped every dropdown population — models, knowledge bases and web
search providers stayed empty, so Contributors could not create agents
at all (#2991).

Downgrade permission rejections on the config call to "no admin config"
(the only consumer of storageConfig already tolerates null and falls
back to the status list); every other failure stays fatal. The predicate
lives in a dependency-free module so it is unit-testable under
tsx --test like the other store helpers.
2026-09-08 12:28:44 +08:00
wizardchen 694f0413dd refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +08:00
lyingbug 647848f395
fix(agent): improve web search and persistent page reading (#3086)
* fix(agent): improve web search and persistent page reading

* fix(agent): make web fetch snapshots waitable and retryable

Keep in-flight page fetches independent of a caller's short deadline so
content=true and continuations cannot cancel a shared download or miss a
snapshot that is still loading. Mark snapshot_expired as retryable, fetch
only the first three search hits in parallel, and stop forcing Brave's
country to US.
2026-09-07 23:09:27 +08:00
GUO Zhaogong df7d871af0 fix(i18n): restore natural Japanese in proofread strings
Second pass over the strings touched by the proofreading commit,
reverting over-corrections that read worse than the original:

- Progress messages go back to the 〜しています… sentence form; the
  clipped 〜中… labels were unnatural in context
- Keep established katakana terms (プログレッシブエージェンティックRAG,
  エージェンティックRAG, Wikiレビュー, ネガティブ例, 生の出力) instead
  of kanji paraphrases; keep クエリ in the embed widget
- Remove commas placed inside noun phrases (〜のための、より〜) and fix
  stacked-modifier sentences (共有解除の確認文, 権限不足の説明文,
  並列実行数の説明)
- Restore sentence-form placeholders/toasts where the noun-only form
  sounded cut off (モデルに直接質問できます, お待ちください…)
2026-09-07 20:11:56 +08:00
Fei.Chen 15727591a7
feat(web-search): add Bocha AI Search provider (#3036)
* feat(web-search): add Bocha AI Search provider

Add a Bocha (bochaai.com) web search provider following the Metaso
adapter pattern: hardcoded official endpoint (SSRF-safe), Bearer auth,
4MB response cap, error-detail extraction, and RFC3339 date parsing
(datePublished preferred, dateLastCrawled fallback).

Tenant-facing config fields:
- freshness: noLimit/oneDay/oneWeek/oneMonth/oneYear (default noLimit)
- summary: request long text summaries, preferred as snippets (default on)

Wiring: registry factory in container, provider type enum + /types
metadata (dynamic form fields), frontend provider union type, and
swagger docs enum entries.

* fix(web-search): match Bocha's real wire format for codes and error messages

Live endpoint probing showed errors return {"message": .., "code": "401"}
(string code, message field) instead of the documented {msg, code:int}.
Parse the code tolerantly (string or number) and extract the detail from
message/msg so auth and rate-limit failures surface their reason.

* fix(web-search): allow Bocha in provider CRUD validation

In-service integration testing caught a fourth wiring point the adapter,
registry, /types metadata and frontend covered but CRUD did not: the
service-layer whitelist (isValidProviderType) and parameter validation
switches rejected provider type 'bocha', so providers could be tested
via POST /web-search-providers/test but never created or updated.

Add Bocha to both switches (delegating to ValidateBochaParameters like
Metaso/Zhipu) with service-level test coverage.

* fix(web-search): correct Bocha legacy timestamp timezone

---------

Co-authored-by: vicfei <vicfei@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 20:06:26 +08:00
HJX|翻斗花园二蛋 bd6c4a9b96
fix(frontend): recover the chat stream from an expired access token (#3028)
* fix(frontend): recover the chat stream from an expired access token

The SSE chat request runs on raw fetch, outside the axios instance, so the
401 refresh flow in utils/request.ts never applied to it. An expired token
left the user staring at an orphaned message bubble and a dead-end
"HTTP 401" toast, with no re-login prompt until some unrelated polling
request happened to hit 401 seconds later.

Extract the refresh into a shared, de-duplicated helper and have the stream
client use it: on a 401 handshake, refresh once and replay the request.
The replay cannot duplicate a message because auth rejects before the
handler runs, and nothing has been rendered yet. Embed visitors are
excluded since their token cannot be refreshed by the SPA.

* fix(frontend): keep a minted session after a post-refresh SSE 401

A second chat handshake 401 is not proof the session is gone — tenant
lookup also returns 401 — so wiping the just-refreshed tokens logged
users out unlike axios. Identify StreamAuthError by name, pin replay
to the original abort controller, and cover the shared refresh queue
with unit tests.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 19:46:46 +08:00
HUANG Cheng 6a55860431
feat(ui): multi-stage Docker frontend build (no host npm) (#3074)
* feat(ui): multi-stage Docker build without host npm

Build frontend assets inside the image with node:24-bookworm, then
copy into the existing digest-pinned nginx runtime so docker compose
and CI no longer require a host-side dist step.

* fix(ui): copy local xlsx package and raise Node heap in Docker build

npm ci needs packages/xlsx before install, and vite OOM'd under the
default Node heap during the multi-stage image build.

* fix(ui): native multi-arch frontend Docker build and layer cache

Keep Vite on BUILDPLATFORM so CI does not qemu-emulate Node, pin the
builder image, and move the commit ARG after npm ci so dependency
layers stay cacheable.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 19:33:57 +08:00
GUO Zhaogong 071a87d5f7 fix(i18n): proofread ja-JP locale strings
Follow-up to #3080. A full proofreading pass over the Japanese locale
against the en-US and zh-CN sources, fixing mistranslations, awkward
phrasing and inconsistent terminology:

- Meaning: "organization" contexts now consistently say 共有スペース
  (not bare スペース); remove-from-space actions no longer read as
  deleting the member/agent/KB; built-in model description says
  "visible to" rather than "usable by" all workspaces; several
  descriptions (parser features, xlsx header option, runtime capacity,
  credentials invalidation) corrected against zh-CN
- Terminology: 改写 -> リライト, 机器人 -> ボット, 知识库 -> ナレッジベース
  (not ナレッジ), ReRank -> リランク, サインイン -> ログイン,
  制御プレーン -> コントロールプレーン, API-key capabilities -> 権限,
  "Agentic RAG" kept in English, self-hosted -> セルフホスト
- Wording: fix broken particles/係り受け (JWTに署名, 〜に失敗), drop
  unnatural potential forms (超えられません), align status chips
  (〜済み), progress messages use the 〜中... form, placeholders follow
  the English form, 未提供 -> なし, remove trailing ! on error toasts
- Conventions: keep ヘッダー / リンター with the long-vowel mark; remove
  remaining Latin/Japanese spaces (チャンク#{index}, unix://を)
- Prompt template and agent preset labels get the same fixes
2026-09-07 19:33:36 +08:00
GUO Zhaogong 6f0ed94a47
feat(i18n): add Japanese (ja-JP) locale support (#3080)
* feat(i18n): add Japanese (ja-JP) locale support

Add a complete Japanese UI locale for the admin frontend and the web
embed widget, and register it everywhere the supported-locale list is
enumerated.

- frontend/src/i18n/locales/ja-JP.ts: full bundle (5,600+ keys) aligned
  with en-US/zh-CN key structure; verified by the locale key audit
- frontend/src/i18n/embed.ts: ja-JP block for the embed widget, plus
  `ja*` normalisation in normalizeEmbedLocale
- Register ja-JP in i18n index, SUPPORTED_LOCALES, localeKeyAudit
  bundles/order, TDesign locale map (ja_JP), login language picker,
  general settings dropdown and embed default-locale options
- Add `language.jaJP` key to every locale so the settings dropdown can
  use $t like its siblings
- Accept ja-JP as an embed channel default_locale on the backend and as
  DEFAULT_LOCALE in the frontend docker entrypoint
- Extend locale-enumerating tests and update accepted-value lists in
  .env.example, public/config.js, widget script and website-docs

* feat(i18n): add ja-JP names and descriptions for prompt templates

Add a ja-JP block to the i18n map of all 32 prompt templates
(system_prompt, context_template, rewrite, fallback, intent_prompts,
agent_system_prompt) so the template picker shows Japanese labels when
the UI locale is ja-JP instead of falling back to the Chinese names.
Prompt content is unchanged.

* feat(i18n): add ja-JP strings for the CLI integration page

main gained the CLI setup page (#3081) with 18 new integrations.cli.* /
integrations.tabs.cli keys; add their Japanese translations so the
locale key audit stays green after rebasing onto main.

* style(i18n): unify ja-JP spacing and long-vowel conventions

- Remove spaces between Latin tokens and adjacent Japanese text
  (e.g. "MCP サービス" -> "MCPサービス"), matching the majority style
  already used in the bundle
- Drop the trailing long-vowel mark on common technical katakana terms
  (サーバ, ユーザ, フォルダ, プロバイダ, パラメータ, ヘッダ, クラスタ, ...)
  so the whole locale follows one convention

* feat(i18n): add ja-JP labels for agent type presets

config/agent_type_presets.yaml carried default / zh-CN / zh-TW labels
only, so the agent editor showed English preset names in the Japanese
UI. Add a ja-JP label and description to all five presets.
2026-09-07 19:20:41 +08:00
MidoriKurage 384fbcf7ed fix(frontend): project create-user HTTP status onto a 'created' flag
createSystemUser now returns 'created' derived from $httpStatus
(201 create / 200 idempotent retry).
2026-09-07 17:30:47 +08:00
lyingbug 5be8d13fc6
feat(integrations): add CLI setup page (#3081)
* feat(integrations): add CLI setup page

* fix(settings): include all integrations in sidebar groups
2026-09-07 17:11:40 +08:00
wizardchen 5f98eaadaa fix(preview): lazy-load markdown images without dropping data URIs
Eager remote images freeze large Markdown previews, but a scheme-based
allowlist also hid data:image URLs that document parsers emit. Keep lazy
loading on a preview-only sanitizer that matches DOMPurify's URI policy.
2026-09-07 16:58:30 +08:00
wizardchen 02c1759044 fix(knowledge): confirm document deletion before reporting success 2026-09-07 15:43:28 +08:00
Binks Riverton 5fa50711e2 fix(ui): prevent invite registration form header overlap 2026-09-07 14:55:19 +08:00
dzc-bit 25a930b9a0 fix(preview): stop routing legacy .doc/.ppt to the OOXML previewers 2026-09-07 14:28:41 +08:00
linhongyu510 01377b686c fix: persist cleared IM knowledge bases 2026-09-07 14:24:41 +08:00
MidoriKurage fee252e936
refactor(system): extract reset-password popup into ResetPasswordDialog (#3047)
* refactor(system): extract reset-password popup into ResetPasswordDialog

* fix(system): preserve pending password resets across tab changes

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 13:26:59 +08:00
MidoriKurage 6f5a9c8c31 feat(frontend): expose HTTP status on API responses via $httpStatus 2026-09-07 13:12:30 +08:00
Lathan 7d5c13ba8e fix(organization): 修正成员权限说明中编辑角色的共享知识库权限
权限说明弹窗将编辑(editor)角色的「共享知识库到共享空间」标记为不可用,
与后端行为不符:ShareKnowledgeBase 仅要求共享人的组织角色为 editor+
(kbshare.go: HasPermission(types.OrgRoleEditor),admin=3/editor=2/viewer=1),
智能体共享同理(agent_share.go),且前端无角色级拦截,编辑实际可共享。
将两个弹窗(权限卡与紧凑矩阵)中编辑角色该条目改为可用,与代码保持一致。
2026-09-07 13:07:26 +08:00
yushangcan 84f2345641 fix(frontend): finish knowledge base tour without creating a knowledge base 2026-09-07 11:56:00 +08:00
lyingbug 3d3bb7f6d1
fix(system): keep one-time create-user passwords and copy full account details (#3039)
* fix(system): keep one-time create-user passwords from being discarded

Escape leaked to the Settings modal, and a double submit could replace a
201 reveal with an idempotent 200. Show the password in plaintext and
distinguish create vs retry via an idempotent body flag.

* i18n(system): update copy button and success message for account details

Changed the labels for the copy button and success message across multiple languages in the localization files to reflect the new terminology for copying account details instead of just passwords. This update enhances clarity for users when interacting with the Create User dialog.
2026-09-06 00:35:08 +08:00
MidoriKurage dcc89d4b2d
feat(system): add admin UI for creating users (#3034)
* i18n(system): add createUser strings for SystemAdmin dialog

* ui(system): add Create user dialog to the Access settings tab

Wire the unused createSystemUser API to a third row in the SystemAdmin
Access section. The dialog (CreateUserDialog.vue) has two views:

- Form: username, email, and an auto-generate toggle that reveals
  new/confirm password fields when off.
- Reveal: one-time generated password the admin must acknowledge;
  overlay click, Esc, and the close button are disabled until then.

Also:
- The idempotent 200 OK path (no generated_password) closes with its
  own success toast.
- The teleported dialog shell is shared via systemAdminDialog.less.
- Password policy comes from upstream's @/utils/passwordPolicy
  (complex-password aware) rather than a local shared module.

* i18n(audit): register system.user_created for the SystemAuditLog
2026-09-06 00:10:04 +08:00
wizardchen 816bb3c982 feat(session): show in-progress status in the sidebar
Keep a spinner on chats that are still generating, including after you
leave the thread, so background replies stay visible in the session list.
2026-09-05 23:32:13 +08:00
ninesun 1e36e071ec
feat(mcp): add per-tool enable toggle (#2989)
* feat(mcp): add per-tool enable toggle

* style: format migration test

* fix(mcp): keep enable and approval updates from overwriting each other

Partial policy writes now touch only the supplied columns, and a missing
tenant fails closed so a disabled tool cannot slip through.

---------

Co-authored-by: myysophia <myysophia@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-05 17:19:20 +08:00
lyingbug d5cb842580
feat(agent): unify sandbox tools and drop host preloaded skills (#3033)
* feat(agent): unify sandbox tools and drop host preloaded skills

Read workspace and skill files through read_file, and run installed or staged skills through shell_exec(skill_name). Remove the unused skills/preloaded tree and keep generated-file previews stable across re-renders.

* fix(frontend): do not assume classList in markdown sanitize hooks

Node unit tests stub anchors without a DOM classList. Detect download cards from class/download attributes instead.
2026-09-05 16:45:59 +08:00
Anky 2834e6dcf6
fix: widen audit log drawer (#3001)
* fix: widen audit log drawer

* style: remove audit drawer comment

* feat: make audit log drawer resizable
2026-09-05 16:35:31 +08:00
FincherYuan 2d6b84cb23 feat(session): show owner badge for API sessions in sidebar
Sessions owned by synthetic principals (api_external_user:<tenant>:<id>,
api_tenant_key:<tenant>:<keyID>) have no real account row to display, so
the sidebar previously showed nothing about who created them. Render a
small badge next to the title: the readable sub for external-user
sessions, a generic "API" tag for key-scoped sessions. Regular
account/web sessions stay unchanged (no badge).

user_id already flows through mapSessionRow -> bucket items ->
SessionSidebarRow; only the render was missing.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-04 17:32:00 +08:00
wizardchen d75cf72fc6 chore: prepare v0.8.0 release notes and version bump
Bump VERSION, frontend, and Helm to 0.8.0; document sandbox, skill catalog, long-term memory, and related API/client changes.
2026-09-03 14:46:44 +08:00
hailongzhao 4d56f64a0b fix(sandbox): always require inbound credentials
Ignore and clear allow_public_inbound on save so API clients cannot open public inbound.
2026-09-03 13:34:40 +08:00
hailongzhao 52d1551165 fix(sandbox): hide inbound controls and let Cube L7 rules be reordered
The editor no longer exposes inbound access; saves omit
allow_public_inbound so the zero value (require credentials) is stored.
Cube L7 rules can be moved so first-match-wins order is explicit.
2026-09-03 13:34:40 +08:00
hailongzhao efb7e2aea2 fix(sandbox): drop the unused volume-capability warning from the check result
Skills do not use shared volumes yet, so telling the admin a backend
cannot mount them is noise after a connectivity check.
2026-09-03 13:34:40 +08:00
nullptr-error e39277a75e
feat(sandbox): add tenant-configurable network policy (#2995)
* feat(sandbox): add the tenant network policy with its secrets and validation

Administrators need control over sandbox network access, so a named sandbox
config gains a network policy block. It lives inside the existing config JSONB,
so there is no schema change and old rows read back as the zero value.

Both booleans are phrased so that the zero value IS the intended default --
outbound open, inbound closed. That makes "no network block" and "explicitly
saved defaults" provably the same thing, and avoids a tri-state pointer where
nil would have to mean "allowed" for egress and "closed" for ingress.

Injected header values are credentials, so they ride the encrypt-at-rest and
mask-on-read path EnvVars already uses instead of a parallel mechanism. One
CloneWithSecrets traversal serves encrypt, decrypt and mask so the three
directions cannot disagree about which fields are secret.

Validation runs at save time because the alternative is failing at
sandbox-create time, where the admin no longer has the form in front of them.
It rejects both what a provider would refuse and what a provider would accept
without doing what the admin meant -- a domain allowlist with no deny-all
fallback still leaves every unresolved destination reachable.

* feat(sandbox): apply the network policy on both providers, persist the inbound token

Resolve the stored policy into one fully specified provider-neutral policy so
that nothing downstream re-derives a default. Both booleans come out non-nil on
every path, including the nil-tenant one, because a partially specified policy
would let the adapters fall back to their providers' more permissive defaults.
The three inversions (deny-egress to allow-internet, public-inbound, rule-deny
to rule-allow) happen in exactly one place.

Every sandbox-creating path carries it, so sessions, skill installs and the
deep connectivity check all run under the same config's policy rather than
each wiring its own.

Inbound access defaults to CLOSED, deliberately stricter than either
provider's own default: a sandbox URL reachable by anyone who learns the ID is
not a reasonable default for a tenant's workspace. Closing it makes the
provider issue a per-sandbox traffic token, and only at create time -- so the
token is stored with the session binding and replayed through Connect on every
reconnect. Without that, a sandbox that was paused on TTL or rebound after a
restart would answer 403 on every exec and file read, and 403 classifies as an
authentication error rather than NotFound, so the binding would never be
replaced and the session would stay wedged.

Connect therefore takes a request struct instead of a bare ID, which gives the
token a single documented way in rather than implicit state inside an adapter.

Metadata-based recovery is the one reconnect path with no binding to read the
token from. Rather than adopt a sandbox that would be permanently 403, it is
deleted and replaced -- but only for providers that have the credential at
all, since Docker has no inbound token and its containers are still adoptable.

go-e2b keeps the token and never sends it, so for E2B the data-plane
RoundTripper attaches the header from a process-local registry. Cube's SDK
already does this itself.

* fix(sandbox): classify data-plane traffic by authority shape, not the configured domain

isDataPlane suffix-matched the configured sandbox domain, which was wrong in
both directions. Both required a configured proxy_url, so E2B Cloud's default
usage was unaffected; the affected deployments are exactly the self-hosted and
E2B-compatible ones the gateway exists for.

A configured gateway could be silently ignored. sandbox_domain is optional for
E2B -- MissingRequiredFields asks only for api_key and template_id -- and with
it empty the check returned false for everything. The general form is worse
than the empty case: go-e2b's envdBaseURL prefers the domain the control plane
reported over the client-wide one, so the authority actually dialled need not
appear in the config at all. The failure is quiet whenever public DNS happens
to resolve the sandbox domain, and the operator believes traffic is passing
through a gateway that never sees it.

Control-plane calls could be sent to the gateway. E2B's own defaults put the
API host under the sandbox domain (api.e2b.app beneath e2b.app), so the suffix
match classified every Create, Connect and List as data-plane traffic. That
is loud where the gateway does not serve the API, but where it proxies both
planes it succeeds while downgrading an X-API-Key request to plaintext for an
http:// gateway. Cube was immune to the first problem, since it requires both
fields, but not to this one.

Classify on the "<port>-<sandboxID>.<domain>" shape both SDKs generate, using
the SandboxIDFromDataPlaneHost helper that token injection on the very same
request already relies on -- so routing and injection now agree by
construction instead of applying two different rules. That helper exists
precisely because the configured domain is unreliable here; it was simply
never used for the routing half.

The control host stays as an explicit exclusion. The shape test already
rejects api.<domain>, so this only covers an API host that itself wears the
shape, such as 8080-api.example.com.

One existing assertion was replaced rather than kept: the E2B pool test proved
that the Cube fields were ignored by asserting a cube.app authority was not
data-plane traffic, which tested the domain matching rather than the field
selection. It now asserts the transport dials the E2B gateway address and not
the Cube one.

* feat(sandbox): add the network policy editor to the sandbox config drawer

The policy sits in the runtime step, directly under the settings it
constrains, rather than in a step of its own. The existing execution timeouts
were compressed into a two-column grid to make room, keeping each field's own
label and its own tip -- the reason they were one per row was that three
unlabelled numbers sharing a footnote gave no clue which one you were editing,
and two columns with per-field tips does not regress that.

Provider-specific sections are shown only for the backend that has them: the
Cube L7 rule cards, E2B's per-host header transforms, and for Docker just the
bridge/none selector, since Docker can only express the overall switch.

Injected header values are write-only. A stored one shows as configured and is
preserved when the input is left blank, which is how env-var secrets already
behave. Renaming a rule or a header is the case worth care: the merge indexes
credentials on the rule-and-header pair, so a rename means the old value can no
longer be recovered. One helper decides both the placeholder text and whether
the payload re-attaches the value, so the form cannot claim a credential is
kept while the save blanks it.

The add buttons use keys of their own instead of reusing the env-var table's
"add variable", which read wrongly under a list of network destinations and
which the i18n key check cannot catch, since the key exists in every bundle.

* docs(sandbox): document the network policy and its inbound default change

The existing network bullet described the pre-feature state -- both providers
open by default, tunable only through the neutral policy at create time --
which is no longer true of the defaults or of the admin-facing surface.

Three things needed writing down rather than restating.

The inbound default flips from publicly reachable to credential-required. A
deployment that relies on a browser or an external service reaching a sandbox
port directly, rather than going through WeKnora, has to opt back in on that
config.

The binding store now holds a bearer credential in plaintext. Leaving it
unencrypted was a deliberate trade -- per-reconnect crypto on the hot path
against Redis's own access control -- and the trade is only sound if the
requirement is actually stated, along with the code-side constraint it depends
on: a binding or a handle is never logged whole, only the sandbox ID and
whether a credential is present.

On binding loss, a closed-inbound Cube or E2B config no longer adopts its old
sandbox by metadata. The token went with the binding and the provider will not
reissue it, so adoption would produce a session that answers 403 on every
data-plane call with no way back. The sandbox is deleted and rebuilt, which
costs the /workspace scratch. Docker has no such credential and still adopts.

* fix(sandbox): fail closed when a closed-inbound create has no traffic token

A Cube/E2B sandbox created without the inbound token would be bound anyway,
then 403 on every data-plane call as an unreplaceable authentication error.
Refuse the create, destroy the sandbox, and stop Docker from persisting
inbound/egress radios it cannot honour. Canonicalize IPv4 /0 deny-all onto
0.0.0.0/0 and reject CR/LF in injected header names and values.

* fix(sandbox): satisfy pre-push lint on the network policy files

Unexport the data-plane host parser, drop file-level package docs that
revive rejected, and lowercase error-string prefixes that staticcheck
ST1005 treats as capitalized English.

* fix(sandbox): persist rotated inbound tokens and stop misreporting restricted egress

Connect can reissue the traffic token after pause/resume; write it back onto
the binding so a restart does not restore a stale credential that 403s and
cannot be replaced. Restore the volume-support i18n key, map Docker
network_mode=none onto deny-egress, inject the E2B inbound header without a
gateway pool, and fold header names when merging redacted secrets.

---------

Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-03 10:49:46 +08:00
wizardchen 22489ba663 feat(chat): keep prompt prefixes stable and send provider cache markers
Provider prefix caches only hit when system/tools stay byte-stable and
cache routing is actually on the request. Stop rewriting those prefixes
mid-turn, attach prompt_cache_key / cache_control, and log hit rate
instead of showing it in the conversation tree.
2026-09-03 00:45:52 +08:00
wizardchen b747cdb3f6 feat(agent): stream live +/- progress for sandbox write and edit
Large write/edit calls used to sit on a spinner until the full JSON
arrived. Emit path and running line counts from partial arguments so
the UI can update in place, without putting file bodies on the SSE wire.
2026-09-02 23:36:58 +08:00
wizardchen 4c0d42c4cb feat(agent): keep long sandbox turns from truncating, overflowing, or rewriting files
Refuse truncated tool calls, compact-and-retry once on overflow, and let
sandbox files be appended, paged, and batch-edited instead of rewritten.
Models can set context_window (default 200K) so compaction sizes itself
from the real window; agent max_iterations of -1 means unlimited.
2026-09-02 22:09:09 +08:00
leon4z 988cbb0330
fix(models): show usage details when deletion is blocked (#2975)
* fix(models): show usage details when deletion is blocked

* fix(models): open the matching agent section and cap usage lists

Agent "open configuration" now lands on the tab that owns the binding
(VLM/ASR vs follow-ups), and delete failures keep the server message when
structured details cannot be parsed. Listed KB/agent rows are capped at 50
while totals still drive the deletion guard and dialog headings.

---------

Co-authored-by: Leon <leon_hfut@foxmail.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-02 17:20:37 +08:00
wizardchen a2328f0470 fix(frontend): include nginx-api-proxy.conf in the UI image build
.dockerignore was still excluding the snippet after Dockerfile started copying it, so the weknora-ui buildx job failed with a missing cache key.
2026-09-02 15:32:33 +08:00
wizardchen 12c3465b95 feat(skills): add StopSkill functionality to abort in-flight installs
- Introduced StopSkill method to allow users to abort ongoing skill installations, enabling retry or uninstall options.
- Updated API documentation to include the new stop endpoint for skills.
- Enhanced frontend components to support stopping skills, including UI updates and user feedback messages.
- Added tests to ensure the StopSkill functionality works as intended, including handling various skill states.
- Updated internationalization files to include new messages related to stopping skills.
2026-09-02 15:08:05 +08:00
wizardchen bbe95a6c1b refactor(skills): enhance skill upload size management and error handling
- Updated .env.example to clarify skill zip upload limits and their implications for Nginx configuration.
- Refactored frontend logic to differentiate between skill zip uploads and other uploads, ensuring accurate error messages for oversized requests.
- Improved utility functions for managing upload limits and added tests to validate behavior for oversized JSON bodies.
- Enhanced error handling in various handlers to provide clearer feedback on upload size constraints, particularly for sandbox and catalog installations.
2026-09-02 15:08:05 +08:00
wizardchen 17324c46e4 refactor(skills): improve skill bundle size handling and error management
- Updated .env.example and docker-compose.yml to clarify skill bundle size limits and their implications for GitHub source downloads.
- Enhanced frontend logic to differentiate between skill bundle uploads and knowledge uploads, ensuring proper error messages for oversized requests.
- Introduced new utility functions for managing upload limits and added tests to validate behavior for oversized JSON bodies.
- Refactored error handling in various handlers to provide clearer feedback on upload size constraints.
2026-09-02 15:08:05 +08:00
wizardchen 3a06a3b9e9 refactor(skills): improve skill bundle size management and nginx configuration
- Updated .env.example to clarify the skill bundle size limits and their impact on Nginx configuration.
- Refactored frontend/docker-entrypoint.sh to separate max file size settings for skills and general uploads.
- Enhanced nginx.conf to apply specific body size limits for skill uploads without affecting other endpoints.
- Added tests to ensure proper handling of skill bundle file indexing and size constraints.
- Improved error handling in tenant_source.go and tenant_sandbox_config.go to manage skill file limits effectively.
2026-09-02 15:08:05 +08:00
wizardchen b6243bd985 feat(frontend): keep the install drawer open with live circular progress
After a catalog install the sandbox list stays put: busy rows show a circle plus percent from the install-events stream, and “view progress” stacks the manage drawer on top. Drawer width is clamped to the viewport so the action is not pushed off-screen.
2026-09-02 15:08:05 +08:00
wizardchen d3a3cc888d fix(frontend): move sandbox uninstall into the manage drawer header
The leftover danger-zone button sat under a wall of copy and opened a modal. Put a compact popconfirm on the title row instead.
2026-09-02 15:08:05 +08:00
wizardchen 56bf53a1fd fix(skills): raise skill zip cap and keep uninstall progress stable
GitHub skill packages such as ppt-master exceed the 50MB knowledge-upload limit. Give skills their own 256MB download/upload cap, keep uninstalling visible if the list lags, and distinguish zip-entry vs skill-file errors.
2026-09-02 15:08:05 +08:00
wizardchen 4d66d57fe7 feat(chat): pulse the artifact folder when generated files arrive
The toolbar count was easy to miss on completed answers. Animate only newly arriving artifacts so history stays still.
2026-09-02 15:08:05 +08:00
wizardchen 2783d9cab8 fix(skills): count GitHub skill subtrees and polish catalog install UI
Large GitHub skill folders were rejected because the installer counted the whole repo zip. Count only the SKILL.md subtree, raise the file cap, and hide uninstall while install is running.
2026-09-02 15:08:05 +08:00
lyingbug 02269bd8f1
feat: require opt-in for the Docker sandbox backend (#2936)
* feat: require opt-in for the Docker sandbox backend

Docker engine access is host-root equivalent, so keep the backend off
until System Settings or WEKNORA_SANDBOX_DOCKER_ENABLED says otherwise.
Also move system-settings help into the title icon and add i18n for
tenant.auto_accept_invitation.

* fix(i18n): drop tenant wording from Docker host-risk copy

The workspace terminology check rejects 租户 / tenant in user-facing strings.
2026-09-01 15:42:28 +08:00
Prodman Devokadev db05a64caa
feat: add LiteLLM as a model provider (#2923)
* feat(provider): add LiteLLM as an OpenAI-compatible provider

* docs: use revive-compliant comment for ProviderLiteLLM const

* fix(provider): stop defaulting LiteLLM to localhost under SSRF

The catalog URL localhost:4000 is blocked by default SSRF and does not
match DetectProvider, so UI/CLI could neither save nor auto-detect it.
Use a placeholder host, keep thinking aligned with generic, and sync
ModelSource across types, Swagger, and docs.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 12:21:03 +08:00
cainbit a55f4b7834
feat: support complex password (#2929)
* feat: support complex password

* fix: honor runtime complex-password policy on all password writes

Keep the service layer as the last check, share one resolver with invite
registration and admin user create, and drop the leftover startup debug print.

* fix: satisfy pre-push lint on password-policy error paths

The hook diffs against origin/main, so wrap the original error strings
and check c.Error on the new validation branches.

---------

Co-authored-by: wuwc.ew <wuwc.ew@cebwm.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 11:50:10 +08:00
wizardchen bf53cacf75 fix(frontend): resolve latest value for high-risk settings
Reused setting-row controls can close over a stale item after save.
Look up the current row by key for auth.registration_mode as well so
cancel and persist use the last saved value, not the first-loaded one.
2026-09-01 11:02:18 +08:00