* feat(knowledge): add batch file downloads
* fix(knowledge): harden batch file downloads
Skip entries without original files, keep folder paths in the ZIP, map
client cancel to 400, and cap concurrent archives so a full-select
download is usable without 500s or disk pile-up.
* fix(knowledge): format batch-download tests for pre-push lint
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
Queued ProcessDocument tasks still held the old FilePath, and a crash
between the source UPDATE and reparse could leave completed knowledge
pointing at a new file. Dequeue first, flip pending in the same write,
and skip stale worker Saves when the stored path has moved.
Add KnowledgeService.ReplaceKnowledgeFile, which replaces the stored
source file of an existing file knowledge while preserving its knowledge
ID, then re-parses it through ReparseKnowledge. It is groundwork for the
local folder data source (#2873); no existing API, handler or connector
behavior changes.
Object storage is not transactional, so the steps are ordered to keep the
row pointing at an existing file: save the new file, update the source
columns in one UPDATE, reparse, and only then delete the old file. A
failed column update discards the new file; a failed reparse restores the
previous source columns (marked failed, since cleanup may already have
removed the old index) and discards the new file. The row is re-read
before a replacement file is deleted, so a write that committed despite
reporting an error never leaves the knowledge referencing a deleted file.
Identical content under the same name and folder is not re-parsed: changed
metadata is persisted and a DuplicateKnowledgeError is returned, matching
CreateKnowledgeFromFile's duplicate contract. Metadata is merged so
entries such as process overrides survive, and stored overrides are
re-validated against the new file type.
* feat(datasource): add Confluence sync
* fix(confluence): resume full sync and list Server pages without CQL
CQL search silently truncates large spaces and can delete pages that
dropped out of the index. Full-sync checkpoints now keep a deletion
baseline so Asynq retries continue instead of restarting.
* fix(confluence): satisfy package lint for pre-push against main
* fix(confluence): parse Server page lists and keep version expand
The default Server/DC edition unmarshaled /content/page as a nested
envelope, so sync imported zero pages. Pagination next links also drop
expand=version,space, which made later pages versionless and hid edits.
* fix(confluence): classify errors and fail closed on empty listings
Raw Confluence error bodies were copied into sync-log UI, and pagination
next links could leave the configured context path via `..`. Empty
listings against a non-empty baseline now abort instead of deleting.
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
* feat(website): add product homepage and unified docs deployment
* fix(website): build the unified site in a multi-stage Docker image
* fix(website): reveal and highlight the active documentation sidebar item
* fix(storage): use virtual-hosted addressing for OBS bucket requests
Huawei Cloud OBS has rejected path-style bucket addressing on domain
endpoints since 2023-12-30, so PutObject failed with 404 NoSuchKey while
HeadBucket still passed. The driver also pinned HostnameImmutable=true
via a deprecated custom endpoint resolver, which blocked the SDK from
injecting the bucket label into the hostname.
- Replace the custom resolver with BaseEndpoint and enable
virtual-hosted style for domain endpoints; keep path-style as a
defensive fallback for IP-literal or unparseable endpoints.
- Align checksum negotiation with the S3 driver
(RequestChecksumCalculation: WhenRequired).
- GetFileURL now emits {bucket}.{endpoint-host}/{key} URLs when no
proxy domain is configured, mirroring the client addressing.
- Share one obsS3Options constructor between the file service and the
connectivity check, and add obs_test.go (previously zero coverage).
Closes#3269
* test(storage): assert OBS PutObject hits virtual-hosted URLs
UsePathStyle=false is not sufficient — a HostnameImmutable resolver can still force path-style. Capture the signed request host/path so this cannot regress the way #3272 would have.
* test(storage): keep OBS client tests within lint limits
The new-from-rev pre-push lint also flags the original obs_test.go lines. Wrap long fatals and silence the deprecated EndpointResolver assertion so the fork push can run hooks.
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
parseYuqueConfig and parseIMAConfig validate DefaultBaseURL through
ValidateConnectorBaseURL, which resolves the host with net.LookupIP.
Their TestMain only whitelists loopback, so the config tests fail on
any machine where www.yuque.com or ima.qq.com resolves to a restricted
address (a local DNS sinkhole, for example), and the result depends on
the network the tests happen to run on.
Whitelist the default host as well, which is what the feishu tests
already do for open.feishu.cn.
The chart never rendered MAX_FILE_SIZE_MB, so a Helm install was pinned
to the image default of 50 MB with no supported way to raise it for the
frontend (nginx client_max_body_size) and docreader (gRPC message limit)
together. Add global.maxFileSizeMB, default 50 as in docker-compose, and
render it into the app, frontend and docreader containers.
create_knowledge_from_file never sent fileName, so MCP uploads always
landed in the knowledge-base root even though the backend has accepted
path-qualified names (folder_path + display name) since v0.7.2.
list_knowledge also dropped folder_path / folder_scope query params that
the REST list endpoint already supports.
Fixes#3173
* fix: clean up wiki data when deleting knowledge base
ProcessKBDelete async task cleaned up vector indices, chunks, files,
graph data and knowledge rows, but left wiki data untouched because
knowledgeBaseService had no wiki repository dependency. Add four
KB-scoped delete methods to WikiPageRepository and invoke them at the
end of ProcessKBDelete: soft-delete wiki_pages/wiki_folders/
wiki_page_issues (they carry DeletedAt), hard-delete wiki_page_revisions
(no DeletedAt column — immutable snapshots).
* fix: scope wiki KB cleanup by tenant and run it on every delete path
Wiki rows do not depend on the vector engine, so ProcessKBDelete now
cleans them in a defer (including SkipRetry). Deletes are keyed by
tenant_id plus knowledge_base_id so a tampered queue payload cannot
wipe another tenant's wiki.
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
analyzeResponse emitted EventAgentFinalAnswer with Done=true before
returning emptyContent=true to the retry loop, so every empty natural
stop produced a premature terminal answer event while the agent was
still running. Consumers that finalize on Done=true (e.g. the IM
channel, which closes its answer-done channel and then only waits a
bounded time for EventAgentComplete) can lock in a fallback and cancel
the still-running agent when the nudged retry is slower than that
window (#2906).
An empty natural stop now emits nothing — the verdict alone tells the
caller the round is retryable. When retries are exhausted, the loop
emits the selected fallback as the turn's sole terminal answer, so a
turn always ends with exactly one terminal answer event.
Regression tests cover all three shapes: the empty verdict emits no
answer events; empty-then-answer ends with exactly one terminal event
carrying the real answer; all-empty runs end with exactly one terminal
event carrying the fallback (each red on the pre-fix code).
McpServiceDialog.vue already calls t() for OAuth form labels and toasts,
but those keys were never added to the locale bundles. Non-Chinese UIs
fell back to the hardcoded Chinese defaults (Scopes, Authorization Status,
Unauthorized, Authorize, Re-authorize, Revoke, and related toasts).
Add the missing mcpServiceDialog OAuth keys and OAuth toast messages for
zh-CN, en-US, ja-JP, ko-KR, and ru-RU so the Authentication section
localizes with the rest of the settings UI.
Fixes#3182
* fix(agent): PUT no longer erases the avatar, and driver errors stay server-side
Two defects in the custom-agent API, both of which surface as a successful or
misleading response.
1. A config-only PUT wiped the avatar.
UpdateAgentRequest.Avatar was a plain string, so "field omitted" and
"explicit clear" were indistinguishable, and UpdateAgent assigned it
unconditionally. Any caller that updated only the config — which is what
an edit form or an SDK client does when it sends the config it changed —
silently zeroed the avatar and still received 200.
Avatar now travels as *string end to end: nil keeps the stored value, a
pointer to "" is an explicit clear. The service takes it as a separate
argument because *types.CustomAgent cannot express the difference.
2. Raw repository/driver errors reached the client.
The fallback branches forwarded err.Error() verbatim, so a postgres
message — for example "ERROR: value too long for type character
varying(64) (SQLSTATE 22001)" — was returned in the API response. That
leaks schema details and tells the caller nothing actionable. Each
fallback now returns a fixed message naming the operation; the full error
is still logged immediately above, so nothing is lost for diagnosis.
The same oversized-avatar case is now rejected earlier, by ValidateAvatar,
as a 400 that names the varchar(64) limit instead of a 500 produced by the
database.
Typed sentinels and *errors.AppError keep their existing behaviour — only the
untyped fallbacks changed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(agent): complete avatar preservation and regression coverage
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
* fix(milvus): support multilingual BM25 retrieval
* fix(milvus): preserve source metric and tighten collection matching
Read the source embedding index metric during BM25 migration, match
collections by {prefix}_{dimension}, and route Japanese/Korean text to
the ICU fallback.
* fix(milvus): satisfy lint on multilingual BM25 changes
---------
Co-authored-by: Jonesxq <239089032+Jonesxq@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
Long-term memory chose its candidates before it looked at the question.
Recall listed 400 items by `importance DESC, valid_from DESC`, loaded the
vectors belonging to that list, and scored those; extraction did the same
with a 200-item pool. Importance is uncorrelated with relevance, so the
vector stage could only re-order what importance had already picked, and a
memory below the cut was unreachable no matter how well it matched. The
capacity cap goes up to 2000, so everything past the 400th most important
memory was permanently unrecallable, and `memory_item_embeddings.vector`
being a BYTEA blob meant pgvector was never involved.
The store now answers "which of this person's memories is this question
about":
- Migration 000095 (and the SQLite mirror) add `embedding halfvec` plus a
`(tenant_id, subject_id, model_id, dims)` index. The column is
conditional on the vector extension, so a deployment whose retrieval
driver excludes postgres keeps working. No HNSW: an approximate index is
filtered after the fact, and one subject holds at most a couple of
thousand rows, so exact ordering inside the scope is both correct and a
few milliseconds.
- `SearchItemsByVector` ranks in SQL over every vector the subject has,
with the status, expiry and kind filters joined in so reaching past the
candidate list cannot reach past the filters. SQLite and pgvector-less
PostgreSQL fall back to scoring in process, still over the whole scope.
- Recall fuses the lexical ranking with those hits and grows the candidate
pool with matches the pool did not hold, which is what lets the search
escape it. The lexical pool is now the capacity cap, so it can no longer
be a second, invisible limit under the one that decides what stays active.
- Extraction picks the memories it shows the model the same way. This
matters more than recall: the memory a new statement contradicts is not
reliably an important one, so an importance-ordered window hid exactly
the collision that stops a duplicate being written.
- Vectors are written to the searchable column in the upsert's transaction;
rows predating the column are moved by `SyncVectorColumn` during
maintenance, which costs no model calls. The embedding backfill goes from
50 to 200 per run — at 50, a subject at the capacity cap took over a
month to become fully searchable.
- Traces and logs report `outside_pool`, the number of semantic matches the
lexical pool did not contain. It was structurally zero before, so it is
the number to watch when asking whether semantic recall does anything.
Tests cover whole-scope ranking, the lifecycle and kind filters, pool
growth, the pool-size invariant, and extraction seeing a low-importance
memory it would otherwise duplicate. A pgvector integration test
(WEKNORA_MEMORY_TEST_POSTGRES_DSN) exercises the migration, the halfvec
write, the SQL ranking and the column sync.
StartChildSpan records sandbox housekeeping only when a parent trace already exists, and skill install/remove/maintenance open that boundary themselves.
* feat(browser): enhance BrowserIcon component and update localization strings
- Updated BrowserIcon component to accept dynamic width and height props.
- Revised localization strings in English, Japanese, Korean, Russian, and Chinese for improved clarity and user guidance regarding browser connection and usage instructions.
- Enhanced BrowserConnectionSettings view with better structure and user feedback elements.
* Default BrowserSkill tasks to a separate window
* refactor(prompts): streamline agent system prompts and context templates
- Updated agent system prompts to enhance clarity and specificity in user interactions.
- Revised context templates to better separate metadata and user requests, improving overall structure.
- Adjusted fallback and intent prompts to ensure consistent language handling and response requirements.
- Introduced new localization strings for browser search instructions across multiple languages.
- Added tests for agent prompt serialization and hydration to ensure template integrity and functionality.
* chore: wrap prompt strings to satisfy golangci-lint
Keep the settings, separate-window, and prompt commits pushable together
without rewriting their history.
* fix(frontend): match agent editor save test to serialized payload
The prompt-inheritance save path still closes after update; the test
should assert that payload, not the unsanitized form object.
* feat(browser): implement browser connection management and related tests
- Introduced a new `browserConnection` store to manage the state of browser connections, including online status and device information.
- Updated the `Input-field` component to handle browser connection states, enabling/disabling features based on the connection status.
- Added tests for the `browserConnection` store to ensure correct behavior under various scenarios.
- Enhanced the `Input-field` and `BrowserConnectionSettings` components to provide user feedback based on the browser connection state.
- Adjusted related components and views to integrate the new browser connection logic, improving overall user experience.
* fix(frontend): update model-save assertion for serialized agent payload
The agent editor still persists the selected model ID via a spread of
formData; the source test should match that payload, not the raw form.
The agent engine derives every tool's execution ctx from a blanket 60s
budget (toolExecutionTimeout), so MCP calls on services configured with a
longer advanced_config.timeout were silently cancelled mid-flight even
though the MCP transport layers honor that value (internal/mcp/client.go,
manager.go). The configuration was partially applied without any signal.
Re-derive the CallTool window from ApprovalCtx (the round-level parent
without the per-tool deadline) using the service timeout when it extends
the engine window. Widening-only by design: services without an explicit
longer timeout keep today's behavior, and shorter values stay enforced
where they already apply (HTTP transport timeout).
Fixes#3135
* feat(sandbox): add safe live file management to session sandboxes
* fix(sandbox): keep live files from waking paused sandboxes
Serialize directory entries as "directory", refuse Files-tab Connect on paused runtimes, and cap list/delete trees so oversized workspaces fail closed.
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>