Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(browser-extension): address the re-review

Dash7dd4569f814f
diff --git a/apps/desktop/resources/system-skills/cindy-plugin-creator/references/plugin-browser-extension.md b/apps/desktop/resources/system-skills/cindy-plugin-creator/references/plugin-browser-extension.md
index e9341ebffe..8302e04340 100644
--- a/apps/desktop/resources/system-skills/cindy-plugin-creator/references/plugin-browser-extension.md
+++ b/apps/desktop/resources/system-skills/cindy-plugin-creator/references/plugin-browser-extension.md
@@ -30,7 +30,8 @@ try {
status = await cindy.send({ type: 'browser-extension-request', kind: 'status' });
} catch (err) {
// 只有旧宿主会拒绝这个管子类型([INVALID_PARAMS] 未知的管子消息类型):回落到你自己的
- // 接线进程,并记住。不要把拒绝当作已连接。
+ // 接线进程,并记住。不要把拒绝当作已连接。其它异常(超时等)不回落,下次再探测。
+ if (!String(err?.message).includes('[INVALID_PARAMS]')) throw err;
}
// 新宿主也会返回 errorCode(HOST_NOT_READY、PERMISSION_DENIED 等):这表示宿主有这个槽,
// 只是暂时不可用。不要据此回落,也不要缓存结果,下次再探测。
@@ -80,5 +81,5 @@ cindy.onHostMessage(async (msg) => {
页面,不能当成功或未执行报告。
- **宿主代码不认识你**:桥接只按声明工作,不会为某个插件写特例;需要线协议之外的能力,先提
Cindy 改动,不要在扩展里绕过。
-- **向下兼容**:旧宿主没有这个槽,`status` 返回 `errorCode`;插件必须保留自带接线进程的降级
- 路径(或明确提示升级 Cindy),不能让已装用户的功能消失。
+- **向下兼容**:旧宿主没有这个槽,会以 `[INVALID_PARAMS]` 拒绝这个管子类型;插件必须保留
+ 自带接线进程的降级路径(或明确提示升级 Cindy),不能让已装用户的功能消失。
diff --git a/apps/desktop/src/main/browser-extension/__tests__/bridge.test.ts b/apps/desktop/src/main/browser-extension/__tests__/bridge.test.ts
index 16149a2097..06f84cfca6 100644
--- a/apps/desktop/src/main/browser-extension/__tests__/bridge.test.ts
+++ b/apps/desktop/src/main/browser-extension/__tests__/bridge.test.ts
@@ -328,13 +328,16 @@ describe('bridge · 连接与身份', () => {
// Review 2026-10-29: without the user's saved permissions the permissive default must not stand
// in for a blocklist the plugin still holds.
it('等待策略的桥接在收到策略前拒绝页面作业', async () => {
- const { bridge, client } = await fixture({ awaitPolicy: true });
+ let asked = 0;
+ const { bridge, client } = await fixture({ awaitPolicy: true, onPolicyMissing: () => asked++ });
await client({ native: true });
expect(await bridge.act('text', { url: 'https://example.test' })).toMatchObject({
ok: false,
error: 'POLICY_NOT_READY',
execution: 'not_executed',
});
+ // Each refusal tells the host, which asks the plugin again (throttled there).
+ expect(asked).toBeGreaterThan(0);
await bridge.setPolicy(defaultBrowserExtensionPolicy());
expect(await bridge.act('text', { url: 'https://example.test' })).not.toMatchObject({
error: 'POLICY_NOT_READY',
@@ -474,6 +477,19 @@ describe('bridge · 作业生命周期', () => {
expect(status.ok && status.pending).toBe(0);
});
+ // Re-review 2026-10-29: jobs queued while the browser restarted were delivered to whatever tab
+ // had the same number in the new session.
+ it('浏览器重启(启动 id 变化)时结束它排队中的作业,不投递到新会话', async () => {
+ const { bridge, ready } = await fixture();
+ const c = await ready();
+ await c.request('/health', undefined, { 'X-My-Browser-Boot': '11111111-1111-1111-1111-111111111111' });
+ const pending = bridge.act('text', { url: 'https://example.test' });
+ await sleep(5);
+ await c.request('/health', undefined, { 'X-My-Browser-Boot': '22222222-2222-2222-2222-222222222222' });
+ expect(await pending).toMatchObject({ ok: false, error: 'BROWSER_RESTARTED', execution: 'not_executed' });
+ expect((await c.request('/poll')).job ?? null).toBeNull();
+ });
+
it('已确认的交互超时记为 unknown 且绝不重投;未确认的过期作业不能再执行', async () => {
const { bridge, ready } = await fixture({ jobTimeout: 80 });
const c = await ready();
diff --git a/apps/desktop/src/main/browser-extension/bridge.ts b/apps/desktop/src/main/browser-extension/bridge.ts
index 0c49fb70d7..65fdc2a189 100644
--- a/apps/desktop/src/main/browser-extension/bridge.ts
+++ b/apps/desktop/src/main/browser-extension/bridge.ts
@@ -139,6 +139,8 @@ export interface BrowserExtensionBridgeOptions {
* so the permissive default must not stand in for a blocklist the plugin still holds.
*/
awaitPolicy?: boolean;
+ /** Called whenever a job is refused for lack of a policy, so the host can ask the plugin again. */
+ onPolicyMissing?: () => void;
ports?: readonly number[];
pollTimeout?: number;
connectWait?: number;
@@ -240,13 +242,15 @@ export class BrowserExtensionBridge {
}
private gate(action: unknown, url: unknown): ReturnType<typeof checkBrowserExtensionPolicy> {
- if (!this.policyKnown)
+ if (!this.policyKnown) {
+ this.options.onPolicyMissing?.();
return {
ok: false,
error: 'POLICY_NOT_READY',
message: 'Cindy is still loading your site permissions from the plugin. Try again shortly.',
execution: 'not_executed',
};
+ }
return checkBrowserExtensionPolicy(this.policy, action, url);
}
@@ -484,6 +488,19 @@ export class BrowserExtensionBridge {
});
}
+ private endJobsOf(clientId: string): void {
+ for (const job of [...this.jobs.values()])
+ if (job.clientId === clientId)
+ this.finish(
+ job,
+ this.jobFailure(
+ job,
+ 'BROWSER_RESTARTED',
+ 'The browser restarted before this finished. Check its tabs again before retrying.',
+ ),
+ );
+ }
+
private jobFailure(job: Job, error: string, message: string): BrowserExtensionFailure {
return failure(
error,
@@ -657,7 +674,12 @@ export class BrowserExtensionBridge {
client.browser = family ?? client.browser;
client.version = String(this.header(req, 'x-my-browser-version') || '').slice(0, 30);
const boot = this.header(req, 'x-my-browser-boot');
- if (typeof boot === 'string' && /^[0-9a-f-]{36}$/i.test(boot)) client.boot = boot;
+ if (typeof boot === 'string' && /^[0-9a-f-]{36}$/i.test(boot)) {
+ // The browser restarted: tab ids start over, so jobs aimed at the old tabs must not reach
+ // whatever tab now has the same number.
+ if (client.boot && client.boot !== boot) this.endJobsOf(client.id);
+ client.boot = boot;
+ }
client.installedVersion = installedVersion;
client.seen = this.now();
if (keyHeader !== undefined && publicKey !== client.publicKey) {
@@ -1036,6 +1058,12 @@ export class BrowserExtensionBridge {
srv.once('error', reject);
srv.listen(candidate, '127.0.0.1', resolve);
});
+ // close() ran while this listen was pending: do not keep an ownerless listener.
+ if (this.closed) {
+ srv.closeAllConnections();
+ await new Promise<void>((r) => srv.close(() => r()));
+ throw new Error('BRIDGE_STOPPED');
+ }
this.server = srv;
const address = srv.address();
this.port = typeof address === 'object' && address ? address.port : candidate;
diff --git a/apps/desktop/src/main/browser-extension/native-binding.ts b/apps/desktop/src/main/browser-extension/native-binding.ts
index 75b392a03e..cab6ad1b8f 100644
--- a/apps/desktop/src/main/browser-extension/native-binding.ts
+++ b/apps/desktop/src/main/browser-extension/native-binding.ts
@@ -151,6 +151,10 @@ export function createNativeBinding(options: NativeBindingOptions): NativeBindin
try {
await privateDirectory(root);
await privateDirectory(path.join(root, 'connections'));
+ // Claim the connection before touching the shared registration, so a binding closing at the
+ // same time (plugin update, re-approval, account switch) still sees this one in use.
+ config = path.join(root, 'connections', port + '.json');
+ await atomic(config, JSON.stringify({ token }));
const binaryName = 'cindy-browser-native' + (platform === 'win32' ? '.exe' : '');
const source = path.join(options.binaryDir, platform + '-' + arch, binaryName);
const binary = path.join(root, binaryName);
@@ -196,8 +200,6 @@ export function createNativeBinding(options: NativeBindingOptions): NativeBindin
await atomic(path.join(dir, options.hostName + '.json'), JSON.stringify(manifest));
}
}
- config = path.join(root, 'connections', port + '.json');
- await atomic(config, JSON.stringify({ token }));
state = 'ready';
return { ok: true as const };
} catch (e) {
diff --git a/apps/desktop/src/main/cindy-brain/__tests__/browserExtensionSlot.test.ts b/apps/desktop/src/main/cindy-brain/__tests__/browserExtensionSlot.test.ts
index 39c5b67ac8..5bfbaffacb 100644
--- a/apps/desktop/src/main/cindy-brain/__tests__/browserExtensionSlot.test.ts
+++ b/apps/desktop/src/main/cindy-brain/__tests__/browserExtensionSlot.test.ts
@@ -215,6 +215,34 @@ describe('browserExtensionSlot · 桥接随花名册启停', () => {
expect(slot.getPageControl()).toBeNull();
});
+ // Review 2026-10-29 (re-review): on an update the old bridge's stop and the new one's start ran
+ // concurrently, so the old binding saw no live connection and withdrew the new registration.
+ it('换版时新桥接等旧桥接与 native 注册关完后才安装', async () => {
+ const order: string[] = [];
+ const { slot, natives } = await makeSlot();
+ const wrapNative = (n: (typeof natives)[number], i: number) => {
+ n.install.mockImplementation(async () => {
+ order.push(`install${i}`);
+ return { ok: true as const };
+ });
+ n.close.mockImplementation(async () => {
+ await new Promise((r) => setTimeout(r, 30));
+ order.push(`close${i}`);
+ });
+ };
+ slot.reconcile([extGhost()]);
+ await vi.waitFor(() => expect(natives[0]).toBeDefined());
+ wrapNative(natives[0], 0);
+ await vi.waitFor(() => expect(order).toContain('install0'), { timeout: 2000 }).catch(() => undefined);
+ order.length = 0;
+ slot.reconcile([extGhost({ version: '1.1.0' })]);
+ await vi.waitFor(() => expect(natives[1]).toBeDefined());
+ wrapNative(natives[1], 1);
+ await vi.waitFor(() => expect(order).toContain('install1'));
+ expect(order.indexOf('close0')).toBeGreaterThanOrEqual(0);
+ expect(order.indexOf('close0')).toBeLessThan(order.indexOf('install1'));
+ });
+
// Native hosts run outside the sandbox and share one registration per account, so a plugin that
// is not the official Cindy Chrome must not get one, even under the official name.
it('只有官方 Cindy Chrome 能装 native host;其它插件声明了也只开桥接', async () => {
diff --git a/apps/desktop/src/main/cindy-brain/browserExtensionSlot.ts b/apps/desktop/src/main/cindy-brain/browserExtensionSlot.ts
index 572a976a09..62b3aaa158 100644
--- a/apps/desktop/src/main/cindy-brain/browserExtensionSlot.ts
+++ b/apps/desktop/src/main/cindy-brain/browserExtensionSlot.ts
@@ -131,6 +131,8 @@ function entrySignature(ghost: InstalledGhost, ownerScopeKey: string): string {
/** 浏览器扩展槽:按插件启停桥接 → 转交扩展请求 → 承接插件的作业/策略推送 → 提供页面控制桥接。 */
export class GhostBrowserExtensionSlot {
private readonly entries = new Map<string, Entry>();
+ /** Stops in flight; a replacement entry waits for them so the old one cannot undo its setup. */
+ private readonly stopping = new Map<string, Promise<void>>();
private disposed = false;
constructor(private readonly deps: BrowserExtensionSlotDeps) {}
@@ -156,6 +158,7 @@ export class GhostBrowserExtensionSlot {
private start(instanceId: string, ghost: InstalledGhost, ownerScopeKey: string): void {
const needs = ghost.manifest.browserExtension!;
+ let lastPolicyRequest = Number.NEGATIVE_INFINITY;
if (needs.nativeHost && !mayInstallNativeHost(ghost))
this.deps.log?.warn('browser extension native host ignored: only the official plugin may install one', {
instanceId,
@@ -170,6 +173,13 @@ export class GhostBrowserExtensionSlot {
const bridge = (this.deps.createBridge ?? ((options) => new BrowserExtensionBridge(options)))({
ghostId: ghost.manifest.id,
awaitPolicy: true,
+ // The first request can be lost (plugin page still loading); ask again on refusal, throttled.
+ onPolicyMissing: () => {
+ const now = (this.deps.now ?? Date.now)();
+ if (now - lastPolicyRequest < 5000) return;
+ lastPolicyRequest = now;
+ void this.requestPolicy(instanceId);
+ },
installedVersion: ghost.manifest.version,
extensionIds: needs.extensionIds,
...(native ? { nativeToken: native.token } : {}),
@@ -189,7 +199,10 @@ export class GhostBrowserExtensionSlot {
saved: { policy: null, trustedClients: [] },
writes: Promise.resolve(),
};
+ const previous = this.stopping.get(instanceId);
entry.ready = (async () => {
+ // The old bridge must release its port and native registration before this one claims them.
+ await previous?.catch(() => undefined);
const saved = await this.readSaved(instanceId);
let restored = false;
if (saved) {
@@ -242,15 +255,21 @@ export class GhostBrowserExtensionSlot {
this.entries.set(instanceId, entry);
}
- private async stop(instanceId: string): Promise<void> {
+ private stop(instanceId: string): Promise<void> {
const entry = this.entries.get(instanceId);
- if (!entry || entry.closing) return;
+ if (!entry || entry.closing) return this.stopping.get(instanceId) ?? Promise.resolve();
entry.closing = true;
this.entries.delete(instanceId);
- await entry.ready;
- await entry.bridge.close();
- await entry.native?.close();
- this.deps.log?.info('browser extension bridge stopped', { instanceId });
+ const stopped = (async () => {
+ await entry.ready;
+ await entry.bridge.close();
+ await entry.native?.close();
+ this.deps.log?.info('browser extension bridge stopped', { instanceId });
+ })().finally(() => {
+ if (this.stopping.get(instanceId) === stopped) this.stopping.delete(instanceId);
+ });
+ this.stopping.set(instanceId, stopped);
+ return stopped;
}
async dispose(): Promise<void> {
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskService.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskService.test.ts
index 3f4bd3cc0a..e94c5110a3 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskService.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/pluginTaskService.test.ts
@@ -1421,7 +1421,7 @@ it('an open plugin selection without a source session follows the auxiliary chai
const resolveStart = source.indexOf(' const resolveRoute = async');
const resolve = source.slice(resolveStart, source.indexOf(' const readExecution', resolveStart));
const run = (candidates: Array<{ agentKind: 'codex'; providerId: string; model: string }>, config = {}, sourceSessionId?: string) => {
- const deps = { readPluginTaskConfig: () => config, getSelectedNewMakerRoute: () => selected,
+ const deps = { getPluginTaskDefaults: () => config, getSelectedNewMakerRoute: () => selected,
activeOwnerScopeKey: () => 'owner', assertPlugin: () => {}, getPluginTaskSourceSessionId: () => sourceSessionId,
resolveSessionExecution: resolver, PluginTaskError, routeUnavailable: () => { throw Error('unavailable'); },
getEffectiveAuxiliaryModelRefs: () => ['chain'], getEffectiveAuxiliaryModelChainSnapshot: () => 'chain',
diff --git a/apps/desktop/src/main/mcp-integrations/browser-backend/__tests__/user-browser-backend.test.ts b/apps/desktop/src/main/mcp-integrations/browser-backend/__tests__/user-browser-backend.test.ts
index a9dc0c68a7..26c71aaffc 100644
--- a/apps/desktop/src/main/mcp-integrations/browser-backend/__tests__/user-browser-backend.test.ts
+++ b/apps/desktop/src/main/mcp-integrations/browser-backend/__tests__/user-browser-backend.test.ts
@@ -785,12 +785,19 @@ describe('UserBrowserBackend · 读取与动作', () => {
connected().map((c) => ({ ...c, boot }));
fake.responses.set('open', (payload) => ({ ok: true, tabId: 42, window: 500, url: payload.url, title: 'New' }));
const b = backend(fake.control);
- await call(b, { action: 'open', url: 'https://example.test/new', label: 'n' });
+ const opened = await call(b, { action: 'open', url: 'https://example.test/new', label: 'n' });
+ const oldTarget = (opened.data as { targetId: string }).targetId;
boot = '22222222-2222-2222-2222-222222222222';
const before = fake.jobs.length;
const result = await call(b, { action: 'act', targetId: 'n', request: { kind: 'click', ref: 'r1' } });
expect(result.ok).toBe(false);
expect(fake.jobs.slice(before).some(([action]) => action === 'click')).toBe(false);
+ // A restored tab with the same number gets a new handle; the old full id stays unknown.
+ fake.responses.set('tabs', () => ({ ok: true, tabs: [{ id: 42, url: 'https://example.test/restored', title: 'R' }] }));
+ const listed = await call(b, { action: 'tabs' });
+ const relisted = (listed.data as { tabs: Array<{ targetId: string }> }).tabs[0].targetId;
+ expect(relisted).not.toBe(oldTarget);
+ expect((await call(b, { action: 'act', targetId: oldTarget, request: { kind: 'click', ref: 'r1' } })).ok).toBe(false);
});
it('扩展已连上但没配对时 status 立即说明需要配对,不空等', async () => {
diff --git a/apps/desktop/src/main/mcp-integrations/browser-backend/user-browser-backend.ts b/apps/desktop/src/main/mcp-integrations/browser-backend/user-browser-backend.ts
index eca57279f8..2d42e7d850 100644
--- a/apps/desktop/src/main/mcp-integrations/browser-backend/user-browser-backend.ts
+++ b/apps/desktop/src/main/mcp-integrations/browser-backend/user-browser-backend.ts
@@ -57,8 +57,6 @@ interface TargetRecord {
tabId: number;
url: string;
title?: string;
- /** Browser launch the tab id belongs to; see forgetRestartedBrowsers. */
- boot?: string;
}
export const USER_BROWSER_UNSUPPORTED_HINT =
@@ -446,7 +444,10 @@ export class UserBrowserBackend implements BrowserBackend {
// ── 目标表 ──────────────────────────────────────────────────────────────
private targetKey(clientId: string, tabId: number): string {
- return `${clientId.slice(0, 8)}:${tabId}`;
+ // The browser launch is part of the handle: after a restart the same tab number is a different
+ // tab, and an old handle the agent still holds must not resolve to it.
+ const boot = this.clientBoots.get(clientId);
+ return `${clientId.slice(0, 8)}${boot ? '.' + boot.slice(0, 8) : ''}:${tabId}`;
}
private register(
diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.ts
index e516819d32..967c54696d 100644
--- a/apps/desktop/src/preload/preload.ts
+++ b/apps/desktop/src/preload/preload.ts
@@ -4184,8 +4184,8 @@ contextBridge.exposeInMainWorld('electronAPI', {
| { type: 'share-import'; filePath: string }
| { type: 'provider-import'; importId: string }
| { type: 'plugin'; pluginId: string }
- | { type: 'local-plugin-share'; snapshotId: string }
- | { type: 'installed-plugin'; ghostId?: string }
+ | { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'shared-task-join'; invitation: string; server: string }
| { type: 'provider-share-join'; link: string }
| { type: 'chat-invite'; token: string }
diff --git a/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx b/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
index ffb50a589e..6e505ee147 100644
--- a/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
+++ b/apps/desktop/src/renderer/components/settings/ComputerUseSection.tsx
@@ -462,6 +462,9 @@ export function ComputerUseSection({ workingDir }: ComputerUseSectionProps) {
useInstalledGhosts().find((ghost) => ghost.manifest.id === RECOMMENDED_PAGE_CONTROL_PLUGIN_ID) ??
null;
const [userBrowserSetupBusy, setUserBrowserSetupBusy] = useState(false);
+ // Health can include an automatic embedded-browser recovery and therefore
+ // take several seconds. Track the latest health owner so a late initial
+ // probe cannot overwrite a newer user-initiated switch or recovery result.
const browserBackendHealthSeqRef = useRef(0);
const browserBackendKindRef = useRef(browserBackendKind);
browserBackendKindRef.current = browserBackendKind;
@@ -558,9 +561,6 @@ export function ComputerUseSection({ workingDir }: ComputerUseSectionProps) {
}, [browserBackendKind, browserBackendHealth?.status, refreshUserBrowserHealth]);
const [useRealProfilePending, setUseRealProfilePending] = useState(false);
const confirmDialog = useOptionalConfirmDialog();
- // Health can include an automatic embedded-browser recovery and therefore
- // take several seconds. Track the latest health owner so a late initial
- // probe cannot overwrite a newer user-initiated switch or recovery result.
useEffect(() => {
let cancelled = false;
diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.ts
index e7fd303e83..08bc8a7edf 100644
--- a/apps/desktop/src/renderer/vite-env.d.ts
+++ b/apps/desktop/src/renderer/vite-env.d.ts
@@ -3116,8 +3116,8 @@ interface ElectronAPI {
| { type: 'chat-invite-malformed' }
| { type: 'provider-share-join'; link: string }
| { type: 'plugin'; pluginId: string }
- | { type: 'local-plugin-share'; snapshotId: string }
- | { type: 'installed-plugin'; ghostId?: string }
+ | { type: 'local-plugin-share'; snapshotId: string }
+ | { type: 'installed-plugin'; ghostId?: string }
| { type: 'settings'; tab: 'voice-input' | 'providers' | 'billing' | 'remote-control'; connect?: string; intent?: 'topup' }
| null
>;
diff --git a/packages/browser-control-runtime/upstream/MAINTAINING.md b/packages/browser-control-runtime/upstream/MAINTAINING.md
index 2cdde6b485..9f6004c1d5 100644
--- a/packages/browser-control-runtime/upstream/MAINTAINING.md
+++ b/packages/browser-control-runtime/upstream/MAINTAINING.md
@@ -232,7 +232,7 @@ pnpm --filter @cindy/browser-control-runtime test # 契约 + SSRF guard
- 设置 →「自动操作」三选一:专用浏览器(默认)/ 侧边栏 / 我的浏览器;选哪一个是**默认**目标,Agent 的 `setBackend` 仍是同一个全局持久选择。没有声明 `browserExtension.pageControl` 的插件时该目标 `status.ready === false`,健康面板报 `extension-disconnected`,不提供恢复按钮。
- 能力边界由扩展决定(隔离世界固定函数,无 debugger):只支持 tabs / open / navigate / snapshot / extract / act(click / type / fill / press / hover / select / wait);`deps.backendCapabilities()` 让 MCP 层在派发前拒绝 screenshot / evaluate / requests / upload / dialog / console / pdf / focus / close / 坐标与拖拽,以及需要 guard / evaluate / 适配器 / 网络读取的配方,错误文案要求模型告知用户而不是自行切换。extract 与登录墙检测走 PR #7432 的声明式 `domRead`,不需要任意脚本。
- 寻址:扩展当前按精确 URL 寻址,后端维护 targetId ↔ {连接, tabId, url};作业前用 `tabs` 核对,URL 变化报 `PAGE_CHANGED` 并刷新记录,不猜新页。扩展侧加 tabId / documentId 寻址后这里只需改 `locate`。
-- 站点策略归插件:读默认开放公网、交互按站点授权、本机与私网拒绝;宿主缓存在 `ownerScopedUserDataPath('browser-extension')`,每个作业经桥接强制。`cindy_browser` 的免审批前提在该目标下由这套策略补上。
+- 站点策略归插件:读与交互默认开放,本机与私网和公网网站一样可访问、也可写进名单屏蔽(2026-10-28);宿主没有缓存时在收到插件策略前拒绝作业;宿主缓存在 `ownerScopedUserDataPath('browser-extension')`,每个作业经桥接强制。`cindy_browser` 的免审批前提在该目标下由这套策略补上。
- 回归:`browser-extension/__tests__/bridge.test.ts`(协议)、`cindy-brain/__tests__/browserExtensionSlot.test.ts`(槽)、`browser-backend/__tests__/user-browser-backend.test.ts`(翻译)、`lizi-mcps` 的 capability gating 用例;真实 Chrome 验收用 Google Play 发包案例与插件翻译。
## 10. 相关文档