Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ describe('localized main shell contract', () => {

it('surfaces permission denial in Chinese instead of raw English backend text', async () => {
const components = await readFile(resolve(process.cwd(), '..', '..', 'packages', 'ui', 'src', 'components.tsx'), 'utf8');
const aiSdk = await readFile(resolve(process.cwd(), '..', '..', 'packages', 'runtime', 'src', 'ai-sdk-backend.ts'), 'utf8');
const toolRuntime = await readFile(resolve(process.cwd(), '..', '..', 'packages', 'runtime', 'src', 'tool-runtime.ts'), 'utf8');
const piAgent = await readFile(resolve(process.cwd(), '..', '..', 'packages', 'runtime', 'src', 'pi-agent-backend.ts'), 'utf8');

assert.match(components, /formatUserVisibleToolText\(text: string\)[\s\S]*User denied permission[\s\S]*用户已拒绝权限请求/);
Expand All @@ -433,8 +433,8 @@ describe('localized main shell contract', () => {
assert.match(components, /item\.result && !permissionDenied/);
assert.match(components, /formatUserVisibleToolText\(redactSecrets\(extractErrorText\(props\.result\)\)\)/);
assert.match(components, /capLines\(formatUserVisibleToolText\(redactSecrets\(content\.text\)\)\)/);
assert.match(aiSdk, /const reason = '用户已拒绝权限请求';/);
assert.match(toolRuntime, /const reason = '用户已拒绝权限请求';/);
assert.match(piAgent, /text: '用户已拒绝权限请求'/);
assert.doesNotMatch(`${aiSdk}\n${piAgent}`, /User denied permission/);
assert.doesNotMatch(`${toolRuntime}\n${piAgent}`, /User denied permission/);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ describe('web-search renderer boundary (PR-WEB-SEARCH-TAVILY-0)', () => {

it('WebSearch agent errors render as repair-oriented cards, not raw JSON', async () => {
const ui = await readFile(join(REPO_ROOT, 'packages/ui/src/components.tsx'), 'utf8');
const runtime = await readFile(join(REPO_ROOT, 'packages/runtime/src/ai-sdk-backend.ts'), 'utf8');
const runtime = await readFile(join(REPO_ROOT, 'packages/runtime/src/tool-runtime.ts'), 'utf8');
const agentTool = await readFile(join(REPO_ROOT, 'apps/desktop/src/main/web-search/agent-tool.ts'), 'utf8');
const coreEvents = await readFile(join(REPO_ROOT, 'packages/core/src/events.ts'), 'utf8');
const overlay = ui.match(/function OverlayPreview[\s\S]*?if \(content\.kind === 'json'\)/);
Expand Down
Loading