Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): make the settings specs typecheck\n\nMy four settings specs from the previous round failed `tsc`, which I did not\ncatch: vitest transpiles with esbuild/oxc and strips types without checking\nthem, so a green `vitest run` says nothing about the typecheck lane. Prettier\nand eslint do not catch it either. 17 errors, all in the mocks:\n\n- `CommandResponse<T>` requires `logs`, and every `mockResolvedValue({ result })`\n literal omitted it\n- `openhumanUpdateAutonomySettings` resolves `CommandResponse<ConfigSnapshot>`,\n not `<AutonomySettings>`; the panel ignores the payload, so these now mirror\n the sibling spec's `{ result: {} as never, logs: [] }`\n- `category: 'test'` is not a `CapabilityCategory`; used 'settings'\n\nCaught because `e2e-web-build.sh` runs `tsc` over the whole project including\n`__tests__`, so the broken types blocked the E2E web build entirely. Behaviour\nis unchanged — the same 648 tests pass — and `tsc --noEmit` is now clean across\nthe app.\n

M3gA-Mind2b65f357ad36
diff --git a/app/src/components/settings/panels/__tests__/PermissionsPanel.races.test.tsx b/app/src/components/settings/panels/__tests__/PermissionsPanel.races.test.tsx
index d2d43324da..15a66e621d 100644
--- a/app/src/components/settings/panels/__tests__/PermissionsPanel.races.test.tsx
+++ b/app/src/components/settings/panels/__tests__/PermissionsPanel.races.test.tsx
@@ -105,7 +105,7 @@ describe('PermissionsPanel — load-shape defaults', () => {
beforeEach(() => {
vi.clearAllMocks();
mockIsTauri.mockReturnValue(true);
- mockGetPaths.mockResolvedValue({ result: agentPaths() });
+ mockGetPaths.mockResolvedValue({ result: agentPaths(), logs: [] });
});
// `require_task_plan_approval ?? true` and `trusted_roots ?? []`
@@ -116,8 +116,8 @@ describe('PermissionsPanel — load-shape defaults', () => {
const partial = autonomy();
delete (partial as Partial<AutonomySettings>).trusted_roots;
delete (partial as { require_task_plan_approval?: boolean }).require_task_plan_approval;
- mockGet.mockResolvedValue({ result: partial as AutonomySettings });
- mockUpdate.mockResolvedValue({ result: autonomy({ level: 'full' }) });
+ mockGet.mockResolvedValue({ result: partial as AutonomySettings, logs: [] });
+ mockUpdate.mockResolvedValue({ result: {} as never, logs: [] });
renderWithProviders(<PermissionsPanel />);
await waitFor(() => expect(mockGet).toHaveBeenCalled());
@@ -133,8 +133,9 @@ describe('PermissionsPanel — load-shape defaults', () => {
it('preserves a false require_task_plan_approval rather than defaulting it on', async () => {
mockGet.mockResolvedValue({
result: autonomy({ require_task_plan_approval: false } as Partial<AutonomySettings>),
+ logs: [],
});
- mockUpdate.mockResolvedValue({ result: autonomy({ level: 'full' }) });
+ mockUpdate.mockResolvedValue({ result: {} as never, logs: [] });
renderWithProviders(<PermissionsPanel />);
await waitFor(() => expect(mockGet).toHaveBeenCalled());
@@ -162,8 +163,8 @@ describe('PermissionsPanel — persist sequence guard', () => {
beforeEach(() => {
vi.clearAllMocks();
mockIsTauri.mockReturnValue(true);
- mockGet.mockResolvedValue({ result: autonomy() });
- mockGetPaths.mockResolvedValue({ result: agentPaths() });
+ mockGet.mockResolvedValue({ result: autonomy(), logs: [] });
+ mockGetPaths.mockResolvedValue({ result: agentPaths(), logs: [] });
});
it('surfaces a save failure', async () => {
@@ -181,9 +182,9 @@ describe('PermissionsPanel — persist sequence guard', () => {
// outcome once a newer one has started. Without `persistSeqRef` the stale
// rejection below would paint an error over a save that actually succeeded.
it('ignores a stale save failure that lands after a newer save', async () => {
- const stale = deferred<{ result: AutonomySettings }>();
+ const stale = deferred<{ result: never; logs: string[] }>();
mockUpdate.mockReturnValueOnce(stale.promise);
- mockUpdate.mockResolvedValueOnce({ result: autonomy({ level: 'readonly' }) });
+ mockUpdate.mockResolvedValueOnce({ result: {} as never, logs: [] });
renderWithProviders(<PermissionsPanel />);
await waitFor(() => expect(mockGet).toHaveBeenCalled());
@@ -199,7 +200,7 @@ describe('PermissionsPanel — persist sequence guard', () => {
});
it('ignores a stale save success that lands after a newer failure', async () => {
- const stale = deferred<{ result: AutonomySettings }>();
+ const stale = deferred<{ result: never; logs: string[] }>();
mockUpdate.mockReturnValueOnce(stale.promise);
mockUpdate.mockRejectedValueOnce(new Error('newer save refused'));
@@ -211,7 +212,7 @@ describe('PermissionsPanel — persist sequence guard', () => {
expect(await screen.findByText(/newer save refused/)).toBeInTheDocument();
- stale.resolve({ result: autonomy({ level: 'full' }) });
+ stale.resolve({ result: {} as never, logs: [] });
await flush();
// The newer failure must still stand — a late success must not clear it...
expect(screen.getByText(/newer save refused/)).toBeInTheDocument();
@@ -232,8 +233,8 @@ describe('PermissionsPanel — action_dir sequence guard', () => {
beforeEach(() => {
vi.clearAllMocks();
mockIsTauri.mockReturnValue(true);
- mockGet.mockResolvedValue({ result: autonomy() });
- mockGetPaths.mockResolvedValue({ result: agentPaths() });
+ mockGet.mockResolvedValue({ result: autonomy(), logs: [] });
+ mockGetPaths.mockResolvedValue({ result: agentPaths(), logs: [] });
});
const startEditing = async () => {
@@ -244,7 +245,7 @@ describe('PermissionsPanel — action_dir sequence guard', () => {
};
it('trims the typed path before sending it', async () => {
- mockUpdatePaths.mockResolvedValue({ result: agentPaths({ action_dir: '/new/dir' }) });
+ mockUpdatePaths.mockResolvedValue({ result: agentPaths({ action_dir: '/new/dir' }), logs: [] });
const input = await startEditing();
fireEvent.change(input, { target: { value: ' /new/dir ' } });
@@ -279,7 +280,7 @@ describe('PermissionsPanel — action_dir sequence guard', () => {
// one is in flight. Assert the guard that actually holds — a second click
// cannot start a second RPC — rather than a race the user cannot trigger.
it('disables Save while one is in flight, so a second click cannot double-send', async () => {
- const inflight = deferred<{ result: AgentPaths }>();
+ const inflight = deferred<{ result: AgentPaths; logs: string[] }>();
mockUpdatePaths.mockReturnValueOnce(inflight.promise);
const input = await startEditing();
@@ -291,7 +292,7 @@ describe('PermissionsPanel — action_dir sequence guard', () => {
fireEvent.click(save);
expect(mockUpdatePaths).toHaveBeenCalledTimes(1);
- inflight.resolve({ result: agentPaths({ action_dir: '/first' }) });
+ inflight.resolve({ result: agentPaths({ action_dir: '/first' }), logs: [] });
await waitFor(() => expect(screen.getByText('/first')).toBeInTheDocument());
});
});
diff --git a/app/src/components/settings/panels/__tests__/PrivacyPanel.kinds.test.tsx b/app/src/components/settings/panels/__tests__/PrivacyPanel.kinds.test.tsx
index a68dfa3d92..cf6c22c254 100644
--- a/app/src/components/settings/panels/__tests__/PrivacyPanel.kinds.test.tsx
+++ b/app/src/components/settings/panels/__tests__/PrivacyPanel.kinds.test.tsx
@@ -42,8 +42,8 @@ type DataKind = 'raw' | 'derived' | 'credentials' | 'diagnostics' | 'metadata';
const cap = (id: string, data_kind: DataKind, over: Partial<Capability> = {}): Capability => ({
id,
name: `Cap ${id}`,
- domain: 'test',
- category: 'test',
+ domain: 'settings',
+ category: 'settings',
description: `Description for ${id}`,
how_to: 'Somewhere',
status: 'stable',
@@ -144,8 +144,8 @@ describe('PrivacyPanel — catalog states', () => {
const bare: Capability = {
id: 'plain',
name: 'Plain',
- domain: 'test',
- category: 'test',
+ domain: 'settings',
+ category: 'settings',
description: 'No privacy metadata.',
how_to: 'Nowhere',
status: 'stable',
diff --git a/app/src/components/settings/panels/__tests__/SandboxSettingsPanel.validation.test.tsx b/app/src/components/settings/panels/__tests__/SandboxSettingsPanel.validation.test.tsx
index e7e0b3b696..673193b8bd 100644
--- a/app/src/components/settings/panels/__tests__/SandboxSettingsPanel.validation.test.tsx
+++ b/app/src/components/settings/panels/__tests__/SandboxSettingsPanel.validation.test.tsx
@@ -64,7 +64,7 @@ const mockUpdate = vi.mocked(openhumanUpdateSandboxSettings);
const mockIsTauri = vi.mocked(isTauri);
async function renderLoaded(overrides: Partial<SandboxSettings> = {}) {
- mockGet.mockResolvedValue({ result: sandboxSettings(overrides) });
+ mockGet.mockResolvedValue({ result: sandboxSettings(overrides), logs: [] });
renderWithProviders(<SandboxSettingsPanel />);
await waitFor(() => expect(mockGet).toHaveBeenCalled());
}