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(memory): memory_review 改走共享辅助模型链,默认 haiku 403 的账号不再 100% 失败 (#6061)

Yunjin Zhangbc772d722d29
diff --git a/apps/desktop/src/main/maker-host/__tests__/memoryReviewOneShot.test.ts b/apps/desktop/src/main/maker-host/__tests__/memoryReviewOneShot.test.ts
new file mode 100644
index 0000000000..c5a4f3a4c7
--- /dev/null
+++ b/apps/desktop/src/main/maker-host/__tests__/memoryReviewOneShot.test.ts
@@ -0,0 +1,72 @@
+/**
+ * createMemoryReviewOneShot — memory_review 的共享辅助模型链接入口回归。
+ *
+ * 契约: maker 未就绪 / 链失败 / 链产出为空 → 一律返回 null(不抛), 由
+ * MakerMemoryManager 回退 review agent 默认路由; 链有产出 → 原文返回。
+ */
+
+import type { Maker } from '@cindy/maker-core';
+import { describe, expect, it, vi } from 'vitest';
+
+import type { UtilityTextResult } from '../../../shared/utilityTextResult.js';
+import { createMemoryReviewOneShot } from '../memory-review-one-shot.js';
+
+vi.mock('../index.js', () => ({ getMakerIfReady: () => ({}) }));
+
+function ok(text: string): UtilityTextResult {
+ return { ok: true, text, providerId: 'p', model: 'm', transport: 'litellm-chat-completions' };
+}
+
+function failed(): UtilityTextResult {
+ return { ok: false, reason: 'all_candidates_failed', attempts: [] };
+}
+
+const maker = {} as Maker;
+
+describe('createMemoryReviewOneShot', () => {
+ it('returns the chain text when the utility chain produces it', async () => {
+ const requestText = vi.fn(async () => ok('merge a into b'));
+ const oneShot = createMemoryReviewOneShot({ getMaker: () => maker, requestText });
+ await expect(oneShot('prompt', { maxTokens: 800, timeoutMs: 60_000 })).resolves.toBe(
+ 'merge a into b',
+ );
+ expect(requestText).toHaveBeenCalledWith(maker, 'prompt', {
+ maxTokens: 800,
+ timeoutMs: 60_000,
+ disableReasoning: true,
+ });
+ });
+
+ it('returns null when maker is not ready, without dispatching', async () => {
+ const requestText = vi.fn(async () => ok('x'));
+ const oneShot = createMemoryReviewOneShot({ getMaker: () => null, requestText });
+ await expect(oneShot('prompt', { maxTokens: 800, timeoutMs: 60_000 })).resolves.toBeNull();
+ expect(requestText).not.toHaveBeenCalled();
+ });
+
+ it('returns null when the chain text is only whitespace', async () => {
+ const oneShot = createMemoryReviewOneShot({
+ getMaker: () => maker,
+ requestText: async () => ok(' \n '),
+ });
+ await expect(oneShot('prompt', { maxTokens: 800, timeoutMs: 60_000 })).resolves.toBeNull();
+ });
+
+ it('returns null when the chain reports no usable candidate', async () => {
+ const oneShot = createMemoryReviewOneShot({
+ getMaker: () => maker,
+ requestText: async () => failed(),
+ });
+ await expect(oneShot('prompt', { maxTokens: 800, timeoutMs: 60_000 })).resolves.toBeNull();
+ });
+
+ it('returns null instead of throwing when the chain request throws', async () => {
+ const oneShot = createMemoryReviewOneShot({
+ getMaker: () => maker,
+ requestText: async () => {
+ throw new Error('boom');
+ },
+ });
+ await expect(oneShot('prompt', { maxTokens: 800, timeoutMs: 60_000 })).resolves.toBeNull();
+ });
+});
diff --git a/apps/desktop/src/main/maker-host/index.ts b/apps/desktop/src/main/maker-host/index.ts
index 360ff1398f..0c9c53d502 100644
--- a/apps/desktop/src/main/maker-host/index.ts
+++ b/apps/desktop/src/main/maker-host/index.ts
@@ -364,7 +364,8 @@ import {
registerCodexProcessRole,
} from '../process-monitor/codex-process-registry.js';
import { getOutboundPathSnapshotFor } from './outbound-proxy-resolver.js';
-import { createDesktopMakerMemoryManager, attachAgentsToMakerMemory } from './maker-memory-host.js';
+import { attachAgentsToMakerMemory, createDesktopMakerMemoryManager } from './maker-memory-host.js';
+import { createMemoryReviewOneShot } from './memory-review-one-shot.js';
import { prepareExternalCodexSessionForResume, readCodexThreadStorageForArchive } from './codex-local-sessions.js';
import {
rehydrateCloseSuppression,
@@ -945,7 +946,12 @@ export function getMaker(): Maker {
// Maker Memory manager — 先建 (agents={}), agents 创建后再 attach。
// sqliteFactory + basePath 在工厂内部用 Electron API 准备好, maker-core 拿不到。
- const makerMemoryManager = createDesktopMakerMemoryManager();
+ const makerMemoryManager = createDesktopMakerMemoryManager({
+ // memory_review 不锁死 review agent 的默认模型(haiku 在部分供应商网关上
+ // 不在账号可用清单, 403 user_model_access_denied): 先走共享辅助模型链,
+ // 链上没产出再由 manager 回退默认路由。
+ reviewOneShot: createMemoryReviewOneShot(),
+ });
// Plugin registry — 先于 agent 构造, 让 createDesktopMcpProviders 拿 registry
// 包进每个 MCP provider 的 isEnabled 闭包里。registry 内部读 <userData>/plugin-prefs.json
diff --git a/apps/desktop/src/main/maker-host/maker-memory-host.ts b/apps/desktop/src/main/maker-host/maker-memory-host.ts
index 30352926f8..ab1bbd411f 100644
--- a/apps/desktop/src/main/maker-host/maker-memory-host.ts
+++ b/apps/desktop/src/main/maker-host/maker-memory-host.ts
@@ -26,6 +26,7 @@ import {
parseBotMemoryScopeKey,
type AgentKind,
type BaseAgent,
+ type MakerMemoryManagerDeps,
type SqliteFactory,
} from '@cindy/maker-core';
@@ -64,7 +65,9 @@ const sqliteFactory: SqliteFactory = (filePath) => {
* - ownerScopeKey 注入脱敏作用域键 (mode + owner hash + generation), 登录/
* 登出/切账号 (commit 使 generation+1) 后 manager 自动关闭旧 store 重建新根。
*/
-export function createDesktopMakerMemoryManager(): MakerMemoryManager {
+export function createDesktopMakerMemoryManager(
+ options: { reviewOneShot?: MakerMemoryManagerDeps['reviewOneShot'] } = {},
+): MakerMemoryManager {
// owner 存储根: 有 owner → userData/owners/<hash>; 无 owner → null (fail-closed,
// 不再退到 %TEMP%\cindy-no-session\<pid>\, 那是 #2341 静默丢失的根源)。
const resolveBasePath = (): string | null => {
@@ -117,6 +120,10 @@ export function createDesktopMakerMemoryManager(): MakerMemoryManager {
// 停用轴:review 的 oneShot 是新的付费调用,默认 one-shot 路由被停用时不派发
// (PR #744 review 第十六轮)。
isOneShotRouteDisabled: (agent) => isAgentOneShotRouteDisabled(agent),
+ // memory_review 自定义一次性调用(共享辅助模型链)。缺席 = manager 用
+ // reviewAgent 默认路由(claude haiku) — 该默认模型在部分供应商网关上不在
+ // 账号可用清单内会 403, 所以 desktop 装配时注入(见 maker-host/index.ts)。
+ reviewOneShot: options.reviewOneShot,
});
}
diff --git a/apps/desktop/src/main/maker-host/memory-review-one-shot.ts b/apps/desktop/src/main/maker-host/memory-review-one-shot.ts
new file mode 100644
index 0000000000..307481bd28
--- /dev/null
+++ b/apps/desktop/src/main/maker-host/memory-review-one-shot.ts
@@ -0,0 +1,76 @@
+/**
+ * apps/desktop/src/main/maker-host/memory-review-one-shot.ts
+ *
+ * memory_review 的一次性文本调用 — 走共享辅助模型链。链上没产出返回 null, 让
+ * MakerMemoryManager 以可读原因 fail-closed(不再回退 review agent 的默认
+ * oneShot 路由: 那是本账号无权模型, 只会给出与真实原因无关的 403)。
+ *
+ * 为什么需要这条链: review agent (claude-code) 的默认模型 claude-haiku-4-5 在部分
+ * 供应商网关上不在账号可用清单内, 硬编码默认路由会让 memory_review 对这些账号
+ * 100% 失败(403 user_model_access_denied, 2026-10-14 实测)。辅助模型链按用户配置的
+ * 可用模型逐候选派发, 复用与自动命名同一套基础设施(停用轴 / owner 边界守卫 /
+ * 候选诊断), 不新造平行路由。
+ *
+ * 边界与停用语义由 requestUtilityText 内部保证(owner 快照 + beforeDispatch 复核 +
+ * readModelDisableOverrides); 这里只做 maker 就绪判断与失败降级, 不重复造守卫。
+ */
+
+import type { Maker } from '@cindy/maker-core';
+
+import type { UtilityTextResult } from '../../shared/utilityTextResult.js';
+import { requestUtilityText } from '../utility-model/oneShotCandidates.js';
+import { createLogger } from '../logger.js';
+import { getMakerIfReady } from './index.js';
+
+const log = createLogger('maker-host/memory-review-one-shot');
+
+export interface MemoryReviewOneShotDeps {
+ getMaker: () => Maker | null;
+ requestText: (
+ maker: Maker,
+ prompt: string,
+ opts: Parameters<typeof requestUtilityText>[2],
+ ) => Promise<UtilityTextResult>;
+}
+
+const DEFAULT_DEPS: MemoryReviewOneShotDeps = {
+ getMaker: getMakerIfReady,
+ requestText: requestUtilityText,
+};
+
+export type MemoryReviewOneShot = (
+ prompt: string,
+ opts: { maxTokens: number; timeoutMs: number },
+) => Promise<string | null>;
+
+/**
+ * 生成注入给 MakerMemoryManager 的 reviewOneShot。任何「链上没产出」都返回 null
+ * (不抛), 由 manager 决定如何收口 — 保持 fail-closed 的决策点在 manager 一侧。
+ */
+export function createMemoryReviewOneShot(
+ deps: Partial<MemoryReviewOneShotDeps> = {},
+): MemoryReviewOneShot {
+ const resolved: MemoryReviewOneShotDeps = { ...DEFAULT_DEPS, ...deps };
+ return async (prompt, opts) => {
+ const maker = resolved.getMaker();
+ if (!maker) return null;
+ try {
+ const result = await resolved.requestText(maker, prompt, {
+ maxTokens: opts.maxTokens,
+ timeoutMs: opts.timeoutMs,
+ // review 要的是一段简短计划, provider 默认思考只会烧 token。
+ disableReasoning: true,
+ });
+ if (result.ok) {
+ return result.text.trim().length > 0 ? result.text : null;
+ }
+ log.warn('memory review utility chain produced no usable text', { reason: result.reason });
+ return null;
+ } catch (error) {
+ log.warn('memory review utility chain failed', {
+ errorName: error instanceof Error ? error.name : typeof error,
+ });
+ return null;
+ }
+ };
+}
diff --git a/packages/lizi-mcps/src/memory/review.ts b/packages/lizi-mcps/src/memory/review.ts
index 03b0cfa96d..1594c95c30 100644
--- a/packages/lizi-mcps/src/memory/review.ts
+++ b/packages/lizi-mcps/src/memory/review.ts
@@ -5,7 +5,7 @@
* 不自动执行 delete/consolidate — 让调用方 LLM 在 turn 内决定 + 走标准 tool,
* 保留可观测性 (跟 Claude Code Auto Dream 同思路, 但不开后台 cron)。
*
- * 内部走 manager.runReview 跑一次 host 端 oneShot (默认 claude haiku, 最便宜)。
+ * 内部走 manager.runReview 跑一次 host 端一次性调用(走设置里的辅助模型)。
* 大概几秒钟返回一段 markdown 建议。
*/
@@ -20,7 +20,7 @@ export function registerMemoryReviewTool(registry: MemoryToolRegistry, deps: Mem
description:
'让 LLM 自审当前 workdir 的所有 memory, 输出 ≤200 字建议: 哪些可合并 / 删除 / 矛盾。' +
' 不自动执行 — 调用方 LLM 拿到建议后自行决定调 memory_delete / memory_consolidate。' +
- ' 用 host 端 haiku 跑, 几秒钟返回。',
+ ' 用设置的辅助模型跑, 几秒钟返回。',
inputShape: {},
handler: async () =>
// 必须走 withStore: list/search/write 已按解析后的 scope 开 store。
diff --git a/packages/maker-core/src/memory/manager.ts b/packages/maker-core/src/memory/manager.ts
index 1b324abc25..5d26cd472f 100644
--- a/packages/maker-core/src/memory/manager.ts
+++ b/packages/maker-core/src/memory/manager.ts
@@ -41,6 +41,9 @@ import type { Logger } from '../interfaces/logger.js';
/** 工厂函数: 给一个绝对文件路径, 返回 better-sqlite3 Database 实例。host 注入。 */
export type SqliteFactory = (filePath: string) => Database.Database;
+/** review 一次性调用预算: 一段 ≤200 词的建议, 给足 60s(LLM 冷启 + 长 dump)。 */
+const REVIEW_ONE_SHOT_OPTS = { maxTokens: 800, timeoutMs: 60_000 } as const;
+
export interface MakerMemoryManagerDeps {
/** Maker memory 文件根目录, host 注入 (e.g. <electron userData>/maker-memory) */
basePath: string;
@@ -94,6 +97,19 @@ export interface MakerMemoryManagerDeps {
* 缺席 = 不裁决(未接入停用设置的宿主)。
*/
isOneShotRouteDisabled?: (agent: AgentKind) => Promise<boolean>;
+ /**
+ * memory_review 的一次性文本调用(host 注入)。返回 null / 空串 = 链上没产出,
+ * manager 不再回退 reviewAgent 的默认 oneShot 路由(那是本账号无权模型的死路),
+ * 直接以可读原因 fail-closed。
+ *
+ * desktop 注入的实现走共享辅助模型链: review agent 的默认模型(claude-haiku-4-5)
+ * 在部分供应商网关上不在账号可用清单内(403 user_model_access_denied), 硬编码
+ * 默认路由会让 memory_review 对这些账号 100% 失败(2026-10-14 实测)。
+ */
+ reviewOneShot?: (
+ prompt: string,
+ opts: { maxTokens: number; timeoutMs: number },
+ ) => Promise<string | null>;
logger: Logger;
/** 配置覆盖 */
config?: Partial<MemoryConfig>;
@@ -892,10 +908,6 @@ export class MakerMemoryManager {
return { suggestions: 'No memories in this workdir yet.' };
}
const reviewAgentKind = this.deps.reviewAgent ?? 'claude-code';
- const agent = this.deps.agents[reviewAgentKind];
- if (!agent) {
- throw new Error(`runReview: review agent '${reviewAgentKind}' not registered`);
- }
if (await this.deps.isOneShotRouteDisabled?.(reviewAgentKind)) {
throw new Error(
`runReview: one-shot route for '${reviewAgentKind}' is disabled in settings`,
@@ -917,7 +929,32 @@ export class MakerMemoryManager {
summary,
].join('\n');
- const suggestions = await agent.oneShot(prompt, { maxTokens: 800, timeoutMs: 60_000 });
+ // host 注入的自定义一次性调用优先(共享辅助模型链); agent 查找推迟到这里: 注入链
+ // 缺席时未注册 review agent 才该把 review 硬拦死。
+ const injectedChain = this.deps.reviewOneShot !== undefined;
+ const custom = injectedChain
+ ? await this.deps.reviewOneShot!(prompt, REVIEW_ONE_SHOT_OPTS)
+ : null;
+ // 辅助链的 await 可能横跨账号边界(链因此中止并返回 null)。此时旧 owner 的
+ // dump 一条都不能再发: 回落默认路由会读新账号凭据, 而末尾复核只能挡住返回,
+ // 撤不回已发出的 prompt。任一分支出发前必须重新复核, fail-closed 抛出。
+ this.assertScopeUnchanged(scopeAtEntry);
+ if (custom && custom.trim().length > 0) {
+ return { suggestions: custom };
+ }
+ // 宿主注入了链 = 用户显式指定了本次审查的路由。链上没产出时再回退 review agent
+ // 默认路由, 只会落到硬编码的 claude-haiku-4-5, 对没有 Anthropic 权限的账号必然
+ // 403, 用户看到的是与真实原因无关的死路(2026-10-14 实测)。改成一句可读原因。
+ if (injectedChain) {
+ throw new Error(
+ 'runReview: auxiliary model chain produced no text; configure an available auxiliary model in Settings',
+ );
+ }
+ const agent = this.deps.agents[reviewAgentKind];
+ if (!agent) {
+ throw new Error(`runReview: review agent '${reviewAgentKind}' not registered`);
+ }
+ const suggestions = await agent.oneShot(prompt, REVIEW_ONE_SHOT_OPTS);
// oneShot await 后、返回前复核 (review #2388 Codex 21st P1): 边界在 LLM
// 调用期间发生则建议文本基于旧 owner 数据 — 不得向当前 session 报 ok。
this.assertScopeUnchanged(scopeAtEntry);
diff --git a/packages/maker-core/src/memory/review.test.ts b/packages/maker-core/src/memory/review.test.ts
new file mode 100644
index 0000000000..96e5e62fb6
--- /dev/null
+++ b/packages/maker-core/src/memory/review.test.ts
@@ -0,0 +1,175 @@
+/**
+ * MakerMemoryManager.runReview 的 reviewOneShot 注入与回退语义回归。
+ *
+ * 背景: review agent (claude-code) 的默认模型 claude-haiku-4-5 在部分供应商网关上
+ * 不在账号可用清单内(403 user_model_access_denied), 硬编码默认路由会让 memory_review
+ * 对这些账号 100% 失败。manager 新增可选 reviewOneShot 注入点: host(desktop)走共享
+ * 辅助模型链; 注入后链上没产出(null/空串)必须 fail-closed 成可读原因, 不得回退
+ * 默认路由。未注入的宿主保持既有默认路由行为不变。
+ */
+
+import { mkdtemp, rm } from 'node:fs/promises';
+import { tmpdir } from 'node:os';
+import path from 'node:path';
+
+import DatabaseCtor from 'better-sqlite3';
+import type Database from 'better-sqlite3';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+
+import type { BaseAgent } from '../agents/base-agent.js';
+import type { Logger } from '../interfaces/logger.js';
+import { MakerMemoryManager, type MakerMemoryManagerDeps } from './manager.js';
+
+const noopLogger: Logger = {
+ trace: () => {}, debug: () => {}, info: () => {}, warn: () => {}, error: () => {}, fatal: () => {},
+ child: () => noopLogger,
+};
+
+const WORKDIR = '/repo/workdir';
+
+let root: string;
+
+beforeEach(async () => {
+ root = await mkdtemp(path.join(tmpdir(), 'memory-review-'));
+});
+afterEach(async () => {
+ await rm(root, { recursive: true, force: true });
+});
+
+const sqliteFactory = (filePath: string): Database.Database => new DatabaseCtor(filePath);
+
+function fakeAgent(text: string): BaseAgent {
+ return { oneShot: vi.fn(async () => text) } as unknown as BaseAgent;
+}
+
+async function makeManager(
+ agents: Partial<Record<string, BaseAgent>>,
+ reviewOneShot?: MakerMemoryManagerDeps['reviewOneShot'],
+): Promise<MakerMemoryManager> {
+ const manager = new MakerMemoryManager({
+ basePath: root,
+ sqliteFactory,
+ agents,
+ logger: noopLogger,
+ initialEnabled: true,
+ ownerScopeKey: () => 'test:owner:1',
+ reviewOneShot,
+ });
+ await manager.write(WORKDIR, {
+ type: 'user', name: 'pref', title: 'Preference',
+ description: 'Durable preference', body: 'Keep this preference.',
+ });
+ return manager;
+}
+
+describe('MakerMemoryManager.runReview · reviewOneShot 注入与回退', () => {
+ it('uses the injected reviewOneShot and does not touch the default agent route', async () => {
+ const agent = fakeAgent('default-route suggestion');
+ const reviewOneShot = vi.fn(async () => 'utility-chain suggestion');
+ const manager = await makeManager({ 'claude-code': agent }, reviewOneShot);
+ try {
+ const result = await manager.runReview(WORKDIR);
+ expect(result.suggestions).toBe('utility-chain suggestion');
+ expect(reviewOneShot).toHaveBeenCalledTimes(1);
+ // 注入生效时默认路由一次都不该被调用(它正是 403 的那条)。
+ expect(agent.oneShot).not.toHaveBeenCalled();
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('forwards the review budget to the injected call', async () => {
+ const reviewOneShot = vi.fn(async () => 'ok');
+ const manager = await makeManager({}, reviewOneShot);
+ try {
+ await manager.runReview(WORKDIR);
+ expect(reviewOneShot).toHaveBeenCalledWith(expect.any(String), { maxTokens: 800, timeoutMs: 60_000 });
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('fails closed with a readable reason when the chain yields null', async () => {
+ const agent = fakeAgent('default-route suggestion');
+ const manager = await makeManager({ 'claude-code': agent }, async () => null);
+ try {
+ // 回退默认路由只会落到硬编码 claude-haiku-4-5, 对无 Anthropic 权限的账号
+ // 必然 403(2026-10-14 实测) — 不得回退, 必须点名真实原因。
+ await expect(manager.runReview(WORKDIR)).rejects.toThrow(/auxiliary model chain produced no text/);
+ expect(agent.oneShot).not.toHaveBeenCalled();
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('fails closed when the chain yields only whitespace', async () => {
+ const agent = fakeAgent('default-route suggestion');
+ const manager = await makeManager({ 'claude-code': agent }, async () => ' \n ');
+ try {
+ await expect(manager.runReview(WORKDIR)).rejects.toThrow(/auxiliary model chain produced no text/);
+ expect(agent.oneShot).not.toHaveBeenCalled();
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('keeps the historical default route when no reviewOneShot is injected', async () => {
+ const agent = fakeAgent('default-route suggestion');
+ const manager = await makeManager({ 'claude-code': agent });
+ try {
+ const result = await manager.runReview(WORKDIR);
+ expect(result.suggestions).toBe('default-route suggestion');
+ expect(agent.oneShot).toHaveBeenCalledTimes(1);
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('still short-circuits with no records to review', async () => {
+ const manager = new MakerMemoryManager({
+ basePath: root,
+ sqliteFactory,
+ agents: {},
+ logger: noopLogger,
+ initialEnabled: true,
+ ownerScopeKey: () => 'test:owner:1',
+ reviewOneShot: vi.fn(async () => 'should not run'),
+ });
+ try {
+ const result = await manager.runReview('/repo/empty');
+ expect(result.suggestions).toBe('No memories in this workdir yet.');
+ } finally {
+ manager.dispose();
+ }
+ });
+
+ it('fails closed when the account switches during the injected call (no cross-account send)', async () => {
+ // Greptile P1 回归: 辅助链 await 横跨账号边界时链会中止并返回 null, 若此时
+ // 直接回落默认路由, 旧 owner 的 dump 会经新账号凭据发出且不可撤回。任一分支
+ // 出发前必须复核 scope 并抛出, 默认路由一次都不被调用。
+ const agent = fakeAgent('default-route suggestion');
+ let scope = 'test:owner:1';
+ const manager = new MakerMemoryManager({
+ basePath: root,
+ sqliteFactory,
+ agents: { 'claude-code': agent },
+ logger: noopLogger,
+ initialEnabled: true,
+ ownerScopeKey: () => scope,
+ reviewOneShot: async () => {
+ scope = 'test:owner:2'; // 链等待期间用户切换账号
+ return null;
+ },
+ });
+ await manager.write(WORKDIR, {
+ type: 'user', name: 'pref', title: 'Preference',
+ description: 'Durable preference', body: 'Keep this preference.',
+ });
+ try {
+ await expect(manager.runReview(WORKDIR)).rejects.toThrow(/owner scope/i);
+ expect(agent.oneShot).not.toHaveBeenCalled();
+ } finally {
+ manager.dispose();
+ }
+ });
+});