Commit Graph

278 Commits (de2dfd3034a7b506fa269910401bbdcbd4efc71d)

Author SHA1 Message Date
hailongzhao bccb4b151b fix(embed): 内嵌网页只传图片不输入文字时不再返回 400
内嵌网页的输入框允许只带图片或附件就点击发送,但 CreateKnowledgeQARequest.Query
带有 binding:"required",parseQARequest 也拒绝空 query,于是只传图片直接返回
400 "Query content cannot be empty"。

入口处理:去掉 binding:"required";文字为空但带有内联图片数据或内联附件时,
用 types.UploadOnlyQuestion 生成一句替用户提问的问题(中文界面为「请根据我
上传的内容回答。」,其他语言为英文),交给模型、检索、标题、会话历史索引、
追问建议和记忆使用。只有 URL 的图片不算上传,因为客户端传入的图片 URL 会被
清掉;预上传的 attachment_ids 也不算,这类文件在流开始后才解析,可能失败或
超时,届时模型没有任何内容可答。其余空 query 仍返回 400。

存储与显示:qaRequestContext 新增 userInput,保存用户消息时只存用户实际
输入,只传图片时为空,刷新后与发送当下显示一致;query 仍是给模型的问题。
steer 追问复制上一轮的请求上下文,显式设置 userInput,避免在只传图片的一轮
之后把追问存成空消息。

会话历史:文字为空但带图片或附件的用户消息,在两处历史重建里补上同一句
问题。知识问答流水线(loadAndProcessHistory)原先会整轮丢弃;Agent 历史
(LoadAgentHistory)原先会发出空的用户消息,被 SanitizeMessages 剔除后
前后两条回答被合并。

去掉 binding 标签会让 gofmt 重新对齐整个 CreateKnowledgeQARequest 的行尾
注释,这些既有的超长行因此会被 PR 的增量 lint 视为新增。按仓库惯例把字段
注释移到字段上一行(注释文字不变,swagger 描述不受影响),并把 Go 字段
KnowledgeIds 改名为 KnowledgeIDs(JSON 名仍是 knowledge_ids,接口不变)。

同步更新 swagger 文档,query 不再是必填字段。
2026-09-30 15:26:51 +08:00
lyingbug e896270c41
docs(readme): surface agent tools in the overview and condense feature tables (#3688)
* docs(readme): name skills, sandbox, browser and MCP in the overview

The overview only mentioned the built-in MCP Server; the agent's own
tools (skill sandboxes, the local browser, external MCP services) first
appeared far down in What's New and the feature tables.

Add an "Agent tools and execution" bullet to all four READMEs, and
update the Agent capability card (README artwork and the homepage it is
copied from) to mention the local browser, with concrete tags instead
of "tool calling / skills".

* docs(readme): condense the English feature and client tables

The four feature tables had 42 rows, many written as release notes
(removed backends, deprecated packages) or UI details, and repeated
what the overview, product tour and What's New already cover.

Replace them with a seven-row feature table linked to the docs and a
supported-backends table that keeps every compatibility list. Drop the
MCP Server subsection and the three client detail blocks, which repeat
the clients table, and shorten the v0.7.x entries in earlier releases.

* docs(readme): drop the v0.8.2 screenshot row

The three screenshots rendered at a third of the column width, too
small to read, and the local browser shot already appears in the
product tour.

* docs(readme): move the agent toolbox out of "beyond the three modes"

Skills, sandboxes, the local browser and MCP tools are part of the
agent mode, not something beside it. Describe them in a short paragraph
right under the capability cards and keep the list for platform
capabilities.

* docs(readme): condense the CN, JA and KO feature and client tables

Bring the translated READMEs to the same structure as the English one:
a seven-row feature table linked to the docs, a supported-backends table
with every compatibility list, no MCP Server subsection or client detail
blocks, and one-line v0.7.x entries.
2026-09-25 09:53:19 +08:00
lyingbug 44a1df6046
docs(readme): website-matched design for all four READMEs (#3679)
* docs(readme): match the product website's look and drop slogan copy

Add hero and capability-card artwork (English and Chinese, light and dark)
drawn in the website's palette, type and line icons, plus small gold table
icons; docs/images/readme/src/generate.py rebuilds them. The copy in the
artwork is the homepage's own.

Replace per-bullet emoji and slogan-style lead-ins with plain labels, drop
emoji from headings and captions, add the homepage's three ways to get
started and the v0.8.2 product shots, restyle the badges in the brand
colors, and give the client table real logos or consistent line icons.

* docs(readme): bring JA/KO in line and add feature spotlights

Rebuild README_JA.md and README_KO.md on the same structure as the English
and Chinese READMEs, keeping their existing translations. Add what they
were missing: CLI and Mini Program entries, the contribution validation
steps, knowledge graph, access control and security rows, Zhipu
embeddings and Tencent Cloud COS. README_KO keeps its usage scenarios.

Generate Japanese and Korean hero and capability artwork with
language-specific CJK fonts, so Japanese kanji do not fall back to
Chinese glyph forms and Hangul wraps at spaces.

Replace the flat screenshot grid with four spotlights (local browser,
skills and sandbox, automatic wiki, observability), each pairing two
real screenshots in window frames; the remaining shots move to a
two-column "more screenshots" grid. docs/images/readme/src/spotlights.py
rebuilds the spotlight images.

* docs(readme): keep the browser task preview visible in its spotlight

The browser-connection window sat in the bottom-right corner, right over
the in-chat task preview that the main screenshot is meant to show. Let
each spotlight pick the corner for its side window and put the browser
one bottom-left, over the session list instead.

* docs(readme): make spotlight images clickable and sharp when opened

GitHub links a bare <img> to the full image but leaves <picture> inert,
so the spotlights could not be opened. Wrap each one in a link to its
image, and write the spotlights at 3200x1800 so the screenshots are
readable at full size and crisp on high-density displays.

* docs(readme): add Q&A and toolbox spotlights, drop the leftover screenshots

Add two spotlights: quick Q&A beside smart reasoning, and the toolbox's
MCP service tools beside its skill catalog. They cover the Q&A and skill
catalog shots from the screenshot grid, so the grid and its remaining
chunk editing, folder tree and wiki revision shots go.

* docs(readme): redraw the architecture diagram and widen the hero highlights

Replace docs/images/architecture.png with a generated diagram in the
same visual language as the rest of the README (per language, light and
dark), drawn from website-docs/02-architecture: clients and channels
feed the Go app, where RAG Q&A, agent reasoning and auto wiki share one
knowledge pipeline over workspaces, the model catalog, the task queue
and tracing; the app calls docreader, sandboxes, model providers, web
search, external MCP services and data sources, and stores data in
PostgreSQL (ParadeDB), Redis and the optional vector, object, Neo4j and
Langfuse stores. The old PNG was only referenced by the READMEs.

The hero listed only the three core modes; show eight highlights
instead (adding the local browser, skills and sandbox, MCP Server,
long-term memory, and data sources and IM) so the first screen reflects
the product's range. The capability cards below still explain the three
core modes.
2026-09-24 20:16:55 +08:00
lyingbug 63ef76dd80
docs: 迁移有效文档至 website-docs 并清理旧文档 (#3580)
* docs: consolidate maintained documentation in website-docs

* docs: remove migrated legacy documentation and update remaining references
2026-09-22 23:25:40 +08:00
wizardchen 640e356e31 fix(browser): rebase BrowserSkill patches and use native session lifecycle 2026-09-20 00:09:50 +08:00
lyingbug 2a6a9c2517
fix(ui): 优化知识库文档交互与对话布局 (#3420)
* fix(knowledge): streamline document browsing and tag editing

* fix(chat): align panel headers and refine composer spacing
2026-09-19 11:58:49 +08:00
lyingbug 03d9d66a1f
feat(agent): size agent history by the window and calibrate token estimates (#3413)
* feat(agent): size agent history by the window and calibrate token estimates

Agent history was capped at history_turns (default 5) because compaction
could not survive a turn. With checkpoints persisted, load history by
tokens instead, and let compaction bound the session.

Budget. The loader drops the oldest turns that do not fit, and what it
drops is lost: neither replayed nor summarized. A budget equal to the
compaction threshold (the earlier attempt, since reverted) let the loader
trim first, so whenever one turn was larger than the system prompt plus
the new question the request never crossed the threshold; nothing was
summarized and the session became a sliding window with no checkpoint.
agent.HistoryTokenBudget is now the whole window: overflow reaches the
first round's compaction, which summarizes it into a new checkpoint.
A turn-by-turn regression test drives the real loader, budget and
compactor and fails as soon as a stored turn after the checkpoint is
missing from the loaded history; restoring the old budget fails it.

Summarizer input. History can now reach the window, so the part being
summarized can outgrow one request. An overflowing request degrades to a
raw archive that is never persisted, so every later turn would fail the
same way. Prepare keeps the newest messages that fit, the prompt states
how many were left out, and file paths still come from all of them.

Calibration. cl100k counts Chinese at about a token a character where
Qwen and DeepSeek spend about 0.6. The estimator now carries a scale
(clamped to 0.5-1.5, text only), learned from consecutive requests in a
turn: they share tools, system prompt and earlier messages, so the
provider's growth between them prices exactly the appended messages,
without mixing in how a provider renders tool schemas. The turn's scale
is stored on its usage (context_token_scale); the next turn's loader
prices history with it and hands it to the engine. Loading, the first
compaction check and compaction itself share one estimator, so they
agree; calibrating only the trigger would let the loader drop turns
again, which the regression test covers.

Also: history is priced as the engine sends it (redacted KB/Wiki results
cost one line); a checkpoint older than the rows read is matched by the
assistant rows' (created_at, id) order; a read ending on a turn's
question keeps that turn; a compaction discarded for freeing under 5%
still persists its checkpoint; a checkpoint write matching no row is an
error; a partial index backs the newest-checkpoint lookup. Agent mode no
longer reads history_turns: the field leaves AgentConfig, the editor
hides it in smart-reasoning mode, and quick-answer keeps its turn cap.

* fix(agent): address review of window-sized history loading

Summarization. The summarizer call had a fixed 60s total timeout. With
history loaded up to the window, a request could carry ~175k tokens and be
cut off while prefilling or writing normally; the degraded result left no
checkpoint, so the next turn reloaded the same history and failed the same
way. Summarization now streams and is cancelled only after no output for the
engine's stall timeout (120s by default, LLMCallTimeout overrides), with the
overall ceiling left to the transport, as for the engine's own rounds and as
in Codex and Pi. A stopped turn is not retried. When the summarizer still
fails, the raw archive is persisted as a checkpoint marked degraded so the
loop is broken, and the next compaction refines it as the previous summary.
The archive is held to the summary budget, newest messages first, so a
degraded compaction always frees room.

Loading. The loader priced turns as sent but returned and held them as
stored, so wiki pages stored in full and sent as one line could pile up in
memory. It now returns the as-sent history and releases each turn's stored
rows once replayed, keeping about a page of rows at a time.

Index. The partial checkpoint index is replaced by a composite
(session_id, created_at DESC, id DESC) index serving the backwards page,
the newest-checkpoint lookup and the recent-messages reads. It is built with
CREATE INDEX CONCURRENTLY so writes to messages are not blocked; the
migration holds that single statement, since a multi-statement query runs as
an implicit transaction. A PostgreSQL integration test, skipped without
WEKNORA_MIGRATION_TEST_POSTGRES_DSN, applies the chain, runs 000106 down and
up through golang-migrate, and checks both queries use the index without a
sort; the SQLite migration test checks the same plans.

Calibration. It no longer waits for a total token count, and a usage with
only a scale is persisted. A turn that measures nothing carries forward the
scale it started from, so the newest turn always has the latest one.
2026-09-18 22:51:31 +08:00
lyingbug 2be7bd4063
fix(agent): search bound knowledge bases before answering, and pass suggested-question origins (#3400)
* fix(agent): search bound knowledge bases before answering, and pass suggested-question origins

A user picked the suggested question "为什么在比较图形时需要谨慎处理?"
and the agent answered in round 1 with no tool call, claiming it had
searched the knowledge base and found nothing, then explained misleading
statistical charts. The question had been generated from "Corners Don't
Look Like That: Regarding Screenspace Ambient Occlusion" in a bound base,
where "comparing graphs" means SSAO falloff curves.

Two things let that happen: the grounding prompt said "Stable general
explanations need no lookup", and nothing told the agent where the
question came from - the base in question had no profile, only two
recent titles in the directory, and the click sent the text alone.

Prompt
- With knowledge tools available, search bound bases before answering a
  question about a topic, even one that reads like general knowledge;
  directory profiles and recent titles cannot prove a base lacks it.
- The general-explanation exemption applies only without bound bases.
- Say you searched or found nothing only when a search tool ran.

Question origin
- Suggested questions from FAQ/document chunks also return knowledge_id.
- Picking one on the home or chat page sends question_origin
  {knowledge_base_id, knowledge_id} with that question only.
- The service keeps the origin only when its base is inside the turn's
  resolved scope and the document belongs to that base; it never
  changes the scope (unlike knowledge_base_ids, which narrows it).
- The engine renders it in runtime_context as <question_origin> with the
  base and document handles and a note to search it before answering.

* fix(agent): keep question origins across file/tag scopes and bind them to the send

Review follow-up for the suggested-question origin.

- Scope check: the origin was kept only when its base was in the resolved
  KB list, which is empty for file-only and tag-only scopes even though
  their bases are searched. It is now checked against SearchTargets after
  they are built; the document is kept only when a target for that base
  covers it (unfiltered base, or a document scope listing it).
  resolveQuestionOriginInfo re-checks SearchTargets, looks up the name of
  a base that is not in kbInfos, and the renderer omits an unknown name.
- Frontend: the origin travelled through module-level "pending" state, so
  a send that returned early (agent not ready, upload in progress,
  steering) left it behind and a second pick overwrote it. It now rides
  with the one send: triggerSend(text, options) -> createSession ->
  send-msg -> sendMsg / changeFirstQuery.
- RetrieveKBOnlyWhenMentioned: suggestions are still generated from the
  agent's bases, but picking one retrieved nothing. The origin now
  selects its base, as an @mention would, when the agent may read it.
- API sync: question_origin in docs/api/chat.md and swagger;
  QuestionOrigin on the Go SDK's KnowledgeQARequest/AgentQARequest and
  knowledge_id on SuggestedQuestion.
2026-09-18 17:00:47 +08:00
lyingbug 76a19f14c4
feat(mcp): add built-in MCP server with per-workspace endpoints (#3371)
* feat(mcp): add built-in MCP server with per-workspace endpoints

WeKnora previously exposed itself to MCP clients only through the Python
package under mcp-server/, which binds one process to one API key and
therefore to one workspace, and mirrors the REST API tool-for-tool.

This adds a native MCP server surface to the Go backend:

- New mcp_endpoints table (PostgreSQL 000100, SQLite 000020). A workspace
  can publish any number of endpoints, each with its own bearer token
  (SHA-256 stored, rotatable, shown once), knowledge-base allowlist, tool
  allowlist, default agent and per-minute rate limit.
- Management API under /api/v1/mcp-endpoints (Viewer reads, Admin writes,
  API keys need manage_channels) plus a tool catalog endpoint.
- internal/mcpserver hosts one mcp-go Streamable HTTP server in stateless
  mode at /mcp/:endpoint_id. tools/list is filtered per endpoint and
  tools/call re-checks the allowlist, applies rate limiting and touches
  last_used_at. MCPEndpointAuth resolves the token and injects the
  workspace, an mcp_endpoint principal and an API-key style scope derived
  from the endpoint, so existing knowledge-base and capability checks
  apply unchanged.
- Redesigned tool set (12 tools in four groups): retrieval and reading
  reuse the agent's native tools; ask runs the default or a named agent
  synchronously and returns a cited answer with a session_id for
  follow-ups; wiki tools cover search, read and index; write tools are
  off by default. Knowledge bases accept ids or names.
- Frontend: new "MCP Server" integrations tab (tab id mcpserver, to
  avoid clashing with the existing MCP-client settings section) with
  endpoint cards, a create/edit drawer, a one-time token dialog and
  ready-to-paste snippets for Cursor/VS Code/Claude Desktop, Claude Code
  and mcp-remote. Locales updated in all five languages.
- Deployment capability integrations.mcpserver wired on both sides.
- Docs: website-docs MCP page now leads with the built-in server; the
  Python mcp-server README carries a deprecation notice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(mcp): wire the MCP server into DI/router and tighten authorization

The previous commit lost eight staged files to the repo pre-commit hook,
which resolves ROOT to the main checkout and re-adds the main-checkout
copies of tracked files into the worktree index. This commit restores them
(container providers, RouterParams and route registration, context key,
principal, clone table entry, deployment capability key, SQLite parity
test) and addresses the review findings:

- Knowledge-base scope is authorized, not trusted: endpoint allowlists and
  every tool call resolve each knowledge base through access.ResolveKB for
  the calling principal (ownership or organization share). Foreign IDs are
  rejected on create/update and dropped at call time.
- Write tools mint explicit editor grants via access.KBAccess.WithGrant
  before calling the knowledge service, so add/update/delete go through the
  same RequireKBWrite path as the REST API. add_document also checks the
  grant itself.
- ask no longer accepts agent_id. It runs only the endpoint's configured
  agent; tenant-owned agents and user-facing builtins qualify, internal
  builtins (wiki fixer, skill installer) are refused both on save and at
  call time. Web search is forced off for MCP calls.
- Tool annotations match behaviour: ask is not read-only, add_document is
  a mutation.
- CORS allows MCP-Protocol-Version / Mcp-Session-Id / Last-Event-ID and
  exposes Mcp-Session-Id for browser-based MCP clients.
- Rate limiter runs its local cleanup goroutine; SQLite migration gains the
  deleted_at index for parity with PostgreSQL; non-ASCII endpoint names get
  unique mcpServers keys derived from the endpoint id.
- Swagger annotations on the management handler.
- Tests: KB isolation (service and server), write grants, endpoint-agent
  restriction, tool annotations, and a router test that mounts the public
  /mcp/:endpoint_id surface and checks the deployment capability.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(mcp): renumber migrations after rebase onto main

main took 000100 / 000020 for chunks_index_diet, so the mcp_endpoints
migrations move to 000101 (PostgreSQL) and 000021 (SQLite); the SQLite
parity test and docs follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(mcp): run document tools under the knowledge base owner tenant

Shared knowledge bases resolved through access.ResolveKB were only half
usable: documents of an organization-shared knowledge base are stored under
the owner tenant, so the document-level tools that queried by the calling
tenant found nothing, and add_document would have created rows under the
caller's tenant inside someone else's knowledge base.

- knowledgeInScope loads documents tenant-agnostically and then requires
  the document to belong to an allowed knowledge base and to that base's
  tenant.
- scopedKBContext replaces grantContext: it resolves the grant, switches
  the execution tenant to the knowledge base owner (KBAccess.Context) and
  swaps TenantInfo to the owner so storage/model settings resolve there.
  list_documents, read_document and every write tool run under it.
- Locale text and docs no longer claim clients can pass agent_id.
- Go SDK gains MCP endpoint methods (client/mcp_endpoint.go) with docs, and
  the Swagger artifacts are regenerated.
- Tests: shared knowledge base read/write under the owner tenant, spoofed
  document tenant rejected, viewer share cannot write.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* chore(mcp): renumber migrations after rebase onto main

main now carries 000101 / 000021 (knowledge_profiles), so the
mcp_endpoints migrations move to 000102 (PostgreSQL) and 000022 (SQLite);
the SQLite parity test expects version 22 and the docs follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(mcp): guard last_used touch without a repository and wrap SDK line

The transport tests build the server without a repository; the background
last_used_at write then dereferenced a nil interface and, on the slower CI
runner, took the test binary down. touchLastUsed now returns early when no
repository is wired, and the tests inject a recording repository and assert
the touch instead. Also wraps a 123-column SDK signature for the client
module's lll check.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 22:40:05 +08:00
wizardchen fa56b5b932 fix(docker): upgrade ParadeDB for CPUs without AVX2 2026-09-17 17:17:04 +08:00
wizardchen 559ad532ae refactor(frontend): consolidate knowledge tag filters and remove stale styles 2026-09-17 16:46:27 +08:00
wizardchen 820a14dafa refactor(datasource): share connector filename sanitization 2026-09-17 16:18:52 +08:00
wizardchen 10973ed321 test: isolate fork reset Git environment 2026-09-17 15:51:51 +08:00
wizardchen 38be45c9d1 refactor: remove unused private Go helpers 2026-09-17 15:51:51 +08:00
wizardchen d645334d08 refactor(frontend): share citation popover lifecycle 2026-09-17 15:28:31 +08:00
serply e80f5dfbc7 feat(web-search): add Serply provider
Serply returns Google results through a keyed JSON API, which fills the
gap between Google Custom Search (needs an engine ID and a restricted
scope) and the scrapers. The adapter follows brave.go: hardcoded
endpoint, redirects refused so the key never leaves the official host,
4MB response cap, and per-call country and freshness filters. country
maps to Google's gl parameter and pd/pw/pm/py map to tbs qdr:d/w/m/y.
Serply has no date-range filter, so that form returns an error instead
of being silently dropped. num is clamped to 10 because the API serves
one results page per call.

Wiring matches the Bocha provider: type constant and metadata, registry
factory, service validation, frontend union, swagger enum entries (edited
by hand; a full swag regen drags in unrelated drift), and the web search
docs table.
2026-09-17 12:25:09 +08:00
wizardchen 84c9871d16 fix(browser): align BrowserSkill 0.3.0 and repair task lifecycle 2026-09-17 11:54:12 +08:00
wizardchen f2606629b3 refactor(frontend): share skill install progress subscriptions 2026-09-16 23:12:14 +08:00
wizardchen 5bcc43d728 refactor(frontend): share skill installer model configuration 2026-09-16 20:58:03 +08:00
wizardchen bfa7f0ed69 refactor(frontend): remove unused components and share tag selection logic 2026-09-16 20:49:16 +08:00
lyingbug d7ccd5ba51
fix: align client sessions and integration request handling (#3305)
* fix: align client sessions and integration request handling

* fix: preserve trusted Doris redirects and prepare browser tests

* fix: align proxy address checks and integration test coverage
2026-09-16 16:20:57 +08:00
ttommybot a7d3545297
feat(knowledge): add batch file downloads (#3300)
* 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>
2026-09-16 15:40:10 +08:00
lyingbug 06e8022476
feat(website): add product homepage and unified docs deployment (#3297)
* 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
2026-09-16 11:58:37 +08:00
nullptr-error 6ccc5cedf1
feat(sandbox): add a graphical desktop to session sandboxes (#3245) 2026-09-14 20:37:37 +08:00
DEMO 5d3114fc9e
feat(datasource): add DingTalk Docs integration with safe sync and localization (#2313)
* feat(datasource): add DingTalk Docs integration

* fix(datasource): harden DingTalk sync and complete translations

* fix(datasource): close DingTalk review gaps in sync and rendering

Prefer millisecond node timestamps, keep full-sync deletion reconciliation, and stop dropping official block payloads so incremental updates and Markdown import stay complete.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-14 19:53:29 +08:00
hujiaxin fc2c12e8ec fix(models): protect auto-tag model references 2026-09-14 19:29:19 +08:00
Jonesxq 350b2ab364
fix(milvus): support multilingual BM25 retrieval (#3235)
* 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>
2026-09-14 19:18:24 +08:00
wizardchen 801ae18f91 fix(embed): enforce host origin allowlists on framed pages 2026-09-14 18:03:57 +08:00
lyingbug fd7fa6a7d4
fix(memory): preserve extraction progress and atomic memory updates (#3224)
* fix(memory): preserve extraction progress and atomic memory updates

* fix(memory): bound extraction failures and persist indexed session progress
2026-09-13 00:04:16 +08:00
wizardchen 462999ec3f feat(browser): add picture-in-picture task preview 2026-09-12 11:11:36 +08:00
lyingbug 3910cfb117
fix(browser): complete task cancellation, screenshots, and result display (#3206) 2026-09-12 09:32:26 +08:00
wizardchen 081851c6b8 fix(browser): support human handoffs and resume interrupted tasks 2026-09-11 23:56:13 +08:00
lyingbug 7a98a8e3de
feat(browser): polish connection settings, open tasks in a new window, and streamline prompts (#3193)
* 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.
2026-09-11 21:28:58 +08:00
lyingbug 7e53c31671
feat(browser): connect local Chrome with task controls and display modes (#3180)
* feat(browser): integrate BrowserSkill local task tabs and account pairing

* feat(browser): refine task routing, lifecycle, and display modes

* fix(browser): reclaim temporary task tabs and groups

* test(database): cover browser authorization migration schema
2026-09-11 17:59:27 +08:00
lyingbug 72581cb462 Revert "feat(sandbox): add safe live file management to session sandboxes (#3…"
This reverts commit 01205b3d56.
2026-09-11 17:42:08 +08:00
DEMO 01205b3d56
feat(sandbox): add safe live file management to session sandboxes (#3181)
* 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>
2026-09-11 17:31:53 +08:00
langcaiye 5db13a131e
feat(faq): filter entries by enabled status (#3157)
* docs: design FAQ enabled-status filter

* feat(faq): filter entries by enabled status

* test(faq): cover disabled list filtering

* docs(faq): publish enabled filter contract
2026-09-10 14:42:59 +08:00
wizardchen 5cf093706e fix(chat): preserve steering continuity and composer focus 2026-09-09 20:15:23 +08:00
lyingbug 85b76d1a30
feat(mcp)!: persist tool catalogs and add guided configuration (#3118)
* 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.
2026-09-09 13:34:56 +08:00
lyingbug 4d95cd4581
fix(mcp): require schema discovery before calls and render tool results (#3113)
* 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.
2026-09-08 19:15:13 +08:00
wizardchen 694f0413dd refactor(agent): discover and invoke MCP tools on demand 2026-09-08 12:01:36 +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
MidoriKurage c591f16d53 refactor(system): drop idempotent flag from create-user response body 2026-09-07 17:30:47 +08:00
nullptr-error 524deeaad5
feat(sandbox): run sandboxed execs as root by default (#3067)
* feat(sandbox): run sandboxed execs as root by default

Every chat session owns its own sandbox, so the in-container account is
not a tenant boundary and root is the least surprising default for an
agent that installs packages and writes wherever it needs. Host and
cross-tenant isolation stay at the container boundary.

DefaultSandboxExecUser becomes "root" (remote_client.go) and the sandbox
image ends with USER root. The three backends keep naming the account
explicitly on every exec so the account a call lands on does not depend
on which backend a workspace selected; the adapter default, the file
operations and the artifact-directory bootstrap all follow the constant.
The template still provisions a uid 1000 "user" account for interop with
E2B/Cube tooling that addresses it by name.

Root also makes the skill-install flow's account hand-over pointless, so
it goes: verification no longer runs after a chown/chmod lock-down and a
repair round no longer reopens the tree (normalizeSkillPermissions and
reopenSkillDirForRepair are gone), and the prepare and scratch commands
stop chowning. The scratch wipe now also clears /tmp, and the cache
budget guard sizes only root's caches, since no second account can grow
one. Verification is asserted to stay on the ordinary executor (no
AsRoot, no AllowSkillsRoot) rather than on which account it ran as.

* refactor(skills): install chat-time extras into the skill's own env

PYTHONPATH / NODE_PATH pointed at a per-session overlay
(/workspace/.skill-packages/<skill>) because the skill tree was frozen
after install: root-owned, mode 555, and often built by `uv venv` with no
pip, so `pip install --target` somewhere else was the only way a chat
session could add a package.

None of that holds now. The lock-down is gone and execs run as root, so a
missing package goes straight into the skill's own environment, and the
write is already session-local: a chat sandbox is built from the config's
image and its filesystem dies with the session, so nothing reaches the
image other sessions start from. The overlay bought nothing over that
while splitting one skill's packages across two locations.

SessionSkillPackageDir goes, and applySessionPackagePath becomes
applySkillNodePath: it appends the skill's own node_modules after
whatever the caller supplied, replacing a `+=` that prepended a bare
separator once the overlay stopped seeding the variable. No PYTHONPATH is
injected at all. Python dependencies are reached through the skill's venv
interpreter, which the shell wrapper already puts first on PATH; the
overlay-era value named the venv root, which is not an importable path.
PYTHONPATH stays on the injected-name blacklist so a stored value cannot
shadow the venv.

The runtime hints and every prompt that described the overlay now name
`<skillDir>/.venv/bin/python -m pip install` and `npm install` in the
skill directory. frozenSkillTreeGuidance / isFrozenSkillVenvFailure are
renamed for what they detect now that nothing is frozen.

* docs(prompts): reserve /workspace/output for finished deliverables

/workspace/output is the one directory an artifact collector reads, so
everything written there is offered to the user as a deliverable. The
prompts described it as the place for "deliverables" or "downloadable
artifacts" without saying it is exclusively that, which reads as "the
directory you write results to" — and a model doing multi-step work has
results at every step. Drafts, intermediate renders and debug dumps land
next to the finished file and the user is handed all of them.

The four places that describe the workspace now say the same thing: the
collector reads only /workspace/output, so finished deliverables go there
and everything in progress goes anywhere else under /workspace. The
attachment block gains the matching half for the other direction —
/workspace/input holds the user's own files and is not ours to write to,
which it previously implied by calling the paths "read-only inputs" while
the tools that enforce it say so plainly.

Only the /workspace/input half is enforced (write_sandbox_file refuses
that tree). Whether a file is finished is a judgement no tool can make,
so the output half stays guidance and is stated wherever the model is
already reading about the workspace rather than in one place it might
not see.

* fix(skills): restore executable bundles and package recovery

* style(sandbox): wrap prompt text for repository lint checks

* fix(sandbox): guard recovery paths and document root execution

---------

Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-07 13:03:35 +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
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
wizardchen 1edcd54b43 docs: refresh v0.8.0 showcase screenshots and drop star-history
Lead the README gallery with real skill-sandbox conversation shots, and remove the star-history embed while GitHub star data is unavailable.
2026-09-03 14:46:44 +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