Keep per-site probe settings reliable before merge

Refresh the PR onto current main and close the remaining probe-setting review gaps: the primary site save now persists the latency threshold, the site row type carries that field without an any-cast, active probe streams are aborted on unmount, and all-model one-shot probes get the longer timeout they need.

Constraint: PR #510 must preserve the per-site model probe feature while merging cleanly into current main.
Rejected: Leave threshold persistence behind the separate probe-settings button | the primary save path would still silently drop user changes.
Rejected: Keep the SiteRow any-cast | it hides API/schema drift for the new persisted field.
Confidence: high
Scope-risk: narrow
Directive: Keep probe setting fields represented in the typed site save payload and covered by focused web API/editor tests.
Tested: npm run typecheck; npm run repo:drift-check; npx vitest run --root . src/server/db/schemaContract.test.ts src/server/db/schemaArtifactGenerator.test.ts src/server/db/schemaIntrospection.test.ts src/server/db/schemaParity.test.ts src/web/api.test.ts src/web/pages/helpers/sitesEditor.test.ts src/web/pages/sites.disabled-models-save.test.tsx src/web/pages/sites.edit-scroll.test.tsx
Not-tested: Full npm test.
This commit is contained in:
cita-777
2026-05-08 16:51:05 +08:00
38 changed files with 2466 additions and 124 deletions
@@ -26,6 +26,10 @@ describe('buildSiteSaveAction', () => {
customHeaders: '{"x-site-token":"alpha"}',
useSystemProxy: false,
globalWeight: 1.2,
postRefreshProbeEnabled: true,
postRefreshProbeModel: 'gpt-4o',
postRefreshProbeScope: 'single',
postRefreshProbeLatencyThresholdMs: 2500,
},
);
@@ -44,6 +48,10 @@ describe('buildSiteSaveAction', () => {
customHeaders: '{"x-site-token":"alpha"}',
useSystemProxy: false,
globalWeight: 1.2,
postRefreshProbeEnabled: true,
postRefreshProbeModel: 'gpt-4o',
postRefreshProbeScope: 'single',
postRefreshProbeLatencyThresholdMs: 2500,
},
});
});
+4
View File
@@ -42,6 +42,10 @@ export type SiteSavePayload = {
}>;
customHeaders: string;
globalWeight: number;
postRefreshProbeEnabled?: boolean;
postRefreshProbeModel?: string;
postRefreshProbeScope?: 'single' | 'all';
postRefreshProbeLatencyThresholdMs?: number;
};
type SiteSaveAction =