1 Commits
Author SHA1 Message Date
lofyer 1a8e110866 fix: make skill budget test cross-platform
Cross-platform packages / Validate source (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (arm64, linux, ubuntu-24.04-arm) (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (arm64, macos, macos-15) (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (arm64, windows, windows-2025) (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (x64, linux, ubuntu-24.04) (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (x64, macos, macos-15-intel) (push) Has been cancelled
Cross-platform packages / ${{ matrix.platform }} ${{ matrix.arch }} (x64, windows, windows-2025) (push) Has been cancelled
Cross-platform packages / Publish GitHub Release (push) Has been cancelled
2026-08-10 00:40:52 +08:00
3 changed files with 13 additions and 6 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "goodbuddy", "name": "goodbuddy",
"version": "0.8.9", "version": "0.8.10",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "goodbuddy", "name": "goodbuddy",
"version": "0.8.9", "version": "0.8.10",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@modelcontextprotocol/sdk": "^1.30.0", "@modelcontextprotocol/sdk": "^1.30.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "goodbuddy", "name": "goodbuddy",
"version": "0.8.9", "version": "0.8.10",
"private": true, "private": true,
"description": "Secure desktop AI workspace with controlled Agent Runtimes", "description": "Secure desktop AI workspace with controlled Agent Runtimes",
"desktopName": "GoodBuddy", "desktopName": "GoodBuddy",
@@ -58,7 +58,8 @@ class FailingBrowserProfileService extends BrowserProfileService {
async function writeSkill( async function writeSkill(
root: string, root: string,
id: string, id: string,
name: string name: string,
body = '仅用于离线测试。'
): Promise<void> { ): Promise<void> {
const directory = join(root, id) const directory = join(root, id)
await mkdir(directory, { recursive: true }) await mkdir(directory, { recursive: true })
@@ -76,7 +77,7 @@ async function writeSkill(
'', '',
`# ${name}`, `# ${name}`,
'', '',
'仅用于离线测试。' body
].join('\n'), ].join('\n'),
'utf8' 'utf8'
) )
@@ -327,7 +328,12 @@ describe('CapabilityService', () => {
it('exposes the skill directory and names skills dropped by the budget', async () => { it('exposes the skill directory and names skills dropped by the budget', async () => {
const { builtinRoot, service } = await createService() const { builtinRoot, service } = await createService()
await writeSkill(builtinRoot, 'oversized-skill', '超长技能') await writeSkill(
builtinRoot,
'oversized-skill',
'超长技能',
'超长技能说明。'.repeat(80)
)
const instructions = await service.getSkillInstructions('model') const instructions = await service.getSkillInstructions('model')
expect(instructions).toContain(join(builtinRoot, 'document-writing')) expect(instructions).toContain(join(builtinRoot, 'document-writing'))
@@ -335,6 +341,7 @@ describe('CapabilityService', () => {
const truncated = await service.getSkillInstructions('model', 200) const truncated = await service.getSkillInstructions('model', 200)
expect(truncated).toContain('因超出注入上限未加载') expect(truncated).toContain('因超出注入上限未加载')
expect(truncated).toContain('超长技能')
const fullyTruncated = await service.getSkillInstructions('model', 1) const fullyTruncated = await service.getSkillInstructions('model', 1)
expect(fullyTruncated).toContain('因超出注入上限未加载') expect(fullyTruncated).toContain('因超出注入上限未加载')