- Any session operation that hits 404/410 (or finds no open tab) reconciles
tabs; if none survive it re-injects the account cookies (BR-2), opens a new
tab under the same userId/sessionKey, returns to the recorded URL (site home
otherwise), marks old tabs lost and retries the operation once. Failure
returns 503 browser_reconnect_failed with the reason, with a 10s backoff.
- Restart detection: umt plugin GET /umt/instance (fallback /health fields);
a changed instance id marks every open session needsReconnect.
- POST /browser/sessions/{id}/reconnect (idempotent); session view exposes
needsReconnect and reconnect {status, trigger, at, reason, humanNotice}.
- Controller and lease are kept; reconnecting during takeover asks the human
to double-check the reloaded page.
- Web: screenshot and desktop modes show "reconnecting", auto-reconnect once,
pause polling, offer a reconnect button with the reason on failure; desktop
mode rebuilds the Selkies connection after a reconnect.
- Mock camofox restart(), tests, smoke step and runbook section 10.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
browser
BrowserProvider 合同(provider.ts)及其实现:业务侧访问浏览器服务只走这套接口。产品浏览器能力对接用户已有的 camofox-browser;Playwright 只用于前端截图测试,不是产品浏览器能力。设计说明见 docs/design/browser-provider.md。
camofox/:camofox-browser 适配器。按 jo-inc/camofox-browser v1.17.0 的openapi.json、README 与 server.js 实现,2026-09-28 对真实容器逐项核验(docs/runbook/browser.md§7;核验表camofox/capabilities.ts的CAMOFOX_VERIFIED_RELEASES),Authorization: Bearer <CAMOFOX_ACCESS_KEY>,凭据每次请求经BrowserSecretResolver解出,不缓存、不入日志。camofoxuserId= 本项目profileKey(站点/账号隔离),sessionKey=browser_session.id。none.ts:默认实现(未配置浏览器),能力全关,动作报unavailable。redact.ts:redactSnapshot/redactBrowserUrl,快照与地址进入模型前遮蔽密码框值、Cookie 值、含 passkey/token 的 URL。profile-lock.ts:同一 profile 串行锁(进程内内存实现;多进程部署换持久化实现,接口不变)。budget.ts:导航域名白名单(含子域),非 http(s) 拒绝。
已实现(C1-E;BR-1 对 v1.17.0 真机核验并修正实测差异)
- 会话:
openSession(POST /tabs)、closeSession(DELETE /sessions/{userId})、listSessions(内存镜像;服务层以数据库为准)、restoreSession(重启后按 DB 恢复,旧引用失效)。 - 标签页:
openTab、closeTab(DELETE /tabs/{id})、reconcileTabs(GET /tabs?userId,上游已回收的标lost)。 - 导航:
navigate(白名单 / 超时 / 预算内重试 5xx·超时·网络)、history(/back/forward/refresh)。 - 读取:
snapshot(字节预算截断 + 脱敏)、screenshot(JSON base64 或 image/*;登录页 / 含凭据地址modelSafe: false)、extract(POST /extract,需先快照)。 - 交互:
click(ref / selector / 视口坐标)、type(明文或凭证引用,凭证经BrowserSecretResolver解出后直接下发)、select、scroll、press。 - 下载:
waitForDownload轮询GET /tabs/{id}/downloads?includeData&consume&maxBytes,字节交DownloadSink暂存、算 sha256,只返回引用。 - 控制权:
TabRef.as标明发起方(automation / human),与会话 controller 不符报control_conflict;setController任何变更都让旧eN引用失效(stale_ref);acquireControl/releaseControl为内存版,服务层用browser_control_lease持久化。
未核验的上游行为(坐标点击、无目标输入、scroll / press / back 等端点、downloads 字段形状)见 docs/runbook/browser.md 第 6 节。