Dashboard › opencode › Distillation
e5bb8ebd-61bc-4317-9075-f17f8a7d98d1["lore_tm_v1_70l4fkizIFQEmih13KjFbAQlIsX0ixDb7ZfxQYUg48k","lore_tm_v1_jwjIXbOOGTUrYTBfpcLHVJ8PBPyU34KI5tT6bRUwvFw","lore_tm_v1_5tNDshT5zL3qDvjWP14j-uMmXQ5xarRiP5bLQeCSiZo","lore_tm_v1_2hdrgQ0zKeErVTNW9ZpZUbXVcMTDYVSn2BcBs5xgkrE","lore_tm_v1_krBs4Rohkzfq_S4mpQRJRzpLXmALDRvJHyQBEAHShaI","lore_tm_v1_imLHey4G8m0q47MjHjSlWeAw2TroePNPqSdcKihMSM4","lore_tm_v1_-zI3uE8aOQt80Xzkt81qTKwiILSvmg6m6eP85sdyOqk","lore_tm_v1_7jgD0MupZpxZwnTxmR6N9PH9wPHklvn_KliPN4Mw9qQ","lore_tm_v1_iisLgTWZbPvDrCDqQjIMHzw4KgZhH5JWwf-k9ODuGCc","lore_tm_v1_1L6ex2VewqOqugHC3XOEIcCY-RZeOy9JprbZJffQ9uI","lore_tm_v1_wmN0Yn0MLby4wntgedGxn5I9fgwxTuFmydPBlfyDs3w","lore_tm_v1__a6Bf4o9fMVRMRsLqRyBcZ3vI8Lyh4p84UOiaXakK34"]
Date: Sep 15, 2026
SessionNextPromptExecutionRequested in packages/sdk/js/src/v2/gen/types.gen.ts:4366-4383 has id: string, optional arbitrary metadata, type "session.next.prompt.execution_requested", optional durable metadata (aggregateID: string, seq: number, version: number), optional location?: LocationRef, and data fields timestamp: number, sessionID: string, and messageID: string; it appears between SessionNextPromptAdmitted and SessionNextContextUpdated.SessionNextPromptAdmitted in packages/sdk/js/src/v2/gen/types.gen.ts:4344-4364 includes prompt: Prompt, delivery: "steer" | "queue", and optional requestExecution?: boolean.EventSessionNextPromptExecutionRequested in packages/sdk/js/src/v2/gen/types.gen.ts:6468-6476 has id: string, type "session.next.prompt.execution_requested", and properties timestamp: number, sessionID: string, and messageID: string; it appears between EventSessionNextPromptAdmitted and EventSessionNextContextUpdated.EventSessionNextPromptAdmitted in packages/sdk/js/src/v2/gen/types.gen.ts:6455-6466 includes prompt: Prompt, delivery: "steer" | "queue", and optional requestExecution?: boolean.packages/sdk/js/package.json defines package @opencode-ai/sdk version 1.18.30, ESM ("type": "module"), MIT license, scripts test: "bun test", typecheck: "tsgo --noEmit", and build: "bun ./script/build.ts".packages/sdk/js/package.json exports ".", "./client", "./server", "./v2", "./v2/client", "./v2/gen/client", "./v2/server", and "./v2/types"; "./v2/types" maps directly to ./src/v2/gen/types.gen.ts.packages/sdk/js/package.json uses @hey-api/openapi-ts version 0.90.10; other dev dependencies are @tsconfig/node22, @types/cross-spawn, @types/node, @typescript/native-preview, and typescript via the catalog, while runtime dependency cross-spawn also uses the catalog.packages/sdk/js/script/build.ts generates openapi.json via bun dev generate, then traverses all $ref values reachable outside components.schemas and removes unreachable schema names matching /^SessionNext\w+1$/.packages/sdk/js/script/build.ts invokes createClient() from @hey-api/openapi-ts with input ./openapi.json, output path ./src/v2/gen, clean: true, and tsConfigPath set to packages/sdk/js/tsconfig.json. Plugins are: @hey-api/typescript with exportFromIndex: false; @hey-api/sdk with instance: "OpencodeClient", exportFromIndex: false, auth: false, and paramsStructure: "flat"; and @hey-api/client-fetch with exportFromIndex: false and baseUrl: "http://localhost:4096".packages/sdk/js/script/build.ts:74-85 guards against generated duplicate session variants using /export type SessionNext\w+1 =/, throwing "Session history generated duplicate Session event variants" if found; it also patches V2SessionHistoryData query parameters limit and after from string to number, failing with "Session history numeric query patch did not apply" if the replacement does not apply.packages/sdk/js/script/build.ts:87-95 patches generated Get session history SDK parameters limit and after from string to number, failing with "Session history numeric SDK patch did not apply" if unchanged.packages/sdk/js/script/build.ts:97-113 works around an @hey-api/openapi-ts SSE codegen bug: generated SseFn incorrectly supplies endpoint TError as the AsyncGenerator TReturn generic in ServerSentEventsResult<TData, TError>. The build changes it to ServerSentEventsResult<TData> so TReturn defaults to void, and throws if the patch no longer applies to ./src/v2/gen/client/types.gen.ts.bun prettier --write src/gen, bun prettier --write src/v2, deleting dist, running bun tsc, and deleting openapi.json.packages/sdk/js/src/v2/index.ts re-exports ./client.js and ./server.js, exports data as a namespace from ./data.js, and defines createOpencode(options?: ServerOptions) to start a server with createOpencodeServer, create a client using baseUrl: server.url, and return { client, server }.packages/sdk/js/src/v2/client.ts publicly re-exports all generated types from ./gen/types.gen.js, aliases FileSystemEntry as LocationFileSystemEntry, and exports Config as OpencodeClientConfig alongside OpencodeClient.createOpencodeClient() in packages/sdk/js/src/v2/client.ts installs a default fetch wrapper that sets req.timeout = false; optional directory and experimental_workspaceID are encoded into x-opencode-directory and x-opencode-workspace headers respectively.packages/sdk/js/src/v2/client.ts rewrites GET and HEAD requests by moving directory/workspace header values into query parameters. For /api/ paths it sets both the plain key and location[key]; after rewriting, it removes x-opencode-directory and x-opencode-workspace.packages/client/src/generated-effect/client.ts is generated by @opencode-ai/httpapi-codegen; it imports ClientApi from ../contract. Its mapClientError wraps HttpClientError, SchemaError, and Sse.Retry in ClientError, while leaving other errors unchanged.packages/schema/test/event-manifest.test.ts:50-54 asserts EventManifest.Durable excludes "session.next.step.ended.1", maps "session.next.step.ended.2" to SessionEvent.Step.Ended, and maps "session.next.prompt.execution_requested.1" to SessionEvent.PromptExecutionRequested.packages/core/src/session/projector.ts:371-390 projects SessionEvent.PromptAdmitted only when durable sequence metadata exists, passing admittedSeq, id, sessionID, prompt, delivery, requestExecution: event.data.requestExecution ?? false, and timeCreated to SessionInput.projectAdmitted; it projects SessionEvent.PromptExecutionRequested by passing the exact messageID and sessionID to SessionInput.projectExecutionRequested.SessionInput.admit derives shouldWake from the retried input (packages/core/src/session/input.ts:54-59), and requestExecution queries the exact (messageID, sessionID) row and returns false when that input is promoted (packages/core/src/session/input.ts:108-120).packages/core/src/session/input.ts:209-229, then rereads that exact row and returns false after promotion in packages/core/src/session/input.ts:151-169; publish-defect recovery delegates to the same exact-row check in packages/core/src/session/input.ts:88-99.SessionV2.prompt invokes execution.wake only when the exact-row result is true (packages/core/src/session.ts:368-384), concluding an already-promoted exact retry cannot infer execution intent from an unrelated pending resume:false input.packages/core/test/session-prompt.test.ts:330-371: it creates the unrelated-input condition and asserts no wake plus unchanged rows. Concurrent execution-request deduplication is covered in packages/core/test/session-prompt.test.ts:440-485.packages/sdk/openapi.json contains public union references for both relevant events at lines 15309-15313 and 24200-24204, durable union references at 23811-23815, and sync union references at 20577-20580.requestExecution appears in public, durable, and sync OpenAPI forms at packages/sdk/openapi.json:17899-17903, 25660-25714, 28545-28604, and 34779-34816; full PromptExecutionRequested forms appear at 17910-17941, 25724-25776, 28610-28663, and 34822-34853.packages/sdk/js/src/v2/gen/types.gen.ts:7-25, 1645-1651, 2779-2786, and 2898-2916, and includes optional requestExecution in every generated representation at 865-884, 3416-3449, 4344-4383, and 6455-6476.packages/client/src/generated/types.ts:1).catchDefect interleaving or parallel promoted retries. Assistant judged this a test-coverage gap rather than a correctness defect because both paths converge on the tested exact-row helper.