Skip to content

Releases: xuzhougeng/agent-control

v0.9.1

Choose a tag to compare

@github-actions github-actions released this 11 May 11:32

Full Changelog: v0.9.0...v0.9.1

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 11 May 08:37

v0.9.0 — REPL escapes: !/!! shell, @<path> file attach, :use <skill> skill pin

This release rounds out the cc-agent REPL with three prefix-based escapes for mid-session operator workflows. Each prefix binds to one domain with explicit LLM-visibility semantics.

New REPL prefixes

!cmd / !!cmd — shell escape

Run a shell command directly from the REPL without round-tripping through the LLM.

  • !cmd — run, stream output, LLM does NOT see it (mid-session git status / ls with no LLM turn)
  • !!cmd — same, plus buffer (cmd, output) to fold into the next user message
  • 60s timeout, 16 KiB capture cap, ESC cancels (SIGKILLs the whole process group so wedged sleeps die)
  • Skips the destructive-command approver — the operator is hand-typing

@<path> — file attach (NEW)

Attach a file's contents to a user turn without copy-pasting.

  • @<path> — buffer the file for the next turn (like !!)
  • @<path> <text> — attach + use <text> as the prompt; fires immediately
  • 256 KiB cap with …(+N more bytes, truncated) marker
  • UTF-8 binary detection on the first 4 KiB; binary files rejected (use !!base64 if you really need bytes)
  • ~/... expansion; relative paths resolve against the agent's -cwd (the same cwd tools see)
  • Zero-byte files render as (empty file) not (no output)
  • Stacks with !! shell captures in entry order

:use <skill> — one-shot skill override (NEW)

Pin a specific skill for the next turn, bypassing the auto-router.

  • :use <skill> — pin; next bare user turn uses it; pin clears after one turn
  • :use <skill> <prompt> — combined form: pin + fire immediately with <prompt>
  • :use — show current pin
  • :use - — clear pin
  • Tab completes local skill names
  • Pre-turn banner [skill pinned: <name>] plus an EventRouter "<name> (pinned)" event (visible with -route-verbose)
  • Works under -no-route:use is the only way to invoke a skill when the auto-router is disabled

Quality-of-life

  • :rewind [N] — drop the last N user turn(s) plus their replies (default 1); operator-facing "undo my last question" parallel to Claude Code's behavior
  • ESC during a turn cancels cleanly and the next turn replays without malformed history
  • Cross-platform ESC watcher: Linux + Darwin termios constants are build-tagged (BSD/macOS use TIOCGETA/TIOCSETA/TIOCSETAF)
  • Router eval harness with a 36-prompt dataset for skill-routing regression testing

Internals

  • pendingShell unified into pendingInject carrying ordered shell + attach entries through one fold formatter; same persisted format for shell-only sessions as v0.8.5
  • New Agent.RunWithForcedSkill is a router-bypass entry point parallel to Run / RunWithListener; persisted user message is byte-identical to a router-picked turn (same skills.WrapUserInput), so prefix caches stay warm across turns
  • Router block extracted into applyRouter; post-routing body extracted as runTurnBody so auto-route and forced-skill paths share the loop body
  • skills.RouterFunc adapter (function-typed Router) for test/stub use
  • RunCLI now takes an explicit cwd parameter — @<path> resolves through cfg.Cwd, matching tool path-resolution behavior
  • 100 tests across 11 packages, including TDD coverage for readAttach (success, missing, directory, binary, oversize, tilde, symlink), pendingInject, splitAttachArgs, newAttachEntry, and the bypass-router invariant

Full persisted message shape

For reference, this is what gets persisted when the operator combines all three features in one turn (:use foo then @/tmp/log.txt explain):

<skill name="foo">
<skill-prompt-body>
</skill>

[user-attach] @/tmp/log.txt
<file-contents>
===
explain

Memory invariants are unchanged: still alternating user → assistant → tool, no schema migration.

v0.8.5

Choose a tag to compare

@github-actions github-actions released this 10 May 08:00

Full Changelog: v0.8.4...v0.8.5

v0.8.4

Choose a tag to compare

@github-actions github-actions released this 10 May 02:08

Full Changelog: v0.8.3...v0.8.4

v0.8.3

Choose a tag to compare

@github-actions github-actions released this 09 May 14:58

Full Changelog: v0.8.2...v0.8.3

v0.8.2

Choose a tag to compare

@github-actions github-actions released this 09 May 14:12

Full Changelog: v0.8.1...v0.8.2

v0.8.1

Choose a tag to compare

@github-actions github-actions released this 09 May 11:39

Full Changelog: v0.8.0...v0.8.1

v0.8.0:技能市场

Choose a tag to compare

@xuzhougeng xuzhougeng released this 09 May 08:14

v0.8.0:技能市场

发布日期:2026-05-09

一句话总结

cc-agent 通过 :reflect 生成的 skill 现在可以进入团队共享流程:本地用 :publish 发布到 cc-control,其他主机用 :install 拉取,也可以在 cc-web 的 Skills 页面里浏览和远程下发。

技能注册表使用 SQLite 持久化,按版本保存历史记录。默认安装最新版本,也可以查看历史并回滚到指定版本。

相关版本:

启用方式

cc-control 端配置注册表数据库:

./cc-control -registry-db /var/lib/cc-control/registry.db

也可以使用 REGISTRY_DB 环境变量。不配置时,技能市场完全关闭:注册表路由不会挂载,旧版本 cc-agent 的行为不受影响。

cc-agent 端只要已经配置 -control-url-agent-token,就会自动从 WebSocket 地址推导 HTTP 地址:

ws://host:18080/ws/agent -> http://host:18080

如果 HTTP 地址需要单独指定,可以使用:

./cc-agent -config-http-url https://control.example.com
#
CC_AGENT_CONTROL_HTTP_URL=https://control.example.com

REPL 新命令

:registry [search]               搜索或列出团队 skill
:publish <name>                  把本地 skill 发布到 cc-control
:install <name>[@version]        拉取 skill,预览后确认安装
:history <name>                  查看某个 skill 的版本历史
:rollback <name> <version>       安装指定历史版本

:install 会先显示 prompt、工具列表、作者和时间戳,操作员确认后才会写入本地目录。

skill 目录现在分为两层:

  • <skills_dir>/local/<name>.json:本地 :reflect 生成的 skill。
  • <skills_dir>/team/<name>.json:从团队注册表安装的 skill。

加载时先读 local,再读 team;同名时 team 版本覆盖 local 版本。如果想退回本地版本,删除 team/<name>.json 即可。

cc-web 的 Skills 页面

新增页面:/skills

页面左侧提供搜索和列表,右侧展示详情,包括 prompt 全文、工具标签、版本历史和 Install on host 操作。

点击 Install on host 后,cc-control 会通过 WebSocket 向指定 server_id 的 agent 发送 install_skill_request。agent 收到后会把 skill 原子写入 team/<name>.json 并热加载,不需要重启,也不需要操作员登录到目标主机。

REST API

Method Path 说明
POST /api/registry/skills 发布 skill
GET /api/registry/skills?q=... 搜索或列出 skill
GET /api/registry/skills/:name?version=N 获取指定 skill,默认返回最新版本
GET /api/registry/skills/:name/history 查看版本历史
DELETE /api/registry/skills/:name/:version 软删除指定版本,仅 admin 可用
POST /api/registry/install_request 由操作员触发远程安装

agent 请求使用 Authorization: Bearer <agent-token>X-Server-ID: <server-id> 鉴权。操作员请求沿用 cc-web 的 UI token。错误响应统一为 errBody{code, field, reason},方便客户端做分支处理。

安全边界

  • skill 名称必须匹配 ^[a-z][a-z0-9-]{1,63}$,HTTP 入口和 WebSocket 入口都会校验,避免路径穿越。
  • 版本号在 SQLite 事务里通过 MAX(version)+1 生成,并通过 SetMaxOpenConns(1) 串行化写入,避免并发发布撞号。
  • 软删除不会移除已经下发到 agent 的本地文件;如果要彻底撤销,需要到对应 agent 主机上删除已安装的 skill。

这版暂不包含

  • 公开或 OSS 注册表。当前实现面向单组织私有使用;签名、跨组织联邦、内容寻址等留到后续版本。
  • 订阅式同步。skill 安装仍由操作员触发,agent 不会自动跟随频道更新。
  • 完整的 cc-web e2e harness 修复。tests/web-e2e/specs/skills.spec.js 在手动启动 cc-control 的环境下可以跑通;tests/web-e2e/run-harness.sh 的修复留到后续版本。

测试覆盖

cc-control/internal/registry/            45 个测试,包含 20 协程并发 publish,以及 publish/install/rollback 端到端流程
cc-agent/internal/skills/                15 个测试,覆盖 client 和二阶段 loader
cc-agent/internal/transport/control/      5 个测试,覆盖 install_skill_request handler

两个 Go 模块均通过 go test ./... -race

升级兼容性

旧配置保持兼容:

  • cc-control 不配置 -registry-db 时,注册表关闭,行为与 v0.7.3 一致。
  • cc-agent 不配置 control_http_urlagent_token 时,新命令会提示 (registry not configured) 并返回,不影响其他 REPL 行为。
  • 旧的平铺式 skills_dir/*.json 仍可加载,不需要手动迁移。

预编译二进制

Release 页面提供 19 个预编译产物,均使用 CGO_ENABLED=0-trimpath-ldflags "-s -w" 构建。

控制面:

文件 用途
cc-control-linux-amd64 中心控制面,包含 REST、WebSocket 和可选技能注册表。

Agent:

文件 平台
cc-agent-linux-amd64 / cc-agent-linux-arm64 Linux
cc-agent-darwin-amd64 / cc-agent-darwin-arm64 macOS Intel / Apple Silicon
cc-agent-windows-amd64.exe / cc-agent-windows-arm64.exe Windows

cc-proxy 辅助二进制:

文件族 用途
cc-chat-claude-<os>-<arch> 把 Claude Code CLI 包装成 cc-proxy 使用的 chat 协议。
cc-chat-echo-<os>-<arch> 测试用 echo bot,不调用 LLM,便于 e2e 和 smoke test。

每个文件族都提供 linux、darwin、windows × amd64、arm64 六个平台。

下载示例:

curl -LO https://github.com/xuzhougeng/agent-control/releases/download/v0.8.0/cc-agent-linux-amd64
chmod +x cc-agent-linux-amd64

gh release download v0.8.0 --repo xuzhougeng/agent-control --pattern 'cc-agent-linux-*'

v0.8.0 是 v0.7.3 之后第一个由 GitHub Actions 全量构建发布的版本。compile.yml 已修复 cc-chat-claudecc-chat-echo 的模块路径迁移问题。

致谢

skill 和 reflect 模型参考了 lsdefine/GenericAgent,分发与协作方向受 sjtu-sai-agents/EvoMaster 启发。v0.8.0 在这个基础上,把单机 skill 管理扩展为团队级共享机制。

v0.7.3:审批超时支持配置

Choose a tag to compare

@xuzhougeng xuzhougeng released this 08 May 23:33

v0.7.3:审批超时支持配置

一句话总结

cc-agent-control-url 模式下等待 Approve / Reject 的时间不再固定为 5 分钟。现在可以通过命令行参数、环境变量或 JSON 配置文件来设置审批超时。

相关文档:

使用方式

# 命令行参数
./cc-agent -control-url ws://... -approval-timeout 30s

# 环境变量
CC_AGENT_APPROVAL_TIMEOUT=30m ./cc-agent -control-url ws://...

# JSON 配置
{ "approval_timeout": "1h" }

取值使用 Go duration 格式,例如 500ms30s5m1h2h30m。如果留空、设置为 0,或写成无法解析的值,cc-agent 会回到默认的 5 分钟。

为什么要改

固定 5 分钟很难同时适配不同场景:

  • 实时运维时,操作员通常就在屏幕前。等满 5 分钟才让模型降级会拖慢节奏,30s1m 更合适。
  • 异步值班或跨时区协作时,5 分钟又太短。可以设置成 30m1h,甚至更长。

推荐值

场景 推荐值
开发和测试 15s
实时运维 30s1m
默认行为 5m
夜班或异步处理 30m1h
跨时区团队 4h8h

改动清单

  • internal/transport/control/approver.go:新增 NewRemoteApproverWithTimeout(c, d)
  • internal/config/config.go:新增 ApprovalTimeout 字段、ApprovalTimeoutDuration() 解析逻辑和 CC_AGENT_APPROVAL_TIMEOUT 环境变量。
  • cmd/cc-agent/main.go:新增 -approval-timeout 参数,并在启动日志中打印实际生效值。
  • internal/config/config_test.go:覆盖默认值、正常解析和错误回退。

兼容性

  • v0.7.3 cc-agent 可以配合任何 v0.7.x 客户端和控制面使用。
  • 不设置新参数时,行为与之前一致,仍然默认等待 5 分钟。
  • 协议层没有变化。

升级

wget -O /usr/local/bin/cc-agent https://github.com/xuzhougeng/agent-control/releases/download/v0.7.3/cc-agent-linux-amd64
chmod +x /usr/local/bin/cc-agent
sudo systemctl restart cc-agent

cc-controlcc-proxy、iOS 客户端和 Windows 客户端都没有变化,不需要因为这个功能单独升级。

下载

平台 cc-agent cc-proxy
linux/amd64 cc-agent-linux-amd64 cc-proxy-linux-amd64
linux/arm64 cc-agent-linux-arm64 cc-proxy-linux-arm64
darwin/amd64 cc-agent-darwin-amd64 cc-proxy-darwin-amd64
darwin/arm64 cc-agent-darwin-arm64 cc-proxy-darwin-arm64
windows/amd64 cc-agent-windows-amd64.exe cc-proxy-windows-amd64.exe

控制面二进制为 cc-control-linux-amd64。所有预编译二进制都使用 CGO_ENABLED=0 构建,并去除了调试符号。

后续计划

  • 真正的 token 级流式输出。
  • 审批 webhook。
  • Multi-agent 协调。
  • 审批审计持久化。
  • 按 skill 指定模型。

完整 Roadmap 见 cc-agent README

v0.7.2:审批卡片标记 cc-agent 来源

Choose a tag to compare

@xuzhougeng xuzhougeng released this 08 May 23:23

v0.7.2:审批卡片标记 cc-agent 来源

一句话总结

iOS 和 Windows 客户端的 Pending Approval 卡片现在会显示紫色 cc-agent 徽章。操作员可以一眼看出这条审批来自新的 cc-agent 高风险命令拦截,而不是旧的 PTY 终端确认。

这个版本只补齐客户端展示,不改变协议,也不改变服务端审批逻辑。

相关文档:

背景

v0.7.1 已经把 cc-agent 的远程审批接入 cc-control,并复用了现有的 Pending Approval 事件。iOS 和 Windows 客户端原本就有 Approve / Reject 按钮,因此审批链路已经可用。

v0.7.2 解决的是展示问题:同一张审批卡片现在会明确标出来源,让操作员知道这是 cc-agent 发出的高风险命令审批。

三端一致

旧 PTY 审批不会显示运行时徽章:

8536aa5c @ ops-01
instance ad4aef30
y to confirm or n...
[Approve] [Reject]

新的 cc-agent 审批会显示紫色 cc-agent 徽章:

8536aa5c [cc-agent] @ ops-01
instance ad4aef30
[recursive rm] rm -rf /var/...
[Approve] [Reject]

改动清单

  • iOS Models.swiftSessionEvent 新增 agentRequestID 字段,并提供 isFromCCAgent 判断。
  • iOS ApprovalPanelView.swift:当审批来自 cc-agent 时,在审批卡片上显示紫色 cc-agent 标签。
  • Windows Models.csSessionEvent 新增 AgentRequestIdIsFromCCAgent,并补齐相关 JSON 映射。
  • Windows SidebarControl.xaml:审批卡片在 IsFromCCAgent=true 时显示紫色标签,视觉上与 cc-web 保持一致。

兼容性

  • v0.7.2 服务端可以继续配合 v0.6.x / v0.7.x 客户端使用。
  • v0.7.2 客户端可以配合 v0.7.1 及之后的 cc-control 使用,并显示 cc-agent 徽章。
  • v0.7.2 客户端连接 v0.6.x cc-control 时,缺少字段只会导致徽章不显示,不影响审批。

升级

Go 二进制功能与 v0.7.1 基本一致,主要用于和 v0.7.2 客户端版本对齐:

wget -O /usr/local/bin/cc-agent https://github.com/xuzhougeng/agent-control/releases/download/v0.7.2/cc-agent-linux-amd64
wget -O /usr/local/bin/cc-control https://github.com/xuzhougeng/agent-control/releases/download/v0.7.2/cc-control-linux-amd64
chmod +x /usr/local/bin/{cc-agent,cc-control}
sudo systemctl restart cc-control cc-agent

iOS 和 Windows 客户端仍需要从源码构建;二进制分发还没有接入 Apple Notary 或 Microsoft Signing。

下载

平台 cc-agent cc-proxy
linux/amd64 cc-agent-linux-amd64 cc-proxy-linux-amd64
linux/arm64 cc-agent-linux-arm64 cc-proxy-linux-arm64
darwin/amd64 cc-agent-darwin-amd64 cc-proxy-darwin-amd64
darwin/arm64 cc-agent-darwin-arm64 cc-proxy-darwin-arm64
windows/amd64 cc-agent-windows-amd64.exe cc-proxy-windows-amd64.exe

控制面二进制为 cc-control-linux-amd64。所有预编译二进制都使用 CGO_ENABLED=0 构建,并去除了调试符号。

后续计划

  • 真正的 token 级流式输出。
  • 审批 webhook,例如 Slack 或邮件通知。
  • 审批超时改成可配置项。
  • Multi-agent 协调。
  • 审批审计持久化。

完整 Roadmap 见 cc-agent README