Open History to see the last commit
1/**
2 * The OpenCode adapter does not journal yet (Phase 3), so its `runId`
3 * resolution is routed through `resolveDurableRunId` with `durable: false`
4 * purely so it inherits the caller-supplied-runId requirement automatically
5 * once it does gain journaling, rather than re-deriving that enforcement
6 * later. This asserts today's non-durable behavior is unchanged: a missing
7 * `runId` still falls back to a generated id instead of throwing.
8 */
9import { describe, expect, it } from 'vitest'
10import { resolveDurableRunId } from '@tanstack/ai-sandbox'
11
12describe('opencode runId resolution', () => {
13 it('still generates an id when none is supplied, since this adapter is not durable', () => {
14 expect(
15 resolveDurableRunId(undefined, {
16 durable: false,
17 adapter: 'opencode',
18 fallback: () => 'generated-1',
19 }),
20 ).toBe('generated-1')
21 })
22})