* feat(assistant): let the assistant manage agents
Expose custom agents to the operation catalog (list, get, create, copy,
update, delete) plus read-only model and MCP service lookups, so the
assistant can set up agents end to end.
- Add PATCH /api/v1/agents/:id. PUT replaces the whole config, so a
one-field change from the assistant would wipe the rest; PATCH only
overlays the fields it carries and reuses the PUT validation path.
- Add x-agent-detail so long fields such as the system prompt are only
projected for single-object reads, not lists.
- Add label_param so a create without a target is labelled by its name.
- The approval card lists agent setting changes and resolves model,
knowledge base and MCP IDs to names.
- Deny sharing, publishing channels, credentials and OAuth routes; model
and MCP endpoints, headers and secrets are never projected.
- Update the assistant prompt, starters, API docs and Go SDK.
* feat(assistant): list skills and configure agent skill scope
- Expose usable skill names for an agent sandbox without exposing skill
administration or connection settings to the model.
- Validate PATCH selections against the workspace sandbox usable set so
invented names and missing sandbox selections cannot be saved.
- Show skill changes in approvals and align the assistant prompt, API
documentation, and Go SDK with focused refusal and projection tests.
* feat(assistant): isolate conversation history
- Keep assistant conversations out of ordinary session lists, search, artifacts and delete-all cleanup.
- Add private, paginated assistant history with session switching, confirmed deletion and stale-session recovery.
- Backfill session kinds safely on Postgres and SQLite, preserve kinds on forks, and align API docs and SDK coverage.
* feat(assistant): refresh pages after successful data changes
- Carry decoded mutation targets through live tool-result events without
exposing refresh metadata to the model or persisted chat history.
- Coalesce page and selector refreshes, update document drawers, and warn
about changed agents while preserving open editor drafts.
- Cover mutation, approval, stream, lifecycle and cache behavior with Go
and Node tests using the existing frontend runner and component fixtures.
* feat(assistant): add agent page context and resource scope limits
- Attach verified agent context and persist personal scope across turns and approvals.
- Enforce resource boundaries before operation and Wiki approvals, including edited arguments.
- Add scope controls, translations, API and SDK support, and regression coverage.
* refactor(assistant): remove the scope limit
The scope picker confused users and duplicated what RBAC and the access
level already enforce. Keep the agent page context: the agent editor
still publishes agent_id and the backend still verifies it.
* feat(assistant): render operation and product-doc results
Show find/run operations and WeKnora docs as structured cards instead of raw JSON.
* feat(assistant): default new agents to smart-reasoning
Quick-answer cannot call MCP, and agent.update could not change the mode. New agents now start in smart-reasoning, and a patch can switch agent_mode.
* fix: resolve assistant management CI failures
* docs(swagger): add shared response envelope types
* docs(swagger): type knowledge base responses
* docs(swagger): add concrete response body types
* docs(swagger): type chunk list responses
* docs(swagger): type knowledge mutation responses
* docs(swagger): type wiki search and autofix responses
* docs(swagger): type FAQ responses
* docs(swagger): type tag responses
* docs(swagger): type message responses and SSE schemas
* docs(swagger): type agent responses
* docs(swagger): type remaining handler responses
* docs(swagger): regenerate OpenAPI spec
* docs(swagger): type knowledge, activity and wiki maintenance endpoints
Covers the endpoints left out of the earlier passes: knowledge base
detail, document list/detail/spans/reparse/cancel/delete, knowledge
base activity and the Wiki stats, issues, lint and rebuild-links
endpoints. The spans handler now writes the documented structs instead
of gin.H, so the schema cannot drift from the body; the JSON is
unchanged. List filters gain their real enums and bounds, including
the finalizing, cancelled and deleting parse states.
* docs(swagger): document JSON-valued fields as JSON, not byte arrays
types.JSON and json.RawMessage are byte slices, so swag rendered every
metadata, details and config field as an array of integers. A swag
overrides file documents them as objects; the four fields that hold
arrays (relation chunk ids, allowed origins, image refs) say so with a
swaggertype tag.
* chore(lint): exempt swag annotation lines from the line-length limit
swag reads each @Param, @Success and @Failure as a single line, so an
enum list or a composed response type cannot be wrapped to fit.
* chore(lint): exempt struct tags carrying swag attributes from the line limit
Struct tags cannot wrap either; a field documented with swaggertype or
extensions keeps its tags on the declaration line.
Running `make docs` on main no longer reproduces the committed docs/*:
every definition loses its package-qualified name (types.* instead of
github_com_Tencent_WeKnora_internal_types.*), enums disappear, ErrorCode
becomes a plain integer, and docs/swagger_contract_test.go fails
(TestModelDeleteUsageContract).
Cause: internal/localsandbox is not a dependency of cmd/server (its
importers are behind the `desktop` build tag), but swag's directory walk
reaches it. Its `const X = core.X` aliases make swag load
internal/localsandbox/core again through go/loader, and that second load
re-registers every already-deduplicated type under its short name without
enum values. Excluding the directory removes the second load.
That load was also hiding a second problem: skill_handler.go references
errors.AppError in @Failure without importing internal/errors, so with the
exclude swag stops with "cannot find type definition: errors.AppError".
A blank import lets swag resolve it.
Co-authored-by: Victor Maznyuk <victor@maznyuk.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(agent): scope the @Skill and @MCP pickers to the agent that will run
Both pickers listed the caller's own workspace, but a shared agent invokes its
OWNER's skills and MCP services. The two never line up, so for every shared
agent:
* @Skill was always empty, in every skills mode. GET /skills resolves the
sandbox config with (tenant, id), and the agent's config id does not exist
in the borrower's workspace - effectiveTenantSkills short-circuits before
it reads a single skill row. The response still reported
skills_available: true, so the category appeared with nothing under it.
* @MCP in "selected" mode was empty for the same reason: the preset holds the
owner's service ids, which match nothing in the borrower's catalog.
* @MCP in "all" mode was worse than empty. isMCPAllowedByAgent returns true
for every enabled service, so the picker offered the BORROWER's own
services; resolvePerRequestMCPScope then intersected the mention against
the agent's preset, found nothing, and dropped it with only a warning.
Resolve the agent when the request carries agent_id + agent_source_tenant_id
and read its resources where they live. Only an explicit source workspace takes
the share path, so an own-agent request is byte-for-byte unchanged; built-in
agent ids exist in every workspace, and falling back to a share lookup without
one would let an org member take over the caller's default agent, exactly as
session.Handler.resolveAgent already documents.
Both endpoints serve only what the agent can actually invoke:
* skills: the sandbox config comes from the agent, never from the query, so a
borrower cannot name another config in the owner's workspace and enumerate
it; "selected" narrows to the configured names and a disabled picker never
reaches the owner's inventory at all.
* MCP: the agent's explicit preset and nothing else, because that is exactly
what resolvePerRequestMCPScope accepts for a shared agent. "all" therefore
offers nothing rather than offering services every mention would drop.
Whether "all" should become mentionable is a separate decision about that
guard, not about the picker.
The cross-workspace MCP rows use a narrowed response built field by field.
NewMCPServiceResponse reveals endpoint URL, headers, env vars and stdio command
to an Admin, and a borrower can be an Admin of their own workspace - that shape
must be narrow by construction, not by role.
On the client the two lists now follow the selected agent: their cache keys
carry it, and the chat input refetches on a switch behind a request token, so a
slow response for the agent the user just left cannot overwrite the picker with
another workspace's services.
* fix(agent): check the c.Error return on the shared-agent picker paths
golangci-lint judges pull requests on the lines they introduce, so the
repository's older bare c.Error calls are grandfathered while these three are
not. Match the _ = c.Error form already used in mcp_service.go.
Stop treating a failed sandbox as a full success, avoid writing a SHA
when the catalog archive is missing, and pick the newest stored fork
on migrate so files and chips match the catalog users actually see.
A skill is a workspace definition, not a sandbox setting. Keep one catalog
row and run a full image install for each backend, so agents only enable
skills that are already ready on the sandbox they use.
Updated the skill installation process to eliminate the need for a token when installing skills from ClawHub, SkillHub, or Git URLs. The source must now be readable anonymously, ensuring that no credentials are sent during the fetch process. Adjusted related documentation and UI components to reflect this change, enhancing the user experience by simplifying the installation workflow.
* feat(sandbox): enhance skill management in sandbox configurations
Updated the skill management system to allow listing, installing, and removing skills within sandbox configurations. The ListSkills function now accepts a sandboxConfigID to filter skills based on the selected configuration. Introduced a new SandboxSkillsDrawer component for managing skills through the UI, along with necessary updates to the API and localization files to support these features.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: keep skill maintenance sessions out of the console session list
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: store and expose the installer transcript locators
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: record the skill installer agent's conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: stream and persist the installer transcript during a skill install
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: expose install transcript locators on the skill type
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: add the floating skill install transcript window
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: open the install transcript from the sandbox skills drawer
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(sandbox): 重构技能安装体验,支持内联时间线、编辑第4步及保留镜像指针
- 替换右下角浮窗为内联安装时间线 (SkillInstallTimeline.vue)
- 新增 GET /api/v1/sandbox-configs/:id/skills/:skillId/transcript 接口,支持回放与追尾
- 移除 /sessions/continue-stream 依赖,避免 404 问题
- 事件日志以 install_prompt 开头,不再将工具调用 preamble 拼入最终答案
- 删除 SkillInstallTranscript.vue,技能条目下可展开/折叠时间线
- 编辑向导新增第 4 步「管理技能」
- Cube/E2B 环境:连接 → 模板 → 运行配置 → 技能(第4步)
- Docker/Local 环境:无第4步(无快照镜像)
- 首次创建必须按 1→2→3 顺序,第3步保存成功后自动进入第4步
- 已有配置支持步骤条数字跳转,可直接访问任意步骤
- 卡片菜单「管理技能」打开同一抽屉并定位至第4步
- SandboxSkillsDrawer.vue 重命名为 SandboxSkillsPanel.vue,去除独立抽屉壳
- 修复保存运行配置时冲掉 skill_image 的问题
- 顶部展示信息(基础模板/快照ID/版本/构建时间)读取 config.skill_image
- 编辑器保存 payload 不再包含 skill_image,合并时保留已有 SkillImage 和 VolumeMount
- MergeSandboxConfigForUpdate 增加对 SkillImage 和 VolumeMount 的保护
- 已冲掉的配置需重新安装技能才能恢复镜像指针
- 「查看安装过程」在安装开始时即显示
- 技能列表中出现「正在安装」状态即展示按钮
- 若记录尚未写入,展示等待提示并自动重试,避免误报「没有留下记录」
* 沙盒内技能目录从 UUID 改成 SKILL.md 的 name。
* fix(sandbox): heal stuck skill rows and block planted maintenance sessions
The reaper left a mid-upgrade install spinning forever when the old snapshot was still live, and restored removals to ready after the pointer had already moved. Client session create/update can no longer hide chats behind the skill_maintenance: prefix.
* style: gofumpt the skill reaper test stubs
* style: satisfy golangci on the tenant skill admin API
* feat(sandbox): rebuild skill images at turn boundaries, not mid-exec
Hold a session turn lease through AgentQA so an install cannot tear down
the live sandbox between tool calls; the next turn's first resolve picks
up the new image. Configs can instead keep existing sandboxes and boot
the new snapshot only for new sessions.
* fix(sandbox): judge stuck skill runs from the snapshot chain
InstalledSnapshotID only records the generation that installed a skill; later
installs of other skills advance the live pointer without rewriting older rows.
Comparing those IDs made the reaper fail healthy installs and delete live
skills whose removal had stalled.
---------
Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
- Added container name for the sandbox service in both docker-compose.dev.yml and docker-compose.yml.
- Changed the profile from 'sandbox' to 'full' for the sandbox service, enhancing its integration within the application.
- Added logging for skill availability and sandbox mode in the skill handler, improving debugging capabilities.
- Updated .env.example to set default sandbox mode to 'docker' and added timeout and docker image variables.
- Modified docker-compose files to include a sandbox service for building and pulling the sandbox image.
- Adjusted frontend API to reflect sandbox availability for skills, ensuring UI elements are conditionally displayed based on sandbox status.
- Implemented backend logic to disable skills when the sandbox is not enabled, improving error handling and user experience.