Commit Graph

3276 Commits (4ba85e2edf71a041fa6846c14eb74ccfa0cfb389)

Author SHA1 Message Date
Duke 4ba85e2edf fix(wiki): fan out follow-up triggers so backlogs drain at ingest_max_inflight
Since Phase 3 the consumption side (disjoint claiming, per-slug locks,
the inflight cap) fully supports concurrent batches, but nothing created
more than one trigger per completed batch: once uploads stopped, a KB
with a standing backlog drained at 1 batch x batch-size per cycle
regardless of ingest_max_inflight, leaving the wiki pool and the model
server idle.

followUpTriggerCount now re-arms min(batches the remaining rows still
need, slots that could be free when the triggers fire). The caller's
own slot releases right after scheduleFollowUp returns, hence the +1.
activeInflightSlots is a read-mostly Lua companion to the reserve
script (purge expired, then ZCARD); -1 means unknown (no Redis / Redis
error) and collapses to a single follow-up, as do maxInflight <= 1 and
Lite mode (liteLocks serialize per KB anyway). Fan-out is deliberately
skipped on a rate-limited exit so a 429 storm is not amplified.

Over-issued triggers are harmless: the ones that cannot get a slot are
acked and coalesced by scheduleCappedRetry's fixed TaskID. The slot
count renders as "unknown" in the log when it was not consulted.
2026-09-28 22:02:07 +08:00
Victor Maznyuk bad7afa6ae fix(sandbox): pass desktop slot timing to the renew goroutine
renewDesktopSlot read desktopSlotRenew and desktopSlotLease from its own
goroutine. release() stops that goroutine without waiting for it, so the
read is unordered with the test cleanup that restores the values, and
`go test -race ./internal/handler/session/` fails in
TestDesktopSlotCancelsHoldWhenKeyExpires on every run.

acquireDesktopSlot now reads both durations before starting the goroutine
and passes them in; the go statement orders the reads, and the renew loop
no longer touches the package variables. Behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 22:01:39 +08:00
Perfecto 675b06addc test: consolidate table summary regressions 2026-09-28 21:24:02 +08:00
Perfecto d270a844ac fix: reject empty table-summary model responses 2026-09-28 21:24:02 +08:00
Perfecto d528d1fc3c fix: skip table-summary tasks for missing documents 2026-09-28 21:22:45 +08:00
bigdu332 bdad5eea2b fix(chat): clear stale KB scope on session restore 2026-09-28 21:20:12 +08:00
Victor Maznyuk 157fb4d3c1 fix(frontend): label host-sandbox skill secret cards like the sandbox cards
The sandbox cards on the environment-variable settings page already pass the
localized host label to configLabel, so the host config shows as "This
computer". The skill secret cards call configLabel without it and show the
raw backend name of the host config instead (本机), in every locale.

skillSecretCards now takes the same optional hostLabel and forwards it;
EnvVarSettings passes t('settings.skills.hostTarget') as it does for the
sandbox cards. Without a label the behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 21:10:02 +08:00
kwsYegar 9cab226853 docs: extract active tenant ID in the API quickstart 2026-09-28 21:08:33 +08:00
Victor Maznyuk 0b463e459a test(skills): wait for the host install to release its lock before asserting
TestHostInstallActivatesVersionAndMarksReady waited for the row to reach
ready and then read the fake tree and installer. runHostInstall records
ready while it still holds the skill lock; pruning old versions, unbinding
the install session and unlocking come after, so the test could observe
tree.pruned as nil or installer.bound still populated, and the race
detector reported the unsynchronised reads.

The fake tree now counts runs between Lock and unlock, and the wait
helpers block until no run holds it. The run unlocks last, so everything
it wrote is visible once the wait returns. waitRemoveDone had the same
gap (the row is deleted before the stale marks are recorded) and uses the
same wait.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 21:07:04 +08:00
Victor Maznyuk 5bf2ae1cc2 fix(faq): actually clean FAQ entry payloads before validation and storage
sanitizeFAQEntryPayload called meta.Normalize() and discarded the result.
Normalize returns a normalized copy for hashing and indexing and does not
touch its receiver, so no cleaning happened: blank, whitespace-only and
duplicate similar/negative questions and answers were stored as sent, two
empty similar questions were reported as a duplicate, and answers: ["  "]
passed the "at least one answer" check.

Call meta.Sanitize(), the in-place method meant for storage (trim, drop
empties, de-duplicate, keep the original text).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 20:29:29 +08:00
linus-liu-web a570dffcfa test(wiki): 表格夹具改用合成数据
`certLedgerRow` / `certLedgerBlock` 里的机构名、页面标题与行数都取自某一份具体
数据,而回归测试需要的只是形状:一张有很多行的 markdown 表格 + 表头 + 分隔行。
取值换成中性的示例数据 —— 机构名 `示例科技有限公司`、行标识 `成员 N`、标题
`证书台账`、行数 90(切 1..61 + 62..90),断言里的 92 = 90 行 + 表头 + 分隔行。

断言逻辑一行未动,5 个续写/上限/哨兵用例全 PASS。
2026-09-28 20:19:52 +08:00
lyingbug 9114e4e4f9
fix(citations): 修复原文定位、高亮范围与 DocReader 启动失败 (#3794)
* fix(citations): verify source locations and recover document previews

* chore: exclude local research notes from pull request
2026-09-27 20:32:26 +08:00
wizardchen 4df7ccbb4f fix(chat): drop stale minimap-target class binding
The question-outline flash (minimapTargetId, its timer and CSS) was
removed in #3427, but #3469 brought back the :class binding on user
message rows. Vue then warned that minimapTargetId was accessed during
render on every render. data-message-id stays: the minimap uses it to
find jump targets.
2026-09-26 19:07:54 +08:00
wizardchen 9fcc2c6743 fix(dev): propagate dev.sh exit status and pull MinIO from pgsty/minio
scripts/dev.sh ended with an unconditional `exit 0`, so a failed
`make dev-start` (e.g. an image pull error) printed "服务启动失败" but still
reported success to callers and CI. Drop it so the script exits with the
status of the dispatched command; help still exits 0, unknown commands 1.

MinIO closed anonymous pulls on quay.io on 2026-09-24 (Docker Hub was
already gone), so quay.io/minio/minio now answers 401 for every tag and a
fresh `dev-start` fails. No registry serves RELEASE.2025-09-07T16-13-09Z
anonymously any more. Switch compose and Helm to the community rebuild
pgsty/minio, pinning RELEASE.2026-08-04T00-00-00Z where a tag was pinned
before, and update the docs that named quay.io.
2026-09-26 15:30:27 +08:00
wizardchen 6c83d7ab47 revert: take the plugin system back out of main
Reverts the eleven plugin system PRs merged on 2026-09-26 so they can be
reviewed before landing:

* a829d7cc9 agent tools served by plugins (#3733)
* 4f5d475c3 Jira example plugin (#3730)
* 01222aac8 dynamic form options, OAuth connections and resource limits (#3729)
* cf502ba46 event delivery and webhooks (#3728)
* 996696057 sandboxed plugin pages (#3727)
* da4ef68d9 standalone plugin hosts (#3725)
* 728007ada remote runtime, Python SDK (#3724)
* ff49f9491 Host API and document parsers (#3721)
* 4328ab26a code plugins (#3720)
* ed63e35cc declarative plugins (#3716)
* c91a8d11f plugin system foundation (#3711)

The tree is back to 47773b5bd, migrations included: no environment ran
the plugin migrations (versioned 000115-000119, sqlite 000034-000038).
2026-09-26 14:58:18 +08:00
lyingbug a829d7cc9c
feat(plugin): agent tools served by plugins, with result views (P2 batch 8) (#3733)
* feat(plugin): agent tools served by plugins, with result views
* fix(plugin): expand plugin tool views in place in the agent stream
2026-09-26 14:48:37 +08:00
lyingbug 4f5d475c3e
feat(examples): Jira Cloud plugin with OAuth, dynamic options and a skill (#3730)
* feat(examples): Jira Cloud plugin with OAuth, dynamic options and a skill
2026-09-26 14:48:00 +08:00
lyingbug 01222aac8e
feat(plugin): dynamic form options, OAuth connections and resource limits (P2 batch 7) (#3729)
* feat(plugin): dynamic form options, OAuth connections and resource limits
* fix(plugin): show what an options list waits for as a hint, not an error
2026-09-26 14:47:37 +08:00
lyingbug cf502ba46a
feat(plugin): event delivery and webhooks for plugins (P2 batch 6) (#3728)
* feat(plugin): event delivery and webhooks for plugins
2026-09-26 14:47:13 +08:00
lyingbug 996696057f
feat(plugin): sandboxed plugin pages and the @weknora/plugin-ui bridge (P2 batch 5) (#3727)
* feat(plugin): sandboxed plugin pages and the @weknora/plugin-ui bridge
* ci(pluginsdk): run the Python job's steps in bash on Windows too
2026-09-26 14:46:49 +08:00
lyingbug da4ef68d9d
feat(plugin): standalone plugin hosts with Redis discovery (P2 batch 4) (#3725)
* feat(plugin): standalone plugin hosts with Redis discovery
2026-09-26 14:46:26 +08:00
lyingbug 728007ada9
feat(plugin): remote runtime, Python SDK and python host plugins (P2 batch 3) (#3724)
* feat(plugin): remote runtime
* feat(plugin): Python SDK and python host plugins
* fix(pluginsdk): skip reverse DNS when a Python plugin binds
2026-09-26 14:46:03 +08:00
lyingbug ff49f9491d
feat(plugin): Host API with a key-value store, and document parsers from plugins (#3721)
* feat(plugin): Host API with plugin tokens and a key-value store
* feat(plugin): document parsers from code plugins
* docs(pluginsdk): parsers and the Host API
2026-09-26 14:45:39 +08:00
lyingbug 4328ab26a9
feat(plugin): code plugins — extension protocol, Go SDK, plugin host, web search and data source adapters (#3720)
* feat(pluginsdk): extension protocol v1, Go SDK and conformance suite
* feat(plugin): run code plugins in an embedded plugin host
* feat(plugin): remote adapters for web search and data sources
* fix(plugin): show plugin errors by their message
* feat(frontend): plugin connectors and web search providers in the UI
* docs(pluginsdk): how to write, package, test and install a plugin
* fix(plugin): gofmt two files and read openapi.yaml line-ending agnostic
* fix(plugin): mark a host plugin ready before Activate returns
2026-09-26 14:45:15 +08:00
lyingbug ed63e35cc7
feat(plugin): install declarative plugins — MCP servers, skills and model vendors (#3716)
* feat(plugin): install declarative plugin packages across nodes
* feat(plugin): serve installed plugins' MCP servers in each workspace
* feat(plugin): let installed plugins contribute skills and model vendors
* feat(plugin): register plugin skills into the workspace skill catalog
* feat(frontend): manage installed plugins and their configuration
* test(weaviate): read the class state before the probe barrier
* fix(plugin): keep MCP tool directories reachable behind the plugin wrapper
* test(plugin): wrap a long line
2026-09-26 14:44:34 +08:00
lyingbug c91a8d11f8
feat(plugin): plugin system foundation — builtin plugins, config schemas and workspace switches (#3711)
* feat(plugin): add plugin manifest, registry and builtin catalog
* feat(plugin): add config schemas with unified secret handling
* feat(frontend): render config schemas with SchemaForm
* feat(datasource): serve connector credential forms from the backend
* feat(im): describe IM platforms and credentials from the backend
* feat(frontend): render model vendor extra fields from the config schema
* feat(frontend): build the settings modal from an extension registry
* refactor(agent): register builtin tools and their chat views
* feat(plugin): let workspaces enable and disable plugins
* feat(plugin): add the runtime driver interface and gather builtins
2026-09-26 14:43:28 +08:00
wizardchen 47773b5bd1 fix(frontend): initialize chat citation popover after botmsg props
useCitationPopover watches its cache-scope getter, so Vue evaluates the
sessionId getter synchronously during setup. botmsg.vue called
useChatCitationPopover above defineProps, hitting the TDZ on `props` and
logging "Cannot access 'props' before initialization" whenever an
existing chat session rendered assistant messages.

Move the call below defineProps and add a test that compiles every SFC
calling a citation popover composable and runs its setup against the
real popover chain, so a caller reading props too early fails in CI.
2026-09-26 13:34:43 +08:00
niannian 4364e61afa
feat(datasource/yuque): preserve TOC folder hierarchy for synced documents (#3476)
* feat(datasource/yuque): preserve TOC folder hierarchy for synced documents

The Yuque connector emitted a bare "<title>.md" file name, and folder_path
is derived from FileName alone (SplitKnowledgeRelativePath ->
NormalizeKnowledgeFolderPath). With no "/" in the name the derived folder is
always empty, so every synced document landed at the knowledge base root no
matter where the book's TOC places it.

Read the book's TOC once per sync, fold it into a per-document path by walking
parent_uuid upward, and prepend the result to FileName. The GitLab connector
already works this way; this supplies the missing input rather than changing
the FileName -> folder_path machinery.

Three optional settings, all defaulting to the previous behaviour so the
emitted FileName stays byte-for-byte identical unless folder_mode is set to
"toc". A TOC failure degrades to flat names rather than failing the sync, and
the toc_only filter is skipped entirely when no TOC was fetched.

* feat(datasource/yuque): make toc_only an admission filter, drop include_book_title

Review follow-ups for the TOC folder hierarchy change.

toc_only used to run before the document was recorded for deletion detection,
so a document that was present in the source but not admitted came back as
IsDeleted — and with sync_deletions on, the sync service then deleted it from
the knowledge base. That is the wrong semantics for a key named after
filtering, and on Yuque it is unusually damaging: the web UI does not show
documents created through the API that were never attached to the TOC, so a
knowledge base is often the only place such a document can be reached at all.
A filtered document is now recorded as seen but not ingested, so enabling the
filter removes nothing. It is deliberately kept out of the cursor so that
admitting it later — by attaching it to the TOC, or by switching the filter
off — ingests it instead of dismissing it as unchanged.

include_book_title is removed. Leaving the book segment out silently merges
same-named top-level groups from different books, and the "which book"
dimension has no other carrier: the automatic tag granularity is one tag per
data source, not one per book. Under folder_mode=toc the book segment is now
unconditional; a source still carrying the key keeps syncing with the value
ignored.

Also supplies the UI the feature was missing — a Yuque-only folder_mode select
in the sync-strategy step, with newly created sources opting into the TOC
layout and existing ones left untouched — and documents both settings in the
Yuque section of the datasource guide.

* feat(datasource/yuque): expose the TOC admission filter in the datasource editor

UI follow-ups from review.

The folder-layout control now uses the pill-button group that the neighbouring
sync-mode and conflict-strategy settings already use, instead of a select — a
two-way choice was the only thing on that step rendered as a dropdown.

toc_only is exposed beside it, disabled unless the TOC layout is selected: the
connector only fetches the table of contents under folder_mode=toc, so the flag
does nothing in the flat layout, and the control says so. Its label names the
documents it admits as the ones visible in the Yuque table of contents, which
is what separates them from documents created through the API that were never
attached to one.

Drops the include_book_title paragraph from the datasource guide. That key was
never in a released build, so describing it as removed documents a history no
reader has; the tolerance test for unknown settings keys stays, without the
retired-key framing.

* docs(datasource): note Yuque folder-mode sync limitations

---------

Co-authored-by: niannian <10008660+RichardChengshaojin@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:33:48 +08:00
Captain 1dd3fe867e
fix(docreader): drop data validation ranges openpyxl cannot parse instead of failing the sheet (#3599) (#3608)
* fix(docreader): drop data validation ranges openpyxl cannot parse instead of failing the sheet (#3599)

A Feishu sheet/bitable exported as .xlsx could fail to ingest with
"TypeError: expected <class 'openpyxl.worksheet.cell_range.MultiCellRange'>".
openpyxl reads a data validation's `sqref`, and a scenario list's, through a
converter that turns the real range-parse ValueError into that message and
aborts the whole workbook — in load_workbook (used by fill_merged_cells_xlsx)
and in pandas alike.

Measured on openpyxl 3.1.5, the version docreader locks: a whole column
(`C:C`), a whole row (`1:1`), a comma-separated list, `#REF!` and an
out-of-bounds range each raise it. Conditional formatting goes through the
same converter, but openpyxl already catches it there and drops the rule
with a warning, so it is left alone.

strip_unreadable_ranges_xlsx sits next to repair_xlsx_bytes and follows the
same contract: it returns rewritten bytes only when some range would fail
openpyxl's own MultiCellRange constructor — the exact step that raises — and
removes just those elements, logging how many. Every other workbook passes
through byte for byte. Neither element changes a cell's value, so dropping
one costs text extraction nothing, while keeping it cost the document.

* fix(docreader): strip unreadable ranges on the MarkItDown xlsx path too

MarkItDown reads spreadsheets through pandas/openpyxl, so a whole-column
data validation still failed that engine with FileConversionException
after the builtin engine was fixed (#3599). Run the same
strip_unreadable_ranges_xlsx pre-step before handing .xlsx to MarkItDown.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-25 22:29:27 +08:00
Fei.Chen a7ac21ce76
fix(docreader): sanitize non-conforming styles.xml fills before openpyxl loads (#3637) (#3638)
* fix(docreader): sanitize non-conforming styles.xml fills before openpyxl loads

openpyxl raises TypeError('expected ... Fill') on <fill> elements with no
patternFill/gradientFill child — cloud-doc exporters, LabView and Acumatica
ERP emit these, upstream treats the workbooks as non-conformant, and both
parse engines died on files Excel opens fine (#3637).

Extend the zip-level repair module with sanitize_xlsx_styles: scan
xl/styles.xml, replace each malformed fill in place with a no-op
patternFill (index-preserving, so cellXf fillId references stay valid),
rewrite the zip only when something needed fixing. The builtin chain
retries the merge-cell prefill once on sanitized bytes; the markitdown
chain sanitizes xlsx/xlsm before MarkItDown sees them. Fixes #3637.

* fix(docreader): log sanitized fill count and never raise from the sanitizer

Fold review feedback into the styles sanitizer: a structured log line on
every repair (count included, doubling as the recurrence meter for #3637,
mirroring the sharedStrings repair log) and a never-raise wrapper so an
internal sanitizer failure passes the original bytes through instead of
trading the caller's error for its own.

* fix(docreader): read the workbook stylesheet by its exact part name

The styles sanitizer picked its part with a suffix match over a set of
zip member names, so a workbook that also carries
xl/richData/richStyles.xml (Excel 365 in-cell images / data types) got
the wrong part on some PYTHONHASHSEED values and skipped the repair.
Read xl/styles.xml, the one stylesheet openpyxl loads.

---------

Co-authored-by: vicfei <vicfei@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-25 22:23:57 +08:00
jacentsao e7c27ccc9e
feat(confluence): add directory sync and private image assets (#3319)
* feat(confluence): support page subtree selection

* feat(confluence): add private image asset resolver

* fix(confluence): preserve pages during partial syncs

* fix(confluence): cap total inlined image bytes per page

Up to 30 images of 10 MB each could be inlined as base64, and every
downstream conversion copies the page again, so one extreme page could
peak above 1 GB. Cap the data URIs a page holds, in the download cache
and the rewritten HTML, at 50 MB; images past the budget keep their
original src like any other skipped image.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:23:48 +08:00
quan020406 a7fc9e13da
fix(client): accumulate multiline SSE data (#2122)
* fix(client): accumulate multiline SSE data

* fix(client): skip empty SSE data frames and clear lint findings

Accumulating data lines turned a bare "data:" frame into an empty JSON
payload that aborted the stream; the old parser skipped it. Skip frames
whose joined payload is empty. Also use strings.TrimPrefix in
appendSSEDataLine and check Fprint results / drop unused params in the
new streaming tests.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:23:38 +08:00
xiaojunxiang 0bf105499b
fix(knowledge): reject invalid JSON uploads before async parse (#3360)
* fix(knowledge): reject invalid JSON uploads before async parse

Validate .json payloads at HTTP upload/replace time with the same gate used
by the simple JSON reader, so JSONC or truncated files fail with HTTP 400
instead of after document-process retries. CreateKnowledgeFromFile itself
skips the gate so datasource sync and IM still create a knowledge row that
fails in async parse.

Signed-off-by: xiaojunxiang <xiaojunxiang@kingsoft.com>

* fix(knowledge): localize JSON upload validation messages

The upload queue shows the backend message verbatim and the rest of the
upload handler speaks Chinese. Map ValidateJSONContent's errors (now
sentinels with unchanged text, still shared with the async JSON reader)
to Chinese messages at the upload/replace boundary.

---------

Signed-off-by: xiaojunxiang <xiaojunxiang@kingsoft.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:23:27 +08:00
Perfecto 00e6366fd2
fix(datasource): validate cron schedules and persist manual-only mode (#3653)
* fix(datasource): preserve schedule state on invalid updates

* docs(datasource): document PUT /datasource/:id as a full replace

The update now always persists sync_schedule, so a partial body clears
the schedule. Show a full-object example and state that omitted fields
are reset rather than preserved.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-25 22:23:18 +08:00
DerrickLinus a9d71038b6
fix(models): stop advertising graded thinking levels the wire format drops (#3552)
* fix(models): stop advertising graded thinking levels the wire format drops

A generic-provider row (relays, self-hosted runtimes — the default for
uncatalogued models) resolves an empty ThinkingLevelMap, whose missing-key
semantics report every graded rung as supported. Capabilities() then hands
minimal/low/medium/high to the frontend, which renders a selector whose
choice applyThinking silently discards: the chat-template-kwargs branch
sends only the enable_thinking boolean and no reasoning_effort is computed.
Same defect class as the two NVIDIA NIM entries fixed in #3489, but there
is no catalog entry to repair here.

Collapse Capabilities() to the levels the wire can actually express for a
boolean-only switch (off/auto) unless the settings opt into
supports_reasoning_effort. The vendor map itself is untouched, so vendors
that do carry effort keep their ladders.

* fix(models): carry reasoning_effort through the chat-template switch when opted in

The Capabilities() guard kept a vendor's ladder when it opts into
supports_reasoning_effort, but applyThinking's chat-template-kwargs branch
wrote only the enable_thinking boolean and dropped the already-computed
effort — so the opt-in combination still sent byte-identical bodies for
every graded rung (#3551's defect, alive in exactly the shape the review
flagged). Mirror the enable_thinking dialect: write reasoning_effort on
top of the switch when one was computed. A golden case pins the opt-in
combination; the no-opt-in guard case keeps asserting the level is
dropped.

* style(models): wrap long Resolve call in thinking-levels test

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:23:08 +08:00
MercuialC c7601b2d2a
feat(wiki): 增加跨知识库 Wiki 搜索 POST /wiki-search (#3535)
* feat(wiki): add cross-KB wiki search POST /wiki-search

Give external callers a knowledge-search counterpart for wiki pages: one
SQL IN query ranked by title/slug/summary/content, slim hits with
match_snippet, and Viewer retrieve auth including shared KBs.

* fix(wiki): satisfy golangci-lint on cross-KB wiki search

Check c.Error returns, wrap lines over 120 columns, and use wikiDialect
instead of the embedded Dialector selector.

* fix(wiki): address review on cross-KB search helpers

Share KB viewer auth and snippet extraction, keep ID limits in the
service layer, and escape SQLite LIKE wildcards.

* fix(lint): wrap knowledge span fixtures over 120 columns

Go Lint still diffs from the original PR base, so later main tests
in knowledge_spans_test.go were reported as new line-length issues.

* fix(wiki): authorize KB access before checking wiki enablement in cross-KB search

Checking IsWikiEnabled before AuthorizeKBAccess let a caller tell apart a
foreign KB with wiki disabled (400) from one it cannot see (404), leaking
the KB's existence and settings. Run the access check first.

---------

Co-authored-by: root <root@localhost.localdomain>
Co-authored-by: wizardchen <wizardchen@tencent.com>
Co-authored-by: lyingbug <xiayula2014@gmail.com>
2026-09-25 22:22:58 +08:00
lyingbug 745a22d066
refactor(frontend): drop TTL resource caches and remove duplicate startup requests (#3562)
* refactor(frontend): drop TTL resource caches and remove duplicate startup requests

Space-level resource stores (chatResources / editorResources / organization)
cached lists for 60s. Pages that own the data bypassed the cache with force,
while side consumers (chat input bar, selectors) read stale values and relied
on a web of indirect refresh signals. Replace the TTL with in-flight
deduplication plus explicit invalidation:

- add stores/resourceCache.ts: createCachedResource (one request in flight
  per resource, force queues behind it, invalidate/markLoaded discard stale
  responses) and createKeyedSnapshotCache for per-id details
- rebuild chatResources / editorResources on those primitives; organization
  store drops its loadedAt timestamps and uses the request coordinator only
- isFresh -> isLoaded (only "has a snapshot" is meaningful now)

Fix concrete duplicates found on the way:

- /auth/me was fetched twice on every cold load (main.ts + UserMenu); auth
  store now dedupes in-flight calls and exposes ensureAuthMe, router hydrate
  reuses refreshFromAuthMe instead of a second copy of the persist logic
- /system/info was fetched by menu.vue directly next to editorResources
- /platform/settings rendered Settings.vue as the route component while the
  platform layout already mounts it, so two modals were visible and every
  settings panel request ran twice; the route now renders an empty view
- components that called listKnowledgeBases / listAgents / getParserEngines /
  getPromptTemplates directly now go through the stores
- Input-field no longer force-refreshes models and web-search providers on
  "settings closed" / "left settings route"; WebSearchSettings writes back to
  the shared snapshot and useTenantModelReadiness derives from the store

Measured with a mock backend: cold load 19 -> 18 requests (/auth/me once),
settings model panel 3 -> 2 (one modal), route changes now refetch lists
(creatChat 3 -> 9, back to KB list 0 -> 4) instead of serving 60s-old data.

* fix(frontend): fence stale responses in the resource caches and /auth/me refresh

Review follow-ups on the TTL removal:

- createKeyedSnapshotCache tracks a per-key revision; invalidate() and a
  force read both advance it, so a response that lands after invalidation
  or behind a newer request is handed to its caller but never written back
  into the snapshot. Previously a KB detail read still in flight during
  save could re-pin the pre-save detail until the next explicit invalidate.
- ensureKnowledgeBases / ensureAgents no longer reject when the shared
  resource fetch fails; the own list is already applied and the previous
  shared snapshot is kept. Callers migrated onto the store (manual editor,
  KB selector, FAQ manager, API integration page) had independent failure
  handling before. McpServerIntegrationSettings shows empty lists on
  failure instead of the last snapshot.
- /auth/me refresh is sequenced via a new createSequencedRefresh helper:
  refreshFromAuthMe() always resolves on a request issued after the call
  (queued behind an in-flight one), ensureAuthMe() shares in-flight, and
  logout() invalidates so a late response cannot re-apply the old session.

Tests: keyed cache invalidate-during-flight and force-overlap; sequencer
refresh ordering, invalidate after logout, and recovery after a failed
in-flight request.

* fix(frontend): refetch models after publishing a catalog change

invalidate() no longer triggers a refetch and the chat input stopped
reloading models when settings close, so the reasoning-level selector kept
stale capabilities after a catalog publish. Force-refresh the snapshot.
2026-09-25 22:22:48 +08:00
wizardchen 508048aee9 fix(frontend): mount the settings modal only once on /platform/settings
The platform shell always renders <Settings /> and opens it when the path is
/platform/settings, but the settings route also rendered Settings.vue into
the router outlet. Loading that URL mounted two independent modals: both
fetched their data, and a change saved in one left the other stale.

Keep the route for bookmarks, redirects and the close behaviour, but give it
a component that renders nothing.
2026-09-25 22:06:01 +08:00
wizardchen 22404e92b7 style(files): wrap long test case to satisfy lll 2026-09-25 21:46:12 +08:00
dafyy321-pixel 4668447aa6
fix(helm): pin application images to chart version (#3669)
Co-authored-by: dafyy321-pixel <dafyy321-pixel@users.noreply.github.com>
2026-09-25 18:52:02 +08:00
dvd233 0cb1e57fae
fix(container): propagate host project lookup errors (#3611) 2026-09-25 18:51:54 +08:00
诉说晚秋 d9444683da
docs(dev): 补充 Swagger 容器访问与空白页排查步骤 (#3620) 2026-09-25 18:48:29 +08:00
Zhengxu (Joshua) Jin 591f1c0e4f
docs: drop references to source files that no longer exist (#3631)
- 07-agent: the retrieved-image output requirement and
  internal/agent/image_requirement.go were removed in #3193; the
  Observe step no longer appends that message.
- 15-evaluation: internal/handler/dataset.go never existed; dataset
  loading lives in internal/application/service/dataset.go.
- 03-document-parsing: the proto generation script is
  docreader/scripts/generate_proto.sh (see docker/Dockerfile.docreader).
2026-09-25 18:48:20 +08:00
Jones 5c717ca045
fix(im): handle unresolved Feishu resource images (#2761)
* fix(im): handle unresolved Feishu resource images

* fix(im): degrade unresolved Feishu images to plain text

Feishu cards reject non-http(s) markdown links as well as invalid image
keys, so [alt](resource://…) can still fail the whole card update.
Match every ![]() target and keep only http(s) as a fallback link.

* test(im): cover Feishu summary stripping of resource images

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-25 18:48:12 +08:00
dzc-bit e5a301ed3a
fix(files): accept canonical storage:// paths in bare provider services (#3166)
Signed-off-by: dzc-bit <210145775+dzc-bit@users.noreply.github.com>
Co-authored-by: dzc-bit <210145775+dzc-bit@users.noreply.github.com>
2026-09-25 18:48:04 +08:00
linus-liu-web 6eb3cce164
fix(agent): 合并相邻 assistant 消息时保留 tool_calls,避免孤儿 tool 消息导致整轮 400 (#3574)
* fix(agent): 合并相邻 assistant 消息时保留 tool_calls

SanitizeMessages 合并相邻同 role 消息时只拼接 Content、丢掉了后一条的
ToolCalls;而紧随其后的 tool 消息是否保留,判断的是原始切片,于是保留下来的
tool 消息在请求体里找不到宿主 → OpenAI 兼容端点 400。400 不是 transient,管线
会降级到不带 tools 的总结调用,那一轮模型只能把工具调用写成正文(现象是
"模型输出了调用但页面没变")。

合并时把 ToolCalls 一并合并,并复制而非原地 append,避免与调用方的切片共享
底层数组。

Fixes #3569

* style(agent): 折行以符合 lll 的 120 字符上限

---------

Co-authored-by: linus-liu-web <11640009+linus-liu-web@users.noreply.github.com>
2026-09-25 18:47:55 +08:00
xxxxx 5614c04d88
fix(feishu): stop Wiki pagination on repeated page tokens (#3645) 2026-09-25 18:47:47 +08:00
诉说晚秋 605d70fc52
fix(notion): 在资源发现失败时中止增量同步 (#3682) 2026-09-25 18:47:38 +08:00
Captain 929dad5747
fix(weaviate): accept a class another worker created first (#3689)
The indexer saves embeddings in batches of 40, up to five at a time,
and every BatchSave calls ensureCollection first. On the first write at
a new dimension each of them can find the class missing and try to
create it. Weaviate lets one create win and refuses the rest with 422:
"class name X already exists" when the loser is filtered before the
Raft apply, or "updating schema: TYPE_ADD_CLASS: class already exists"
when it loses inside the apply. ensureCollection returned either as
"failed to create collection", and the errgroup then failed the whole
document although the class was fine. A replica racing this one takes
the same path.

After a 422, look the class up again and carry on if it exists now,
which does not depend on how the refusal is worded. The class is
created with all of its properties in one call, so there is nothing
left to set up. Other failures are returned as before.

This is the Weaviate side of the race #2855 reports for Qdrant.
2026-09-25 18:47:30 +08:00
wizardchen 27b0c84bfd fix(docparser): make the MinerU parse timeouts configurable
Self-hosted MinerU capped every parse at a hardcoded 1000s, which fired
before WEKNORA_DOCREADER_CALL_TIMEOUT and WEKNORA_DOCUMENT_PROCESS_TIMEOUT
could matter, so large PDFs always failed at 16m40s (#3091). MinerU Cloud
had the same problem with a hardcoded 600s polling deadline.

- WEKNORA_MINERU_TIMEOUT (default 1000s) bounds a self-hosted parse: the
  whole V1 job, or the legacy /file_parse request.
- WEKNORA_MINERU_CLOUD_TIMEOUT (default 600s) bounds how long a MinerU
  Cloud batch is polled.
- Both share the env parsing added for WEKNORA_PADDLEOCR_VL_TIMEOUT in
  #3537, now in helpers.go: invalid or non-positive values log a warning
  and fall back to the default.
2026-09-25 18:38:25 +08:00