diff --git a/packages/host/apiproxy/tests/fetch-carrier.spec.ts b/packages/host/apiproxy/tests/fetch-carrier.spec.ts index c02735156d..fc99b31675 100644 --- a/packages/host/apiproxy/tests/fetch-carrier.spec.ts +++ b/packages/host/apiproxy/tests/fetch-carrier.spec.ts @@ -359,6 +359,26 @@ describe('unary round trip (handler ⇄ client, no network)', () => { expect((await c.host.describe({})).result.ok).toBe(true) }) + it('round-trips every agent-preset method, authoring included', async () => { + const c = client() + + // The whole domain crosses the carrier: the roster a picker reads, the + // per-session switch, and the three authoring calls the settings editor + // makes. Each has its own request schema, so a registration missing from + // either half fails here rather than in the browser. + expect((await c.agentPresets.list({})).result).toEqual({ + ok: true, value: { presets: [], authorable: false }, + }) + expect((await c.agentPresets.select({ sessionId: 's' as never, agentPreset: 'core-web' })).result) + .toEqual({ ok: true, value: { agentPreset: 'core-web' } }) + expect((await c.agentPresets.read({ agentPreset: 'mine' })).result).toEqual({ + ok: true, value: { agentPreset: 'mine', trust: 'user', content: '', writable: true }, + }) + expect((await c.agentPresets.write({ agentPreset: 'mine', content: '- id: x\n' })).result) + .toEqual({ ok: true, value: { agentPreset: 'mine' } }) + expect((await c.agentPresets.remove({ agentPreset: 'mine' })).result).toEqual({ ok: true, value: {} }) + }) + it('round-trips the native picker without the default unary timeout', async () => { const api = fakeApi() api.host.pickDirectory = async (request) => {