fix(repository-plugin): reject incomplete MCP publication

This commit is contained in:
Tianyi Cui
2026-08-09 00:50:54 +08:00
parent 29b3e3fa84
commit cc7bd4948d
20 changed files with 89 additions and 43 deletions

View File

@@ -330,7 +330,7 @@ describe('prepared repository plugin Loader composition', () => {
await ctx.plugin(RepositoryPlugin)
await expect(ctx.loader.create({
name: pathToFileURL(join(directory, RepositoryPlugin.PREPARED_ENTRY_FILENAME)).href,
})).rejects.toThrow('initial connection or tool discovery failed')
})).rejects.toThrow('initial connection or tool synchronization failed')
expect(ctx.tools.schemas().some(tool => tool.name.startsWith('mcp__offline__'))).toBe(false)
await ctx.fiber.dispose()
})
@@ -593,6 +593,12 @@ describe('configured GitHub repository sources', () => {
message: expect.stringContaining('must declare a non-empty scripts.prepack') as string,
}) as Error,
})
await expect(loadPreparedRepository(ctx, { resolve: async () => root }, 'github:owner/repository#old&path:/.dsh-plugin'))
.rejects.toMatchObject({
cause: expect.objectContaining({
message: expect.stringContaining('Clear the matching repository cache generation') as string,
}) as Error,
})
await ctx.fiber.dispose()
})