chore(integration): snapshot local main worktree
This commit is contained in:
@@ -7,6 +7,7 @@ import type { PiProviderSelection } from '@electron/coding-runtime/pi/provider-c
|
||||
import {
|
||||
buildPiManagedInputArgs,
|
||||
getPiManagedPaths,
|
||||
MAKELORE_DEFAULT_LANGUAGE_PROMPT,
|
||||
materializePiAgentResources,
|
||||
resolveBundledCodingSkillsDir,
|
||||
resolveExplicitCodingSkillPaths,
|
||||
@@ -59,6 +60,9 @@ describe('Pi managed resource loader', () => {
|
||||
});
|
||||
|
||||
expect(await readFile(resources.promptPath, 'utf8')).toBe(prompt);
|
||||
expect(await readFile(resources.languagePromptPath, 'utf8')).toBe(MAKELORE_DEFAULT_LANGUAGE_PROMPT);
|
||||
expect(MAKELORE_DEFAULT_LANGUAGE_PROMPT).toContain('默认使用简体中文');
|
||||
expect(MAKELORE_DEFAULT_LANGUAGE_PROMPT).toContain('可见的思考过程');
|
||||
expect(resources.skillIds).toEqual(['grilling']);
|
||||
expect(resources.skillPaths).toEqual([path.join(fixture.skillsDir, 'grilling', 'SKILL.md')]);
|
||||
expect(JSON.stringify(resources.summary)).not.toContain(prompt);
|
||||
@@ -68,6 +72,7 @@ describe('Pi managed resource loader', () => {
|
||||
projectId: 'project-1',
|
||||
agentId: 'agent-1',
|
||||
promptFile: 'agent-1.md',
|
||||
languagePromptFile: 'agent-1.language.md',
|
||||
skillIds: ['grilling'],
|
||||
revision: { provider: 3, resources: 7 },
|
||||
});
|
||||
@@ -103,14 +108,32 @@ describe('Pi managed resource loader', () => {
|
||||
'--model', 'model-a',
|
||||
'--thinking', 'medium',
|
||||
'--system-prompt', resources.promptPath,
|
||||
'--append-system-prompt', resources.languagePromptPath,
|
||||
'--skill', path.join(fixture.skillsDir, 'agent-browser', 'SKILL.md'),
|
||||
]);
|
||||
expect(serialized).not.toContain(prompt);
|
||||
expect(serialized).not.toContain(MAKELORE_DEFAULT_LANGUAGE_PROMPT);
|
||||
expect(serialized).not.toContain('private-account-id');
|
||||
expect(serialized).not.toContain(path.join(fixture.projectDir, '.pi'));
|
||||
expect(serialized).not.toContain(path.join(fixture.projectDir, '.agents'));
|
||||
});
|
||||
|
||||
it('keeps the platform Chinese-language prompt when the Agent prompt is empty', async () => {
|
||||
const fixture = await fixtureRoot();
|
||||
const resources = await materializePiAgentResources({
|
||||
userDataDir: fixture.userDataDir,
|
||||
projectId: 'project-1',
|
||||
agentId: 'agent-1',
|
||||
prompt: '',
|
||||
skillIds: [],
|
||||
bundledSkillsDir: fixture.skillsDir,
|
||||
revision: { provider: 1, resources: 1 },
|
||||
});
|
||||
|
||||
expect(await readFile(resources.promptPath, 'utf8')).toBe('');
|
||||
expect(await readFile(resources.languagePromptPath, 'utf8')).toBe(MAKELORE_DEFAULT_LANGUAGE_PROMPT);
|
||||
});
|
||||
|
||||
it('rejects unknown skills and unsafe managed path segments', async () => {
|
||||
const fixture = await fixtureRoot();
|
||||
await expect(resolveExplicitCodingSkillPaths(fixture.skillsDir, ['not-bundled']))
|
||||
|
||||
Reference in New Issue
Block a user