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.
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.
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.
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.
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.
* ui(agent): merge skills and sandbox into one editor tab
Skills and the sandbox they run in belong together, so the agent editor now shows one Skills section with sandbox selection driving the available list.
* fix(frontend): type selected skill names when pruning
vue-tsc could not infer the selected_skills filter callback after JSON-cloned form state.
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.
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.
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.
Replace TDesign's brand-pink badge with the same secondary-container
count used by settings lists so the download control matches the
surrounding ghost icon buttons.
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.
Replace the outline download pill and generic attachment icons with the
same header badge, muted file glyphs, and text icon button used by the
settings drawer and knowledge file rows.
Clicking most settings sidebar items left the URL on
?section=system-global, so the route watcher snapped the panel back.
Write ?section=<navKey> for every page, including integration-claw,
and keep old ?tab= bookmarks as aliases.
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.
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.
* 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.
* 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.
* 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>
The Agent Editor hides the whole Conversation Settings group when the
running mode is smart-reasoning, but the agent path reads history_turns
from that group: session_agent_qa.go hands it to LoadAgentHistory, which
keeps only the newest N turns and drops the rest. An agent created through
the editor therefore runs on the server default of 5 turns, and the loss is
invisible because the UI renders the full conversation straight from the
messages table.
The gate was correct when it was added. Until 1f5970b6 the agent path
deliberately skipped the limit -- "we don't apply HistoryTurns limit here.
HistoryTurns is used in normal (KnowledgeQA) mode" -- and that refactor made
the value live for agent mode without the frontend following.
Ungate the section, the nav entry and the mode-switch redirect. Keep the
multi_turn_enabled switch hidden, though: EnsureDefaults pins it to true for
smart-reasoning, so an editable switch would silently revert on save. The
turns input carries an extra `|| isAgentMode` because a new agent defaults to
smart-reasoning with multi_turn_enabled=false in the form, which would
otherwise hide the input in exactly the case this change is about.
Raise the turns cap from 20 to 100. Twenty rounds sits two orders of
magnitude below the 200k-token context budget the engine already manages
(with LLM consolidation at half that), so the round cap always bites first
and the summariser rarely gets to run. The server does not validate this
field, so the widget was the only limit.
Surface retain_retrieval_history as well. It is read only by the agent path
(internal/agent/observe.go) and had no widget at all, leaving the API as the
only way to reach it -- builtin-wiki-fixer is the sole preset that turns it
on. It rewrites the history of the eight KB and Wiki tools only, so it is
shown when the agent has a knowledge base.
The section description advertises query rewriting, which agent mode does not
show, so it now branches per mode.
* fix: stop markdown table regex catastrophic backtracking
The line_pattern in MarkdownTableUtil used overlapping character classes
([\t ]* and [^|\r\n]*) so a `|`-prefixed line missing its trailing `|`
forced the engine to explore an exponential number of backtracking paths,
stalling the single-threaded docreader gRPC event loop (100% CPU, health
check timeout).
Replace whole-text regex substitution with an O(n) line-based pass that
only treats rows beginning and ending with `|` as tables, and preserves
the previous align_pattern semantics via _is_alignment_row.
Fixes#2768
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: keep lone pipe rows and normalize CRLF in table formatter
A single "|" was rewritten into an empty table row and then dropped.
Unify CR/LF before the line scan so exported Markdown tables format
without mixed endings.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
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.
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.
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>
The settings form rebuilds the payload without skill_image, so merge
must ignore client values or a save would drop the snapshot (and a
crafted PUT could plant one). Also reject skill names that escape
the image root and require SupportsSnapshots on the snapshot manager.
Give Cube/E2B a shared snapshot API and persist skill image pointers so later session sandboxes can inherit installed skills from a config snapshot instead of the base template.
Co-authored-by: Cursor <cursoragent@cursor.com>
to_pil() shares the BGRA buffer; dropping the PdfBitmap before convert
use-after-frees. Copy pixels first, keep opaque RGB/L modes, and log when
render=True falls back to the raw (mask-blind) decode.
get_bitmap() decodes only the base image plane and ignores any /SMask
(soft transparency mask). Figures exported from plotting tools often
store their visible content in the mask while the base RGB plane is
black, so extraction produced all-black JPEGs for such images.
Decode embedded figures via get_bitmap(render=True), which renders
through pdfium's imaging pipeline and carries the mask as an alpha
channel, then composite over white (JPEG has no alpha; PDF pages render
on white). Falls back to the raw decode when rendering is unavailable.
On a production PDF with 7 SMask figures, dark-pixel ratio drops from
~100% to 0.7%-4.5%. Opaque images are unchanged.
Accumulate token usage across every LLM round of an agent turn and
expose the aggregate everywhere a turn is observable:
- AgentState.TurnUsage accumulates each round's reported usage,
including the final-answer synthesis call; TokenUsage.Accumulate
keeps the cache counters as prompt subsets and recomputes the
combined cache status (unsupported survives only while every call
was itself unsupported).
- The agent completion event carries the aggregate, and the complete
stream event exposes it both as data.usage and as a typed
StreamEvent.Usage that buildStreamResponse promotes into the
previously-unused StreamResponse.Usage wire field.
- The assistant message persists it as a nullable usage column on
both migration targets (postgres 000085 jsonb, sqlite 000012 text),
for web and IM channels alike, so history reads still carry the
turn's cost after the live stream is gone.
- "[LLM Usage]" log lines gain ", session_id=..., principal=type:id"
when the context carries them; calls outside sessions stay
byte-identical.
Usage from failed retry attempts is not accumulated: the per-call
usage log remains the ground truth, while the turn aggregate serves
as the operational signal.
GORM hydrates default:true back onto the struct during Create, so the HTTP
201 body (and a later Update on the same pointer) could disagree with the
row just written.