v0.6.2
v0.6.2 更新说明(自 v0.6.1 以来 / Changelog since v0.6.1)
仍提供两种安装包,按需下载:
browser-copilot-0.6.2-ocr.zip—— 完整版(约 32 MB):内置本地 OCR(Tesseract.js),工作流 OCR 识别算子、离线验证码识别开箱即用。browser-copilot-0.6.2-no-ocr.zip—— 精简版(约 0.5 MB,小 98%):不含 OCR 引擎与语言模型,其余功能完全一致;OCR 算子置灰不可用,图片文字仍可通过视觉模型识别(设置 → 图片识别模型)。Two packages ship as usual: the full build with local OCR (Tesseract.js)
and a ~98% smaller lite build without it. Everything except local OCR is
identical.
✨ v0.6.2
这一版的主线是把 AI 调试从"能跑"变成"跑得成":给成功率装上可离线测量的标尺、
给中断的工作流一个真正安全的续跑入口,并堵住非幂等流程无限重试这个最烧 token 的坑。
🎯 AI 调试成功率
- 离线成功率基准测试(
tests/bench/、pnpm bench:debug)——8 个确定性场景驱动真实的
runDebugSession,所有依赖均注入,不需要浏览器、模型或网络,可安全跑在 CI 里。
判定口径很严:verified = 全程无人接管 AND 目标达成。 - 会话遥测 ——
debugSessionStats/workflows.debugStats加上面板展示:成功率、
p50/p90 耗时、失败阶段与原因分布。 - 全局重试预算 + 逃生舱 —— 接管次数现在按整个会话封顶(原来只按节点),
超预算即带原因结束本轮,而不是继续烧模型调用。 - 结构化校验结果 —— 调试失败会带上
failureReason与suggestedAction。 - 性能/网络语义摘要 —— console 与 network 缓冲被压缩成一条"页面健康"信息,
随工具结果一起回喂给模型。 - 观察者预检(可选,
BC_OBSERVER_PREFLIGHT=1)—— 首次接管前先做一次只读检查,
遇到验证码/登录墙直接跳过 agent。 - 检查点与失败记忆 —— 抽出共享的
checkpoints.ts/failure-memory.ts,
重试时会带上同节点此前失败的结构化记忆。 - 逐步检查点并持久化 —— 引擎对每个已结束节点(ok / failed / cancelled)都产出检查点,
插件写入checkpoints/<runId>.json(配了数据目录则走文件区,否则chrome.storage.local),
服务端运行器写入<dataDir>/checkpoints/checkpoint-<runId>.json,默认保留最近 20 次运行。 - 逐节点幂等重试 —— 第 2 次及以后的尝试,从第 1 次尝试之前的变量状态开始,
不再继承失败尝试写了一半的状态(表单填了一半、计数器已经加过),把同一个非幂等陷阱再往下压一层。 - 会话关联(M4) —— 一个
sessionId打在一次调试会话产出的所有运行上
(接管轮、修复验证、重写验证)及其待修复记录上,运行、检查点与接管统计因此可以互相关联。 - 预算可配置 ——
BC_TAKEOVER_MAX_ATTEMPTS、BC_TAKEOVER_TOOL_ROUNDS、
BC_TAKEOVER_AUTORUN_BUDGET。
⏯ 从检查点续跑(Resume)
- 续跑点推导(M4) ——
resumePointOf算出中断的运行该从哪里接上:最后一个干净结束的节点之后,
并带上该节点的变量。executeWorkflow({ resumeFrom: runId })与新的workflows.resume
命令使用它,先读内存态、再回落到持久化副本,所以重启不会丢掉续跑点。这是非幂等流程的复原路径:
已经登录过再重放登录只会失败,因此续跑会跳过已经落地的部分。 - 面板上的「继续」按钮(M4) —— 上次运行失败的工作流,会在「运行」旁多出一个继续。
面板会先通过新的workflows.resumePoint命令确认存在干净检查点,只有确认后才展示该入口,
因此绝不会出现"点了继续却整条重跑"的情况。续跑点背后的运行会通过持久化索引解析——
MV3 的 worker 会在运行结束后被回收,而那恰恰是用户去找「继续」的时刻。
🛑 非幂等流程不再无限重试
登录 / 提交订单 / 发消息 / 注册 / 支付这类流程,之前会被判成"目标未达成"然后重试,
而它的前置条件其实已经消失(登录过就没有登录页了),于是每次重试都以同样方式失败,
直到轮次耗尽再绕回复放阶段。现在有三道防线:
- 目标判定在终态已满足时返回
alreadySatisfied,失败的运行按这个口径重新判定(runFailed); - 会话在每次重试前、回放升级前、重写验证判定前都会先查终态,已满足则立即报成功;
- 重复死路断路器(
REPEAT_FAILURE_LIMIT)在同一失败特征反复出现时终止会话,
提示用户重置页面状态,而不是继续打转。 - 回放提示词也要求 agent 识别"已经完成"的目标,而不是去找一个已经不存在的表单。
- 新增基准场景
S9-non-idempotent固化该行为:一次接管后即以✅ 终态已满足结束,
无回放、无重试。
🔒 独立运行器(Runner)加固
- 使用
crypto.timingSafeEqual做 Bearer Token 校验;移除?token=查询串兜底;
未配置 token 时默认拒绝启动(可用BC_ALLOW_UNAUTHENTICATED=1放开)。 - CORS 白名单(
BC_CORS_ORIGIN)与按 IP 限流(BC_RATE_LIMIT_MAX/BC_RATE_LIMIT_WINDOW)。 POST /api/runs、POST /api/hooks/:id、PUT /api/config增加 zod 请求校验
(结构化400+ 字段级错误)。- 全量改用
pino结构化日志(替换console.*),带 request id 透传与统一错误出口
(server/src/observability.ts)。 server/config.json以0600权限写出。
🧩 侧边栏与对话
- 思考过程与工具调用分离展示 —— 模型推理(
think块)用独立的折叠样式渲染,
工具调用不再插在助手回复中间,一轮对话不再被切成好几段。仅给模型看的信封内容
(激活技能指令、页面选择块)通过displayContent字段从用户自己的气泡里隐藏,
该字段在发起请求前会被剥离。 - 对话回答下载改为走
chrome.downloads.download:原来用<a download>.click()
并在setTimeout(0)里 revoke blob URL,会和浏览器的异步下载启动竞争,
在侧边栏里表现为"点了下载没反应"。现在改为下载被接受后再回收 URL,
锚点方式仅作为非扩展环境的降级路径。 - 工作流触发器编辑终于生效 —— 编辑器保存时通过
triggerFromNodes把触发块反规范化到
工作流的顶层trigger,列表角标与后台监听器随之反映修改后的启动方式;
列表角标现在读取有效触发类型,并补齐 6 个触发类型的中文标签
(间隔 / 定时 / 每周 / 启动 / 快捷键 / 元素变化)。工作流的「导入」收进 新建按钮的悬浮气泡菜单。 - 助手气泡上的复制/下载按钮在回答流式输出期间隐藏,轮次结束后才出现。
⚙️ 工程化
- CI 工作流(typecheck、test、lint、format、build、benchmark、server 各项门禁)、
Dependabot、CODEOWNERS、ESLint flat config、Prettier、覆盖率基线。
🔧 其他修复与调整
- 交互区块现在每次运行都会等待(原来只在调试首轮等待)。
- 瞬时 LLM 失败(429 / 5xx / 网络)带退避重试,且绝不在流已消费后再重试。
- 快照元素上限遵循请求的
maxElements(上限 250)。 - 判定解析不再把被截断的载荷当成成功。
- 自动接管运行(
takeoverOnRun)限制为单次接管(成本上限)。 workflows.takeoverApply支持可选verify参数,在应用修复后跑一次无接管的验证(默认关闭)。- 服务端接管可在
BC_TAKEOVER_APPLY_PATCH=1(默认关闭)时把 agent 的paramsPatch
应用到内存副本并写出审计产物。
English summary
v0.6.2 — the theme is turning AI debugging from "it runs" into "it succeeds".
- Measurable success rate: an offline benchmark (
pnpm bench:debug,tests/bench/) drives
the realrunDebugSessionwith every dependency injected — no browser, model or network —
using a strictverified = takeover-free AND goal achievedmetric. Session telemetry
(debugSessionStats/workflows.debugStats) surfaces success rate, p50/p90 duration and
failure phases in the panel. - Retries that cannot burn money: a global takeover budget caps the whole session; structured
failureReason+suggestedAction; per-step persisted checkpoints and a failure memory that
primes retries; idempotent per-node retries that start from the variables the node saw before
the first attempt; an opt-in observer preflight that skips the agent on a captcha/login wall;
and console/network buffers compressed into one "page health" line. - Resume from checkpoint:
resumePointOfderives the exact node where an interrupted run
continues (with its variables), exposed viaworkflows.resume/workflows.resumePoint, with a
Resume action on the panel that only appears when a clean checkpoint really exists. This is
the recovery path for non-idempotent flows, where replaying a completed login can only fail. - Non-idempotent workflows no longer loop forever: the goal judge reports
alreadySatisfied,
the session consults the terminal-state check before every retry / escalation / verdict, and a
repeated-dead-end breaker stops the run and tells the user to reset page state. Pinned by the new
S9-non-idempotentbenchmark scenario. - Runner hardening: timing-safe Bearer auth with the
?token=fallback removed (refuses to boot
without a token), CORS allow-list, per-IP rate limiting, zod request validation, structured
pinologging with request ids, andconfig.jsonwritten as0600. - Side panel: model reasoning renders as its own collapsed block with tool calls out of the
reply body; answer downloads go throughchrome.downloads.download(the anchor + immediate
revokeObjectURLraced the browser and silently dropped the file); workflow trigger edits are
denormalized on save so the chip and background listeners honour them, with six more localized
trigger labels and Import folded into the New button's bubble menu. - Engineering: CI workflow, Dependabot, CODEOWNERS, ESLint flat config, Prettier, coverage
baseline. Plus fixes for interaction-block waits, transient LLM retries, the snapshot element
cap, truncated verdict parsing, and a single-episode cap on automatic takeover runs.
Full changelog: v0.6.1...v0.6.2
Full Changelog: v0.6.1...v0.6.2