Skip to content

Commit 8598d33

Browse files
committed
fix: exclude test/.skip suites and dedupe protocol error domains
Add **/test/.skip/** to package vitest configs so parked suites never load. Re-export kosong protocol errors from llm-adapter to avoid dual provider.api_error domain registration.
1 parent c2ff16d commit 8598d33

21 files changed

Lines changed: 25 additions & 80 deletions

File tree

‎apps/desktop/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config'
22

33
export default defineConfig({
44
test: {
5+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
56
include: ['tests/**/*.spec.ts'],
67
},
78
})

‎apps/pythinker-code/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
},
1212
},
1313
test: {
14+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
1415
name: 'cli',
1516
env: {
1617
PYTHINKER_LOG_LEVEL: 'off',

‎apps/vis/server/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
5+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
56
name: 'vis-server',
67
include: ['test/**/*.test.ts'],
78
},

‎apps/vis/web/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
5+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
56
name: 'vis-web',
67
include: ['test/**/*.test.ts', 'src/**/*.test.ts'],
78
environment: 'node',

‎apps/vscode/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { vscodeProjects } from './vitest.projects';
33

44
export default defineConfig({
55
test: {
6+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
67
projects: vscodeProjects,
78
},
89
});

‎packages/acp-server/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default defineConfig({
4747
// full barrel, which imports `*.md?raw` prompt templates.
4848
plugins: [rawTextPlugin(), hashImportsPlugin()],
4949
test: {
50+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
5051
name: 'acp-server',
5152
include: ['test/**/*.{test,e2e}.ts'],
5253
},
Lines changed: 5 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,5 @@
1-
import { CoreErrors, registerErrorDomain, type ErrorDomain } from '#/_base/errors/codes';
2-
import { Error2, isError2 } from '#/_base/errors/errors';
3-
import {
4-
CONTEXT_OVERFLOW_ERROR_CODE,
5-
PROVIDER_API_ERROR_CODE,
6-
PROVIDER_AUTH_ERROR_CODE,
7-
PROVIDER_CONNECTION_ERROR_CODE,
8-
PROVIDER_FILTERED_ERROR_CODE,
9-
PROVIDER_OVERLOADED_ERROR_CODE,
10-
PROVIDER_RATE_LIMIT_ERROR_CODE,
11-
throwIfAbortError,
12-
} from '#/kosong/contract/errors';
13-
14-
export { sanitizeStatusErrorMessage } from '#/kosong/contract/errors';
15-
16-
export const ProtocolErrors = {
17-
codes: {
18-
PROVIDER_API_ERROR: PROVIDER_API_ERROR_CODE,
19-
PROVIDER_FILTERED: PROVIDER_FILTERED_ERROR_CODE,
20-
PROVIDER_RATE_LIMIT: PROVIDER_RATE_LIMIT_ERROR_CODE,
21-
PROVIDER_AUTH_ERROR: PROVIDER_AUTH_ERROR_CODE,
22-
PROVIDER_CONNECTION_ERROR: PROVIDER_CONNECTION_ERROR_CODE,
23-
PROVIDER_OVERLOADED: PROVIDER_OVERLOADED_ERROR_CODE,
24-
CONTEXT_OVERFLOW: CONTEXT_OVERFLOW_ERROR_CODE,
25-
},
26-
retryable: [
27-
'provider.rate_limit',
28-
'provider.connection_error',
29-
'provider.overloaded',
30-
'context.overflow',
31-
],
32-
info: {
33-
'provider.rate_limit': {
34-
title: 'Provider rate limit',
35-
retryable: true,
36-
public: true,
37-
action: 'Retry after the provider rate limit resets.',
38-
},
39-
'provider.filtered': {
40-
title: 'Provider filtered response',
41-
retryable: false,
42-
public: true,
43-
action: 'Revise the prompt or model configuration to avoid provider safety filtering.',
44-
},
45-
'provider.auth_error': {
46-
title: 'Provider authentication failed',
47-
retryable: false,
48-
public: true,
49-
action: 'Check provider credentials and authentication configuration.',
50-
},
51-
'provider.overloaded': {
52-
title: 'Provider overloaded',
53-
retryable: true,
54-
public: true,
55-
action: 'Retry after the provider recovers from overload.',
56-
},
57-
'context.overflow': {
58-
title: 'Context overflow',
59-
retryable: true,
60-
public: true,
61-
action: 'Compact the conversation or retry with fewer tokens.',
62-
},
63-
},
64-
} as const satisfies ErrorDomain;
65-
66-
registerErrorDomain(ProtocolErrors);
67-
68-
export function translateProviderError(error: unknown): Error2 {
69-
throwIfAbortError(error);
70-
if (isError2(error)) {
71-
return error;
72-
}
73-
if (error instanceof Error) {
74-
return new Error2(CoreErrors.codes.INTERNAL, error.message, {
75-
name: error.name,
76-
cause: error,
77-
});
78-
}
79-
return new Error2(CoreErrors.codes.INTERNAL, String(error), { cause: error });
80-
}
1+
export {
2+
ProtocolErrors,
3+
sanitizeStatusErrorMessage,
4+
translateProviderError,
5+
} from '#/llm-adapter/protocol/errors';

‎packages/agent-core-v2/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
5+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
56
name: 'agent-core-v2',
67
include: ['test/**/*.{test,e2e,integration}.ts', 'src/human/test/**/*.test.ts'],
78
setupFiles: ['test/setup.ts'],

‎packages/agent-gateway/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { rawTextPlugin } from '../../build/raw-text-plugin.mjs';
77
export default defineConfig({
88
plugins: [rawTextPlugin()],
99
test: {
10+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
1011
name: 'agent-gateway',
1112
include: ['test/**/*.{test,e2e}.ts'],
1213
setupFiles: ['test/setup.ts'],

‎packages/klient/vitest.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
5+
exclude: ['**/node_modules/**', '**/dist/**', '**/test/.skip/**'],
56
name: 'klient',
67
include: ['test/**/*.test.ts'],
78
testTimeout: 15_000,

0 commit comments

Comments
 (0)