Unified · Split
| @@ -1810,6 +1810,25 @@ fanout.layer("ProviderServiceLive fanout", (it) => { · 1809 unmodified lines | |||
| 1810 | 1810 | ||
| 1811 | const validation = makeProviderServiceLayer(); | 1811 | const validation = makeProviderServiceLayer(); |
| 1812 | validation.layer("ProviderServiceLive validation", (it) => { | 1812 | validation.layer("ProviderServiceLive validation", (it) => { |
| 1813 | it.effect("rejects whitespace-only turns without attachments", () => | ||
| 1814 | Effect.gen(function* () { | ||
| 1815 | const provider = yield* ProviderService.ProviderService; | ||
| 1816 | |||
| 1817 | validation.codex.sendTurn.mockClear(); | ||
| 1818 | const failure = yield* provider | ||
| 1819 | .sendTurn({ | ||
| 1820 | threadId: asThreadId("thread-whitespace-only"), | ||
| 1821 | input: " \n\t ", | ||
| 1822 | attachments: [], | ||
| 1823 | }) | ||
| 1824 | .pipe(Effect.flip); | ||
| 1825 | |||
| 1826 | assert.instanceOf(failure, ProviderValidationError); | ||
| 1827 | assert.equal(failure.operation, "ProviderService.sendTurn"); | ||
| 1828 | assert.equal(validation.codex.sendTurn.mock.calls.length, 0); | ||
| 1829 | }), | ||
| 1830 | ); | ||
| 1831 | |||
| 1813 | it.effect("rejects session starts without an explicit provider instance id", () => | 1832 | it.effect("rejects session starts without an explicit provider instance id", () => |
| 1814 | Effect.gen(function* () { | 1833 | Effect.gen(function* () { |
| 1815 | const provider = yield* ProviderService.ProviderService; | 1834 | const provider = yield* ProviderService.ProviderService; |