Commit Graph

1609 Commits (1528fa64616be79c404cc8fa7bf57734e8af9712)

Author SHA1 Message Date
十三分之五六七 1528fa6461 fix(s3): disable optional checksums for compatible endpoints 2026-08-31 12:25:33 +08:00
十三分之五六七 786d67609d fix(markdown): sanitize invalid UTF-8 and NUL bytes 2026-08-31 12:24:35 +08:00
wizardchen 26d9552642 fix(skills): accept evaluated PEP 508 markers in the python verifier tests
CI's system Python has packaging, so a false environment marker is skipped
silently instead of reported as a note. The install must still succeed; only
the note is conditional on whether markers can be evaluated.
2026-08-31 12:02:38 +08:00
wizardchen faefceec15 fix(skills): verify installs by loadability and repair missing deps
The gate was answering the wrong question (every .py as isolated __main__),
and the installer derived dependencies from SKILL.md prose independently.
Align import prefixes with Python's path rules, keep the gate as the only
authority, and feed its findings back for one repair round.
2026-08-31 12:02:38 +08:00
wizardchen 4d78f9dc12 feat(agent): keep max completion tokens as default or a custom cap
Unset (0) now resolves at call time (2048 / 4096 / 24576 with sandbox) so the editor can offer Default vs Custom without silently rewriting a saved value.
2026-08-30 10:52:17 +08:00
wizardchen b419058abf fix(skills): map ClawHub @owner/slug to slug plus ownerHandle
ClawHub's download API keys by the skill slug alone. Sending
owner/slug as the slug query 404'd valid listings such as
@jixinyi546-maker/emar-ppt-skill.
2026-08-30 08:46:49 +08:00
wizardchen 21244d451a feat(agent): write workspace scripts and run them with installed skills
Generated PPT/report scripts overflowed the shell_exec command cap, and
session agents kept mutating the frozen skill tree or failing SkillHub
installs on display titles. Add write/edit sandbox tools, attach the
skill venv to /workspace scripts, and accept slug-based install names.
2026-08-29 22:45:18 +08:00
wizardchen 84a35993d2 fix(agent): let file tools read staged inputs without hanging empty skill tools
list/read sandbox tools were advertised for skills-off agents so they could inspect /workspace/input, but they still refused anything outside /workspace/output. Register shell_exec independently of the skills manager so a skills-enabled sandbox with no ready skill gets a shell without empty read_skill / execute_skill_script tools.
2026-08-29 00:26:27 +08:00
hailongzhao 252e97e7d6 fix(agent): decouple sandbox shell and file tools from installed skills
shell_exec was gated on "skills enabled AND a ready skill exists", so an
agent whose skills were still installing (or had none) never received a
shell. Since shell_exec can execute skill scripts, it now follows the
SkillsEnabled switch alone.

list_sandbox_files / read_sandbox_file are pure filesystem capabilities
and no longer follow SkillsEnabled at all: they are registered whenever
the sandbox advertises a SessionFileStore, including for the installer.
2026-08-29 00:26:27 +08:00
hailongzhao 3660d5f9a8 fix(sandbox): stage chat attachments by resolving their storage ref from the temporary document
MessageAttachment.URL is json:"-" so it never survives DB serialization,
but stageSessionAttachments depended on it to read the source file, which
silently dropped every attachment before it could be written into
/workspace/input.

Resolve the storage handle from the temporary_documents row keyed by
attachment.ID (GetScoped) when the URL is missing, and pass the session
tenant through staging so shared-agent sessions look up the right row.
2026-08-29 00:26:27 +08:00
JYao-Chen 2523dc7276
fix(wiki): prevent concurrent duplicate page identities (#2850)
* fix(wiki): prevent concurrent duplicate page identities

* fix(wiki): keep identity claims stable across LLM merges and Redis

Only exact same-title pages may overwrite a Redis identity claim. Successful
Redis reads now refresh the batch-local map so concurrent batches stay
aligned, citation slugs are reclaimed, and Reduce remaps onto the claimed
slug before locking.

* fix(wiki): batch identity lookups and harden claim convergence

Exact title resolution was one seq-scan per extracted item, and a dirty Redis claim could split concurrent workers. Batch the lookup, memoize it per batch, overwrite invalid claims, and keep remapped Item.Slug in sync.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-28 18:10:41 +08:00
Roovelrz 80e2f1806d
fix(im): handle WeCom 32-byte PKCS7 padding (#2848)
* fix(im): handle WeCom 32-byte PKCS7 padding

* fix(im): validate WeCom ciphertext length
2026-08-28 15:40:42 +08:00
wizardchen 5e1752b69a fix(skills): keep catalog bundles consistent and surface partial installs
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.
2026-08-28 15:17:37 +08:00
wizardchen cd3f8b4a9a feat(skills): store skills in a tenant catalog and install per sandbox
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.
2026-08-28 15:17:37 +08:00
wizardchen f79052fe67 fix(agent): keep skill-script stdout on failure for the model and UI
Failed execute_skill_script results were reduced to "exited with code 1" plus a retry hint, so the chat card hid the real stderr/stdout and the next model round could not correct arguments like a missing chart axis.
2026-08-28 15:05:42 +08:00
wizardchen 83d661af55 ui(sandbox): redesign personal sandbox secrets settings
Lead with skill credentials, hide empty inputs until edit, and rename the page to 沙箱密钥 so it is not mistaken for system env vars.
2026-08-27 16:55:09 +08:00
wizardchen d9b3ac3ab4 fix(sandbox): allow skills to declare WEKNORA_* credential env vars
The installer reserved the entire WEKNORA_ prefix, so names like
WEKNORA_API_KEY were dropped while install still succeeded. Reserve only
the sandbox-injected names (and WEKNORA_SKILL_*), and keep that list in
one place.
2026-08-27 16:55:09 +08:00
wizardchen 46faca4619 fix(sandbox): wait until Docker containers are running before exec
ContainerStart returning success does not mean State.Running, so the first
skill-install ExecCreate can 409. Wait for running after start, and retry
once if exec still races.
2026-08-27 16:55:09 +08:00
wizardchen e13eaca7e4 fix(sandbox): make skill env capture fill blanks only
Capture existed so a credential a user typed in chat survives the turn.
It also overwrote values already stored, inferred the skill from a path in
the command, and logged the command that carried the secret — so one
hallucinated `export KEY=test` could permanently replace a working key,
and the key ended up in the application log either way.

Capture now only fills a blank: a name the workspace or the caller has
already filled in is dropped before the write path sees it, the skill must
be named explicitly, and assignment values are masked in logs.

The path the error message advertised did not exist: a required variable
was refused before the call's own env was considered, so an IM user, who
has no settings page, could never get the skill to run. Values supplied by
the call now satisfy the requirement, and the message names the tool that
accepts them.

Also take envs out of the generic UpdateSkill. Every install-progress
write is a read-modify-write of the whole row, and the heartbeat reloads
it every 30 seconds, so carrying envs along could put a stale declaration
back over one just recorded. Encryption failures abort the write instead
of storing plaintext in a queryable JSONB column, matching TenantAPIKey.

Reverts an unrelated deletion of the no-volume-support warning.
2026-08-27 14:32:00 +08:00
hailongzhao 188200e3b1 feat(sandbox): inject per-user and workspace skill env vars at execution
Skills declare the environment variables they read at run time, so a
credential no longer has to be an admin-set value shared by everyone
using the same skill image.

The installer agent writes a declaration the server validates against the
bundle. Admins fill workspace-wide values from the skill drawer, members
fill their own under Settings, and a successful shell_exec captures the
declared names a run already used for the current speaker. Resolution is
keyed by Principal so IM callers do not collapse onto one synthetic
account, and values are injected only into the process of that one run.

Values are AES-GCM encrypted at rest and never returned by any endpoint.
2026-08-27 14:32:00 +08:00
sun 8486912b48
fix(i18n): 修复内置智能体名称与描述不随界面语言切换的问题 (#2828)
* fix(i18n): 修复内置智能体名称与描述不随界面语言切换的问题

问题现象:切换界面语言后,内置智能体的名称/描述仍显示旧语言,
需要强制刷新(Ctrl+F5)才能恢复正确语言。

35820ebb 已在 GetAgentByID / ListAgents 读取路径按请求语言重新本地化,
本提交补全剩余场景:

后端:
- 共享智能体读取(sharedAgentInfo / GetSharedAgentForTenant)与组织
  共享列表(ListOrgAgentShares)补 ApplyBuiltinAgentLocalization;
- IM 渠道列表(ListChannelsByTenant)改传请求 ctx,内置渠道的
  AgentName 按调用方语言从 YAML i18n 重新解析(DB 列可能为空或为
  落库时语言的残留值);
- 写入侧收敛:内置智能体配置落库时持久化 YAML default 语言的展示
  字段(GetBuiltinAgent 而非 GetBuiltinAgentWithContext,与 locale
  无关),更新/创建接口返回值再按调用方语言本地化,避免未覆盖的
  读取路径显示随机语言。

前端:
- utils/request.ts 导出 getCurrentLanguage;
- chatResources 的 agents 缓存与 orgStore 的 sharedAgents 缓存在
  新鲜度判断中加入"加载时语言 == 当前语言",切换语言后缓存立即
  失效,下次访问按新 Accept-Language 重新拉取并响应式更新。

* fix(i18n): 按请求发起时的语言给智能体缓存打戳,避免切换语言时命中旧数据

落地预取尚未返回就改界面语言时,原先会把 zh-CN 响应标成 en-US 新鲜缓存,最多冻 60s。in-flight 只复用同语言请求,写入前校验代际,并补共享/IM 本地化回归测试。

---------

Co-authored-by: asmh1989 <minhua.sun@velavigo.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-27 11:53:45 +08:00
wizardchen 2a20733682 fix(sandbox): pin Docker sessions so skill artifacts get collected
ArtifactCollector only drains /workspace/output from the pinned sandbox
config. Docker is session-persistent like Cube/E2B, but execution skipped
the pin, so generated HTML showed as unavailable after the turn.
2026-08-27 11:49:34 +08:00
wizardchen e7582cf538 fix(agent): stop using the chat model to rerank knowledge search
Dedicated rerank already scores the recall set; falling back to the
conversation model mixed RRF scores with [0,1] ratings and could
resurface documents the reranker had rejected.
2026-08-27 11:44:30 +08:00
wizardchen 6cc7a9e15b test(sandbox): drop TEST-NET DNS fixture from Cube tests
Use the same 8.8.8.8 nameserver already used by other Cube DNS tests instead of RFC 5737 documentation addresses.
2026-08-27 11:09:09 +08:00
lyingbug 270b64f6ec
feat(agent): preview skill artifacts and verify installs without running them (#2823)
* feat(agent): preview skill artifacts and verify installs without running them

Generated files open in the chat drawer with overlay/Esc returning to the
list, and install verification no longer executes guessed skill entry
points. A failed install can be retried from the saved archive.

* ui(chat): use a folder icon and corner count for skill artifacts

The eye and document glyphs read as preview or copy, and TDesign's
loading spinner sat beside the icon. A folder with a top-right count
matches the generated-files drawer without covering the toolbar action.

* feat(artifact): implement inline artifact references with previews

Add support for inline artifact references in Markdown, allowing generated files to be displayed as clickable cards. Implemented a new rendering mechanism for artifacts, enabling previews directly from the chat interface. Updated localization files for new inline preview hints and missing file messages. Introduced tests for artifact reference normalization and rendering logic.

* fix(client): document AgentResponseType constants for revive

Touching the const block made golangci-lint require comments on every
exported value. Match the rest of the SDK and describe artifacts_pending.

* fix(agent): wrap artifact-reference prompt lines for lll

Pre-push golangci-lint rejected the branch on three lines over 120
characters in the sandbox: reference guidance.

* fix(agent): scope HTML scripts and tighten install verification

Keep scripted HTML preview on skill artifacts only, recreate sandbox
workspace dirs after they are deleted, and treat nested skill files as
dependencies rather than first-party imports.

* refactor(artifact): enhance artifact reference handling and metadata

Updated artifact metadata to include a stable resource handle for better identification. Adjusted artifact reference resolution to support both handle and name forms, ensuring compatibility with existing references. Enhanced tests to validate the new handling logic and ensure proper rendering of artifacts in chat messages. Improved documentation for clarity on artifact reference formats and their usage in the system.
2026-08-27 10:30:32 +08:00
wizardchen 87d8e8a9b6 fix(agent): keep compacted sandbox streams in persisted history
shell_exec with display_type was collapsed to a one-line omit placeholder,
so the next turn and a history reload lost stdout/stderr. Keep a capped
copy of the streams in both Output and Data.
2026-08-26 20:16:02 +08:00
wizardchen 7fda02637c feat(sandbox): remove the Local host-process backend
Local was a host-subprocess fallback that skill install, snapshots, and
session sandboxes already excluded. Drop it so Cube, E2B, and Docker are
the only backends; leftover local configs can only be deleted.
2026-08-26 17:48:21 +08:00
wizardchen 58acd8b33c feat(api): honor resource_urls=public on hybrid-search
Single-KB retrieval was still returning resource:// handles even when
callers asked for public URLs, unlike knowledge-search.
2026-08-26 17:40:54 +08:00
wizardchen e7241e4d91 fix(sandbox): delete replaced templates only after persist succeeds
A building or unpersisted replacement left sibling configs pointing at
a deleted ID. Snapshot names now include a row token, and the settings
UI freezes retargeting while a skill install or remove is in flight.
2026-08-26 16:56:26 +08:00
wizardchen acac16d540 fix(sandbox): rebuild templates without dropping the live ID
Deleting the WeKnora template before its replacement was ready left
sessions targeting a missing ID, and freeze was per-config while rebuild
is cluster-scoped. Rebuild in place when possible, persist the new
template ID, refuse replace across siblings with skills, and name
snapshots by tenant and config on every backend.
2026-08-26 16:56:26 +08:00
wizardchen fb4a964ed5 fix(sandbox): drop unused ListSnapshots parameter in config tests 2026-08-26 16:56:26 +08:00
wizardchen c170854b89 feat(sandbox): pin Cube DNS on templates and freeze skill snapshot configs
Guest DNS only applies through the WeKnora template spec, and sessions
already on a skill snapshot would miss connection or rebuild changes.
Stop auto-creating templates, require explicit create/rebuild, and
refresh the settings card list when installs finish.
2026-08-26 16:56:26 +08:00
wizardchen f9a20b6bff feat(snapshot): introduce planned name for skill snapshots to identify abandoned builds
Added a new column `planned_name` to the `tenant_skill_snapshots` table to store the intended name of a snapshot before the provider call. This allows for the identification and reclamation of abandoned builds that may have left unreferenced snapshots due to process failures. Updated related functions to utilize this new field for better snapshot management and cleanup.
2026-08-26 16:56:26 +08:00
wizardchen ee9cf749f8 feat(sandbox): install skills on the Docker backend
Docker already ran session sandboxes, but skill install required snapshots
that only Cube and E2B advertised. Commit local skill images, boot sessions
from them, and show the skills step for Docker configs.
2026-08-26 16:56:26 +08:00
wizardchen 5e117afea0 feat(service): enhance skill file handling with caching and concurrent downloads
Implemented caching for skill bundle archives to reduce redundant downloads and improve performance. Added tests to ensure that listing and reading skill files coalesce concurrent downloads, ensuring efficient access to skill files. Introduced new functions for managing skill zip entries and improved error handling for missing files.
2026-08-25 20:27:26 +08:00
wizardchen ebfd5ef0fb feat(sandbox): browse installed skill files from settings
Read the stored skill bundle without booting a sandbox, and open a
resizable secondary drawer with a file tree and markdown preview.
2026-08-25 20:27:26 +08:00
wizardchen 19bcc9b532 fix(sandbox): hide Cube skill snapshots from the template catalog
Cube stores snapshots in the same template store as GET /templates, so
skill-image generations leaked into the settings picker. Subtract
ListSnapshots (and snap- IDs) so the step only offers base templates.
2026-08-25 19:11:41 +08:00
wizardchen 625f9db80a fix(sandbox): advertise only image skills and unstick installs
The host skills/preloaded tree is not what execute_skill_script finds
inside the sandbox, so stop merging it into the agent's advertised set.
Seed install files as a tar, publish transcript locators before the copy,
and wait in the UI instead of 404-polling.
2026-08-25 18:03:53 +08:00
wizardchen 94a2faf391 feat(chat): render shell_exec as a command and stream card
Give sandbox shell calls a display_type and keep stdout/stderr on the
live payload so the timeline can show the command, exit code, and
streams instead of the generic raw-output fallback.
2026-08-25 17:56:13 +08:00
wizardchen b6cfb34be6 docs(sandbox): clarify skill source requirements in installation process
Updated documentation across multiple files to specify that the `source` for skill installation must be explicitly defined as `@owner/slug` for ClawHub or a full URL for GitHub/SkillHub. Bare `owner/slug` is now rejected as ambiguous. This change enhances clarity for users regarding valid input formats and improves error handling in the installation process.
2026-08-25 15:47:48 +08:00
wizardchen 92fd75f54a refactor(sandbox): remove token requirement for skill installation from source
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.
2026-08-25 15:47:48 +08:00
wizardchen 260057b5f4 feat(sandbox): install skills from ClawHub, SkillHub, and git URLs
Paste a registry or GitHub link in the skill sandbox instead of only
uploading a zip. skillhub.cn pages resolve through api.skillhub.cn.
2026-08-25 15:47:48 +08:00
lyingbug b4128552b4
fix(sandbox): skip identical skill installs and prune old snapshots (#2791)
* fix(sandbox): skip identical skill installs and prune old snapshots

Re-uploading the same archive of a ready skill was still booting a billed sandbox and growing a new generation. Superceded snapshots also accumulated on the provider because the ledger never deleted them.

Skip the rebuild when the digest already matches a skill still in the live image, and let the reaper delete superseded provider snapshots after 24h while leaving extras not in the ledger untouched.

* fix(sandbox): retry stale same-zip installs and prune active leftovers

A re-upload of the same archive skipped every installing row, so a dead process could not recover until the reaper. Skip only recent in-flight runs, still refresh the stored bundle, and prune non-live active snapshots after retention.

* fix(sandbox): beat install liveness and guard the snapshot prune

A fixed window on the submission time cannot tell a slow install from a
dead one: a single agent command may take installCommandTimeout and an
install runs several of them, so a two-minute window called live runs
dead, reset their progress and pushed the reaper's own deadline out.
Stamp InstallingSince while the run works and read that instead, which
also stops the reaper from failing installs that are merely long.

Answer the skip question from the image only for a ready row. The ledger
records which skill a snapshot carries, not which archive, so a row
installing a new bundle would look finished from the previous bundle's
snapshot and report a success that never happened.

Prune now refuses to delete once the credentials no longer address the
account that built the image: the delete would come back not-found, and
the ledger would record another account's still-billed snapshots as
gone. It also waits for an eligible row before building a provider
client, since most configs have nothing to prune on most sweeps.
2026-08-25 15:46:29 +08:00
lyingbug 01ec6c0509
ui(sandbox): rename settings to skill sandbox and fix skill install (#2792)
* ui(sandbox): rename settings to code sandbox and simplify cards

"Sandbox backend" leaked implementation jargon into the settings nav.
Call the page what users configure — an isolated runtime for skill
scripts — and only surface incomplete-config warnings on the cards.

* fix(sandbox): type the card overflow menu options

vue-tsc rejected pushing a themed delete item onto an untyped options
array; name the option shape so the menu still marks delete as danger.

* fix(sandbox): keep the editor wizard moving into skills

Saving on the runtime step used to close the drawer when editing, so
step 4 was only reachable from the rail. Continue after save, move
full verification off the runtime form, and stop treating "using the
base template" as the empty value for every image field.

* fix(sandbox): store skill bundles on the workspace default backend

Skill install passed a stub tenant with no default storage, so saving
the zip failed with empty provider and the 500 hid the real cause.

* ui(sandbox): regroup skill install and rename to skill sandbox

Show install vs installed groups, fold long descriptions in the list,
and call the settings surface a skill sandbox.

* ui(sandbox): show skill install transcript in a compact popup

Keep the card from growing; the run opens beside the history button
with a capped height and its own scroll.

* ui(sandbox): show installed skills on config cards

Cube/E2B tiles now list skill names so the list reads as skill sandboxes; a click opens the editor on the skills step.

* ui(sandbox): show finished skill installs as static history

A completed run already has durable messages; replaying the event log would animate the whole install again. Hide chat answer actions in this transcript.

* style(frontend): enhance compact skill timeline display with improved font sizes

Updated the CSS for the compact skill timeline to adjust font sizes for various elements, ensuring better readability in the popup interface. This includes specific adjustments for embedded agent streams and markdown content.

* ui(sandbox): refactor header structure in SandboxConfigEditorDrawer and SettingDrawer

Updated the header structure in both SandboxConfigEditorDrawer and SettingDrawer components to improve layout and organization. Added a new slot for extra header content in SettingDrawer and adjusted CSS for better alignment and spacing in both components.

* ui(sandbox): enhance skill loading feedback and improve deep check logic

Updated the SandboxConfigEditorDrawer to refine the logic for deep checks based on the current step. Enhanced the SkillInstallTimeline component to manage in-flight live loops and provide better feedback for skill loading failures. Adjusted the SandboxSettings view to display error messages for failed skill loads, ensuring users are informed of any issues during the skill installation process.
2026-08-25 13:24:58 +08:00
nullptr-error 18d22b014b
feat(sandbox): expose tenant skill management over HTTP and in the console (#2789)
* 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>
2026-08-25 11:28:12 +08:00
wizardchen aa30ced85f fix(sandbox): apply gofumpt spacing in skill-install tests 2026-08-24 17:51:13 +08:00
wizardchen ad593652e8 fix(sandbox): satisfy pre-push lint on the skill install surface
Break long lines and add the missing constructor comment so the
maintainer push hook can reach the fork.
2026-08-24 17:51:13 +08:00
wizardchen 82ce97ba72 fix(sandbox): keep skill install from clobbering a newer owner
A queued remove or a failed older install could stamp or delete a row a
re-upload already claimed, and an empty MCPSelectionMode handed the root
installer every tenant MCP tool. Fail closed on those races, pin the
installer surface, and refuse a missing bundle or leftover zip files.
2026-08-24 17:51:13 +08:00
wizardchen 03755f11f7 fix(sandbox): harden tenant skill install against races and credential rotation
Abort a queued install if the skill row was removed or superseded, refuse to
restamp a snapshot with a rotated provider fingerprint, and honor the workspace
sandbox kill switch before creating a maintenance session.
2026-08-24 17:51:13 +08:00
hailongzhao 67cdf26216 feat(sandbox): add tenant skill install and remove service layer
Introduce the hidden skill-installer agent and TenantSkillService so a
sandbox config can install or remove skills into snapshot images under a
per-config lock, without yet exposing HTTP or UI entry points.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 17:51:13 +08:00