* 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>
* feat(sandbox): use a classic colored user@host prompt in the PTY
Cube, Docker, and E2B now share user@host:last-dir with WeKnora brand green, overriding E2B's default `\w $ ` prompt.
* fix(sandbox): redraw the PTY prompt after connect instead of waiting for Enter
Reattach does not replay bash's already-printed prompt, and FitAddon can clear the first paint. Fit before flushing output, then Ctrl-L if the screen is still empty.
* feat(sandbox): add Debian-style ll/la/l aliases in the interactive PTY
Interactive bash now gets colored ls/grep shortcuts; non-interactive skill scripts still see the real commands.
* fix(sandbox): restore conventional ls colors so directories stay blue
Map ANSI blue/cyan back to Tango colors so directories and executables are distinguishable; keep brand green only for user@host.
* fix(sandbox): correct runtime env-var hint to this config and create time
The copy claimed workspace-wide injection. Scope it to sandboxes created from this config, point per-run secrets to the Sandbox secrets page, and keep the hint off the add-button row so Chinese no longer wraps mid-word.
* feat(sandbox): attach a running session sandbox when the terminal opens
Opening the panel used to always show the start overlay. Lookup first so a running sandbox reconnects, while paused or missing sandboxes still wait for an explicit click and Connect cannot silently resume.
* fix(sandbox): do not inject PTY input or auto-connect a non-running sandbox
Empty-screen reconnect now SIGWINCHes so a reattached busy PTY is not fed
Ctrl-L. Lookup-only opens require a click unless List confirms running, and
closing the panel drops the terminal mount so a Files-tab reopen cannot attach.
---------
Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
* feat(stream): persist live-run markers and per-run steer queues
Mid-run sends need a cross-replica pointer to the generating
assistant and a control-plane list that never hits the SSE stream.
* feat(agent): inject queued user messages at ReAct round boundaries
The engine drains the steer sink after each round, persists accepted
rows, and delays Done until after a loop-end inject so the turn can continue.
* feat(session): expose /steer and hand leftover messages to a follow-up turn
Owner-scoped steer routes queue or inject into the live run, single-flight
AgentQA via the live-run marker, and history replay keeps multiple user rows
inside one turn.
* feat(frontend): queue mid-run messages while an agent turn streams
Stop and Send stay visible together, the overlay follows server delivery,
and history splits the transcript around injected user bubbles.
* fix(frontend): type pending and client_id on SteerQueueItem
vue-tsc failed because the overlay sets those fields while POST /steer is in flight.
* fix(session): harden steer persist, handoff, and new_run
Keep SetLiveRun ahead of SSE and roll back orphan turns, make inject
persist idempotent, append-then-delete on rebind, cap overrun rounds,
and stop aborting a live stream when /steer returns new_run.
* fix(session): satisfy pre-push lint on steer paths
Wrap long lines, check discarded Error/Emit results, and keep
context as the first argument so the fork push hook can pass.
---------
Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
BREAKING CHANGE: Updates that explicitly include usage_instructions must supply nonblank text of at most 16000 characters. Omitting the field preserves existing instructions; legacy descriptions remain readable.
* feat(mcp)!: persist tool catalogs and add guided configuration
* fix(mcp): write caller-owned catalogs and require a real tool sync
OAuth viewers can now persist their own directory, and the setup wizard no longer treats an unsynced service as complete. Missing catalogs auto-fetch on the tools step; already-used MCP functions are restored across engine turns.
* fix(mcp): skip redundant list_servers and tighten catalog UI
When the advertised server directory already fits in discover_mcp_tools, models should list_tools or describe directly. Chat and settings now show server names, collapsed docs, and initialize debug metadata for empty optional fields.
* fix(mcp): surface catalog summaries and polish tool detail UI
List responses now include a saved catalog count without live MCP calls, so settings cards and @ mentions can show sync state. Tool details open in a popup instead of expanding the row.
* fix(mcp): drop incomplete Anthropic calls and gate shared catalog refresh
Unclosed streamed tool_use was emitted as {} and executed. list_tools refresh=true now re-lists upstream instead of returning the saved snapshot, and only Admin (or MCP-capable API keys) can overwrite tenant-wide static-auth catalogs.
* fix(mcp): wrap client refresh path to satisfy lll
The metadata refresh URL made doRequest exceed the 120-character limit in the client module CI lint.
* docs: add English and bilingual product tours to READMEs
* docs: center product tour cover buttons and language labels
* docs: highlight skills memory and integrations on tour covers
* docs: stabilize product screenshots in narrated tours
* docs: host HD product tours as GitHub attachments
* docs: embed product tours inline and simplify captions
* fix(graph): feed OCR chunks to graph extraction instead of image-link placeholders
KnowledgePostProcessService.Handle gathered "text-like" chunks through
chunkService.ListChunksByKnowledgeID, which is text-only by design, so the
image_ocr / image_caption chunks written by multimodal parsing were never
returned. For a scanned PDF the text chunks contain nothing but markdown
image links, so graph extraction ran on empty input: most calls failed
with "unexpected end of JSON input" and the rest echoed the few-shot
example from the extract config into the graph.
- Fetch the exact chunk types the post-process enriches via
chunkRepo.ListChunksByKnowledgeIDAndTypes (text, image_ocr,
image_caption); the service now receives interfaces.ChunkRepository
through dig like knowledgeService already does
- Build a dedicated graphChunks list for graph extraction: skip
image_caption chunks (they duplicate the OCR text) and chunks that
contain only image links (chunkHasExtractableText)
- graphChunkCount, the enqueue loop and the log line use graphChunks;
summary, wiki, auto-tag and question generation keep using textChunks
- Tests: fake ChunkRepository in the wiki-enqueue test, table test for
chunkHasExtractableText
* fix(graph): skip figure OCR and harden empty-chunk detection
Reuse the CommonMark image scanner plus extractRealText so titles with
parentheses and <image> wrappers are not treated as prose. Only enqueue
OCR for graph extraction when the parent text chunk has no extractable
text, and skip link-only chunks for question generation as well.
* style(graph): wrap long post-process extract log line
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
* fix(mcp): require schema discovery before calls and render tool results
* fix(mcp): keep proxy identity until describe and localize embed results
Listing still cached the target, so skipped describe showed as an mcp_* failure instead of the proxy error. Embed chat also lacked the new MCP strings.
* feat(sandbox): stream interactive PTYs from Cube and E2B
Give session sandboxes a provider-neutral terminal capability so a later
WebSocket layer can attach without knowing Cube vs E2B. Long-lived
streams use a timeout-free client; idle terminals keep the sandbox alive
by refreshing TTL, and a workspace can set how long to wait before
disconnect.
* feat(session): bridge browser terminals to the session sandbox
Mint a short-lived ticket over a normal authenticated POST so the browser
WebSocket never puts the access JWT in the query string. After upgrade,
recheck the bound token, membership, and session ownership so logout or
revocation tears the PTY down. Provisioning stays opt-in: a GET
handshake only creates a sandbox when the client sends provision=1.
* feat(chat): add a sandbox terminal panel beside the conversation
Open a side panel with an xterm attached to the session sandbox. Starting
the terminal is an explicit click so merely opening the panel does not
create or resume a microVM; reconnects stay lookup-only until the user
confirms create-and-start. Persist the remote shell PID in
sessionStorage so a refresh reattaches instead of spawning an orphan.
* feat(sandbox): let workspaces set terminal idle disconnect
Expose the idle-disconnect duration in the sandbox config editor so an
operator can close unused terminals and let the provider TTL pause the
sandbox, instead of leaving PTYs open for the built-in 15 minutes.
* feat(chat): show generated files in the sandbox side panel
Move the per-message artifact list into the first tab of the right-hand panel so generated files stay in view with the terminal. Keep the old drawer only for embedded chat.
* fix(sandbox-terminal): keep tickets out of logs and live PTYs across refresh
Gin was copying the handshake JWT into response_body logs, silent access-token
rotation dropped open terminals as AUTH_REVOKED, and first-use provisioning
missed shared agents. Local echo now skips password prompts.
---------
Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
* refactor(resource-access): unify scoped authorization and transfer recovery
* fix(resource-access): close reparse and transfer review gaps
* fix: enforce explicit file bindings and recover move cleanup
* fix: align mutation admission and cleanup scope checks
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.
* 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.
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 (モデルに直接質問できます, お待ちください…)
* 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>