DashboardopencodeSession 0kurKU0jltRI

Session 0kurKU0jltRI

Full ID: 0kurKU0jltRI6V0gh
Messages: 102
Distillations: 15
Time range: 2026-09-14 08:14:12 — 2026-09-14 08:32:25

Conversation (102 messages)

Research only, do not edit files. In /home/byk/Code/opencode, inspect V2 session durable admission/execution and restart recovery behavior. Verify whether V2 actually resumes active sessions after server restart, or only preserves queued prompts. Find exact files/symbols/tests and explain guarantees and gaps, especially provider-call and tool-side-effect duplication. Return concise evidence with file:line references and any reusable design concepts for legacy v1. Thoroughness: very thorough.

gateway · 2026-09-14 08:14:12
result
/home/byk/Code/opencode/AGENTS.md
/home/byk/Code/opencode/packages/codemode/AGENTS.md
/home/byk/Code/opencode/packages/session-ui/AGENTS.md
/home/byk/Code/opencode/packages/schema/AGENTS.md
/home/byk/Code/opencode/packages/llm/AGENTS.md
/home/byk/Code/opencode/packages/stats/AGENTS.md
/home/byk/Code/opencode/packages/opencode/AGENTS.md
/home/byk/Code/opencode/packages/opencode/test/AGENTS.md
/home/byk/Code/opencode/packages/effect-drizzle-sqlite/AGENTS.md
/home/byk/Code/opencode/packages/opencode/test/server/AGENTS.md
/home/byk/Code/opencode/packages/ui/AGENTS.md
/home/byk/Code/opencode/packages/core/src/tool/AGENTS.md
/home/byk/Code/opencode/packages/opencode/src/session/llm/AGENTS.md
/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/AGENTS.md
/home/byk/Code/opencode/packages/desktop/AGENTS.md
/home/byk/Code/opencode/packages/app/AGENTS.md
/home/byk/Code/opencode/packages/app/e2e/AGENTS.md
/home/byk/Code/opencode/packages/app/e2e/performance/AGENTS.md
gateway · 2026-09-14 08:14:25
result
/home/byk/Code/opencode/CONTRIBUTING.md
gateway · 2026-09-14 08:14:28
result
<path>/home/byk/Code/opencode/package.json</path>
<type>file</type>
<content>
1: {
2:   "$schema": "https://json.schemastore.org/package.json",
3:   "name": "opencode",
4:   "description": "AI-powered development tool",
5:   "private": true,
6:   "type": "module",
7:   "packageManager": "bun@1.3.14",
8:   "scripts": {
9:     "dev": "bun run --cwd packages/opencode src/index.ts",
10:     "dev:desktop": "bun --cwd packages/desktop dev",
11:     "dev:web": "bun --cwd packages/app dev",
12:     "dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev",
13:     "dev:stats": "bun sst shell --stage=production -- bun run --cwd packages/stats/app dev",
14:     "dev:storybook": "bun --cwd packages/storybook storybook",
15:     "lint": "oxlint",
16:     "typecheck": "bun turbo typecheck",
17:     "upgrade-opentui": "bun run script/upgrade-opentui.ts",
18:     "postinstall": "bun run --cwd packages/core fix-node-pty",
19:     "prepare": "husky",
20:     "random": "echo ...
gateway · 2026-09-14 08:14:35
result
<path>/home/byk/Code/opencode/AGENTS.md</path>
<type>file</type>
<content>
1: - To regenerate the legacy JavaScript SDK, run `./packages/sdk/js/script/build.ts`.
2: - After changing the public Protocol or Server `HttpApi`, run `bun run generate` from `packages/client`. Do not edit `src/generated` or `src/generated-effect` directly.
3: - Keep runtime dependencies directed from Schema to Core and Protocol, then from Core and Protocol to Server. Client runtime code may depend on Schema and Protocol but never Core or Server; `sdk-next` composes Client, Core, and Server.
4: - The default branch in this repo is `dev`.
5: - Local `main` ref may not exist; use `dev` or `origin/dev` for diffs.
6: 
7: ## Branch Names
8: 
9: Use a short branch name of at most three words, separated by hyphens. Do not use slashes or type prefixes such as `feat/` or `fix/`.
10: 
11: Examples: `session-recovery`, `fix-scroll-state`, `regenerate-sdk`. ...
gateway · 2026-09-14 08:14:42
result
<path>/home/byk/Code/opencode/CONTRIBUTING.md</path>
<type>file</type>
<content>
1: # Contributing to OpenCode
2: 
3: We want to make it easy for you to contribute to OpenCode. Here are the most common type of changes that get merged:
4: 
5: - Bug fixes
6: - Additional LSPs / Formatters
7: - Improvements to LLM performance
8: - Support for new providers
9: - Fixes for environment-specific quirks
10: - Missing standard behavior
11: - Documentation improvements
12: 
13: However, any UI or core product feature must go through a design review with the core team before implementation.
14: 
15: If you are unsure if a PR would be accepted, feel free to ask a maintainer or look for issues with any of the following labels:
16: 
17: - [`help wanted`](https://github.com/anomalyco/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3Ahelp-wanted)
18: - [`good first issue`](https://github.com/anomalyco/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22)
19: - ...
gateway · 2026-09-14 08:15:01
result
Found 100 matches (more matches available)
/home/byk/Code/opencode/packages/cli/src/index.ts:
  Line 19:     restart: () => import("./commands/handlers/service/restart"),


/home/byk/Code/opencode/packages/cli/src/services/daemon.ts:
  Line 48:       // Keep one private credential across server restarts so discovered clients


/home/byk/Code/opencode/packages/cli/src/commands/commands.ts:
  Line 34:         Spec.make("restart", { description: "Restart the background server" }),


/home/byk/Code/opencode/packages/codemode/test/codemode.test.ts:
  Line 649:   test("the language section describes the restricted runtime without overclaiming", () => {


/home/byk/Code/opencode/packages/cli/src/commands/handlers/service/restart.ts:
  Line 8:   Commands.commands.service.commands.restart,

  Line 9:   Effect.fn("cli.service.restart")(function* () {


/home/byk/Code/opencode/packages/llm/DESIGN.md:
  Line 850: mapped failures let the model recover; defects and interruption fail the run. ...
gateway · 2026-09-14 08:15:05
result
/home/byk/Code/opencode/packages/core/src/session/projector.ts
/home/byk/Code/opencode/packages/core/src/session/compaction.ts
/home/byk/Code/opencode/packages/core/src/session/todo.ts
/home/byk/Code/opencode/packages/core/src/session/store.ts
/home/byk/Code/opencode/packages/core/src/session/sql.ts
/home/byk/Code/opencode/packages/core/src/session/schema.ts
/home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts
/home/byk/Code/opencode/packages/core/src/session/revert.ts
/home/byk/Code/opencode/packages/core/src/session/prompt.ts
/home/byk/Code/opencode/packages/core/src/session/message.ts
/home/byk/Code/opencode/packages/core/src/session/message-updater.ts
/home/byk/Code/opencode/packages/core/src/session/input.ts
/home/byk/Code/opencode/packages/core/src/session/info.ts
/home/byk/Code/opencode/packages/core/src/session/history.ts
/home/byk/Code/opencode/packages/core/src/session/execution.ts
/home/byk/Code/opencode/packages/core/src/session/event.ts
/home/byk/Code/openc...
gateway · 2026-09-14 08:15:10
result
<path>/home/byk/Code/opencode/packages/core/package.json</path>
<type>file</type>
<content>
1: {
2:   "$schema": "https://json.schemastore.org/package.json",
3:   "version": "1.18.30",
4:   "name": "@opencode-ai/core",
5:   "type": "module",
6:   "license": "MIT",
7:   "private": true,
8:   "scripts": {
9:     "db": "bun drizzle-kit",
10:     "migration": "bun run script/migration.ts",
11:     "fix-node-pty": "bun run script/fix-node-pty.ts",
12:     "test": "bun test --only-failures",
13:     "typecheck": "tsgo --noEmit"
14:   },
15:   "bin": {
16:     "opencode": "./bin/opencode"
17:   },
18:   "exports": {
19:     "./effect/layer-node": "./src/effect/layer-node.ts",
20:     "./effect/app-node": "./src/effect/app-node.ts",
21:     "./session/runner": "./src/session/runner/index.ts",
22:     "./system-context": "./src/system-context/index.ts",
23:     "./*": "./src/*.ts"
24:   },
25:   "imports": {
26:     "#sqlite": {
27:       "bun": "./src/database/sqlite.bun.ts",
28:       ...
gateway · 2026-09-14 08:15:25
result
<path>/home/byk/Code/opencode/packages/core/src/session/execution.ts</path>
<type>file</type>
<content>
1: export * as SessionExecution from "./execution"
2: 
3: import { Context, Effect, Layer } from "effect"
4: import { LayerNode } from "../effect/layer-node"
5: import { Node } from "../effect/app-node"
6: import { SessionRunner } from "./runner/index"
7: import { SessionSchema } from "./schema"
8: 
9: export interface Interface {
10:   /** Snapshots active execution owned by this process. */
11:   readonly active: Effect.Effect<ReadonlySet<SessionSchema.ID>>
12:   /** Starts execution while idle or joins the active execution. */
13:   readonly resume: (sessionID: SessionSchema.ID) => Effect.Effect<void, SessionRunner.RunError>
14:   /** Registers newly recorded work. Repeated wakeups may coalesce. */
15:   readonly wake: (sessionID: SessionSchema.ID) => Effect.Effect<void>
16:   /** Interrupt active work owned by this process. Idle interruption is a no-op. ...
gateway · 2026-09-14 08:15:29
result
<path>/home/byk/Code/opencode/packages/core/src/session/execution/local.ts</path>
<type>file</type>
<content>
1: import { Cause, Effect, Layer } from "effect"
2: import { LocationServiceMap } from "../../location-service-map"
3: import { makeGlobalNode } from "../../effect/app-node"
4: import { SessionRunCoordinator } from "../run-coordinator"
5: import { SessionRunner } from "../runner"
6: import { SessionSchema } from "../schema"
7: import { SessionStore } from "../store"
8: import { SessionExecution } from "../execution"
9: 
10: /** Current-process routing for implicit-local Locations. Future remote placement belongs here. */
11: const layer = Layer.effect(
12:   SessionExecution.Service,
13:   Effect.gen(function* () {
14:     const store = yield* SessionStore.Service
15:     const locations = yield* LocationServiceMap.Service
16:     const coordinator = yield* SessionRunCoordinator.make<SessionSchema.ID, SessionRunner.RunError>({
17:       drain: Effect.fnUntraced(function* ...
gateway · 2026-09-14 08:15:35
result
<path>/home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts</path>
<type>file</type>
<content>
1: export * as SessionRunCoordinator from "./run-coordinator"
2: 
3: import { Deferred, Effect, Exit, Fiber, FiberSet, Scope } from "effect"
4: 
5: /** Serializes execution for each key while allowing different keys to run concurrently. */
6: export interface Coordinator<Key, E> {
7:   /** Snapshots keys with an execution owned by this coordinator. */
8:   readonly active: Effect.Effect<ReadonlySet<Key>>
9:   /** Starts execution while idle or joins the active execution. */
10:   readonly run: (key: Key) => Effect.Effect<void, E>
11:   /** Registers one coalesced follow-up after newly recorded work. */
12:   readonly wake: (key: Key) => Effect.Effect<void>
13:   /** Stops active execution and waits for its cleanup. */
14:   readonly interrupt: (key: Key) => Effect.Effect<void>
15: }
16: 
17: type Entry<E> = {
18:   readonly done: Deferred.Deferred<void, E>
19:   owner?: ...
gateway · 2026-09-14 08:15:39
result
<path>/home/byk/Code/opencode/packages/core/src/session/prompt.ts</path>
<type>file</type>
<content>
1: export { AgentAttachment, FileAttachment, Prompt, Source } from "@opencode-ai/schema/prompt"

(End of file - total 1 lines)
</content>
gateway · 2026-09-14 08:15:44
result
<path>/home/byk/Code/opencode/packages/core/src/session/input.ts</path>
<type>file</type>
<content>
1: export * as SessionInput from "./input"
2: 
3: import { and, asc, eq, isNull, lte } from "drizzle-orm"
4: import { DateTime, Effect, Schema } from "effect"
5: import { Admitted, Delivery } from "@opencode-ai/schema/session-input"
6: import type { Database } from "../database/database"
7: import type { EventV2 } from "../event"
8: import { SessionEvent } from "./event"
9: import { SessionMessage } from "./message"
10: import { Prompt } from "./prompt"
11: import { SessionSchema } from "./schema"
12: import { SessionInputTable, SessionMessageTable } from "./sql"
13: 
14: type DatabaseService = Database.Interface["db"]
15: 
16: export { Admitted, Delivery }
17: 
18: const decodePrompt = Schema.decodeUnknownSync(Prompt)
19: const encodePrompt = Schema.encodeSync(Prompt)
20: 
21: const fromRow = (row: typeof SessionInputTable.$inferSelect): Admitted =>
22:   Admitted.make({
23:     ...
gateway · 2026-09-14 08:15:50
result
<path>/home/byk/Code/opencode/packages/core/src/session/store.ts</path>
<type>file</type>
<content>
1: export * as SessionStore from "./store"
2: 
3: import { eq } from "drizzle-orm"
4: import { Context, Effect, Layer, Schema } from "effect"
5: import { Database } from "../database/database"
6: import { makeGlobalNode } from "../effect/app-node"
7: import { SessionHistory } from "./history"
8: import { MessageDecodeError } from "./error"
9: import { SessionMessage } from "./message"
10: import { SessionSchema } from "./schema"
11: import { SessionMessageTable, SessionTable } from "./sql"
12: import { fromRow } from "./info"
13: 
14: export interface Interface {
15:   readonly get: (sessionID: SessionSchema.ID) => Effect.Effect<SessionSchema.Info | undefined>
16:   readonly context: (sessionID: SessionSchema.ID) => Effect.Effect<SessionMessage.Message[], MessageDecodeError>
17:   readonly runnerContext: (
18:     sessionID: SessionSchema.ID,
19:     baselineSeq: number,
20:   ) => ...
gateway · 2026-09-14 08:15:56
result
<path>/home/byk/Code/opencode/packages/core/src/session/schema.ts</path>
<type>file</type>
<content>
1: export * as SessionSchema from "./schema"
2: 
3: import { Session } from "@opencode-ai/schema/session"
4: 
5: export const ID = Session.ID
6: export type ID = typeof ID.Type
7: 
8: export const Info = Session.Info
9: export type Info = Session.Info

(End of file - total 9 lines)
</content>
gateway · 2026-09-14 08:16:01
result
<path>/home/byk/Code/opencode/packages/core/src/session/sql.ts</path>
<type>file</type>
<content>
1: import { sqliteTable, text, integer, index, primaryKey, real, uniqueIndex } from "drizzle-orm/sqlite-core"
2: import * as DatabasePath from "../database/path"
3: import { ProjectTable } from "../project/sql"
4: import type { SessionMessage } from "./message"
5: import type { Prompt } from "./prompt"
6: import type { SessionInput } from "./input"
7: import type { Snapshot } from "../snapshot"
8: import { PermissionV1 } from "../v1/permission"
9: import { ProjectV2 } from "../project"
10: import type { SessionSchema } from "./schema"
11: import type { MessageID, PartID, SessionV1 } from "../v1/session"
12: import { WorkspaceV2 } from "../workspace"
13: import { Timestamps } from "../database/schema.sql"
14: import type { SystemContext } from "../system-context/index"
15: import { AgentV2 } from "../agent"
16: import type { Revert } from "@opencode-ai/schema/revert"
17: 
18: type ...
gateway · 2026-09-14 08:16:07
result
<path>/home/byk/Code/opencode/packages/core/src/session/runner/index.ts</path>
<type>file</type>
<content>
1: export * as SessionRunner from "./index"
2: 
3: import type { LLMError } from "@opencode-ai/llm"
4: import { Context, Effect } from "effect"
5: import { SessionSchema } from "../schema"
6: import type { ContextSnapshotDecodeError, MessageDecodeError } from "../error"
7: import { SessionRunnerModel } from "./model"
8: import type { SystemContext } from "../../system-context/index"
9: import type { ToolOutputStore } from "../../tool-output-store"
10: 
11: export type RunError =
12:   | LLMError
13:   | SessionRunnerModel.Error
14:   | MessageDecodeError
15:   | ContextSnapshotDecodeError
16:   | SystemContext.InitializationBlocked
17:   | ToolOutputStore.Error
18: 
19: /** Runs one local continuation from already-recorded Session history. */
20: export interface Interface {
21:   /** Drains eligible durable work. ...
gateway · 2026-09-14 08:16:13
result
Found 5 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 242:     const sessionRunner = yield* SessionRunner.Service

  Line 538:     const runner = yield* SessionRunner.Service

  Line 3032:       const runner = yield* SessionRunner.Service


/home/byk/Code/opencode/packages/core/test/session-runner-recorded.test.ts:
  Line 90:     const sessionRunner = yield* SessionRunner.Service


/home/byk/Code/opencode/packages/core/src/session/execution/local.ts:
  Line 20:         return yield* SessionRunner.Service.use((runner) => runner.run({ sessionID, force })).pipe(
gateway · 2026-09-14 08:16:19
result
Found 2 matches
/home/byk/Code/opencode/packages/core/src/session/runner/model.ts:
  Line 78: export class Service extends Context.Service<Service, Interface>()("@opencode/v2/SessionRunnerModel") {}


/home/byk/Code/opencode/packages/core/src/session/runner/index.ts:
  Line 28: export class Service extends Context.Service<Service, Interface>()("@opencode/v2/SessionRunner") {}
gateway · 2026-09-14 08:16:24
result
Found 16 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 539:     const fiber = yield* runner.run({ sessionID, force: true }).pipe(Effect.forkChild)

  Line 2268:       yield* SessionInput.promoteSteers((yield* Database.Service).db, events, sessionID, Number.MAX_SAFE_INTEGER)

  Line 2332:       yield* SessionInput.promoteSteers((yield* Database.Service).db, events, sessionID, Number.MAX_SAFE_INTEGER)

  Line 2392:       yield* SessionInput.promoteSteers((yield* Database.Service).db, events, sessionID, Number.MAX_SAFE_INTEGER)

  Line 3033:       const run = yield* runner.run({ sessionID, force: true }).pipe(Effect.forkChild)


/home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:
  Line 197:       yield* SessionInput.promoteSteers(db, events, sessionID, Number.MAX_SAFE_INTEGER)

  Line 372:           SessionInput.promoteSteers(db, events, sessionID, Number.MAX_SAFE_INTEGER),

  Line 373:           SessionInput.promoteSteers(db, events, ...
gateway · 2026-09-14 08:16:29
result
<path>/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts</path>
<type>file</type>
<content>
1: import {
2:   LLM,
3:   LLMClient,
4:   LLMError,
5:   LLMEvent,
6:   Message,
7:   SystemPart,
8:   isContextOverflowFailure,
9:   type ProviderErrorEvent,
10: } from "@opencode-ai/llm"
11: import { Cause, DateTime, Effect, FiberSet, Layer, Option, Semaphore, Stream } from "effect"
12: import { AgentV2 } from "../../agent"
13: import { Config } from "../../config"
14: import { Database } from "../../database/database"
15: import { EventV2 } from "../../event"
16: import { Location } from "../../location"
17: import { ModelV2 } from "../../model"
18: import { PermissionV2 } from "../../permission"
19: import { ProviderV2 } from "../../provider"
20: import { QuestionV2 } from "../../question"
21: import { SystemContext } from "../../system-context/index"
22: import { SystemContextRegistry } from "../../system-context/registry"
23: import { SkillGuidance } from ...
gateway · 2026-09-14 08:16:38
result
Found 44 matches
/home/byk/Code/opencode/packages/server/src/routes.ts:
  Line 12: import { SessionExecutionLocal } from "@opencode-ai/core/session/execution/local"

  Line 52:   const serviceLayer = AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]])


/home/byk/Code/opencode/packages/opencode/test/session/prompt.test.ts:
  Line 733:             [SessionExecution.node, SessionExecution.noopLayer],


/home/byk/Code/opencode/packages/opencode/test/session/compaction.test.ts:
  Line 614:           Effect.provide(AppNodeBuilder.build(SessionV2.node, [[SessionExecution.node, SessionExecution.noopLayer]])),


/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 240:   SessionExecution.Service,

  Line 246:     return SessionExecution.Service.of({

  Line 274:       SessionExecution.node,

  Line 286:       [SessionExecution.node, execution],

  Line 2227:       yield* (yield* SessionExecution.Service).wake(sessionID)

  Line ...
gateway · 2026-09-14 08:16:43
result
<path>/home/byk/Code/opencode/packages/core/src/session.ts</path>
<type>file</type>
<content>
150:     prompt: PromptInput.Prompt
151:     delivery?: SessionInput.Delivery
152:     resume?: boolean
153:   }) => Effect.Effect<SessionInput.Admitted, NotFoundError | PromptConflictError>
154:   readonly shell: (input: {
155:     id?: EventV2.ID
156:     sessionID: SessionSchema.ID
157:     command: string
158:     resume?: boolean
159:   }) => Effect.Effect<void, OperationUnavailableError>
160:   readonly skill: (input: {
161:     id?: EventV2.ID
162:     sessionID: SessionSchema.ID
163:     skill: string
164:     resume?: boolean
165:   }) => Effect.Effect<void, OperationUnavailableError>
166:   readonly compact: (input: CompactInput) => Effect.Effect<void, NotFoundError | OperationUnavailableError>
167:   readonly wait: (id: SessionSchema.ID) => Effect.Effect<void, NotFoundError | OperationUnavailableError>
168:   readonly active: Effect.Effect<ReadonlySet<SessionSchema.ID>>
169:   ...
gateway · 2026-09-14 08:16:47
result
<path>/home/byk/Code/opencode/packages/server/src/routes.ts</path>
<type>file</type>
<content>
1: import { Database } from "@opencode-ai/core/database/database"
2: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
3: import { httpClient } from "@opencode-ai/core/effect/app-node-platform"
4: import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
5: import { EventV2 } from "@opencode-ai/core/event"
6: import { Credential } from "@opencode-ai/core/credential"
7: import { PermissionSaved } from "@opencode-ai/core/permission/saved"
8: import { PtyTicket } from "@opencode-ai/core/pty/ticket"
9: import { SessionV2 } from "@opencode-ai/core/session"
10: import { SessionExecution } from "@opencode-ai/core/session/execution"
11: import { LocationServiceMap } from "@opencode-ai/core/location-service-map"
12: import { SessionExecutionLocal } from "@opencode-ai/core/session/execution/local"
13: import { ToolOutputStore } from ...
gateway · 2026-09-14 08:16:52
result
<path>/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts</path>
<type>file</type>
<content>
270: 
271: export function createRoutes(
272:   corsOptions?: CorsOptions,
273: ): Layer.Layer<never, EffectConfig.ConfigError, RouteRequirements> {
274:   const locationServiceMapV2 = buildLocationServiceMap()
275: 
276:   return Layer.mergeAll(
277:     rootApiRoutes,
278:     eventApiRoutes,
279:     ptyConnectApiRoutes,
280:     instanceRoutes,
281:     serverRoutes,
282:     docRoute,
283:     uiRoute,
284:   ).pipe(
285:     Layer.provide([
286:       errorLayer,
287:       compressionLayer,
288:       corsVaryFix,
289:       fenceLayer,
290:       cors(corsOptions),
291:       AppNodeBuilderV1.build(MoveSession.node, [[LocationServiceMap.node, locationServiceMapV2]]),
292:       HttpServer.layerServices,
293:     ]),
294:     Layer.provide(Layer.succeed(CorsConfig)(corsOptions)),
295:     Layer.provide(sessionLocationLayer),
296:     ...
gateway · 2026-09-14 08:16:57
result
Found 2 matches
/home/byk/Code/opencode/packages/server/src/handlers/session.ts:
  Line 81:         "session.active",

  Line 85:               Array.from(yield* session.active, (sessionID) => [sessionID, { type: "running" as const }]),
gateway · 2026-09-14 08:17:03
result
<path>/home/byk/Code/opencode/packages/server/src/handlers/session.ts</path>
<type>file</type>
<content>
1: import { SessionV2 } from "@opencode-ai/core/session"
2: import { DateTime, Effect, Stream } from "effect"
3: import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi"
4: import { Api } from "../api"
5: import { SessionsCursor } from "@opencode-ai/protocol/groups/session"
6: import {
7:   ConflictError,
8:   InvalidCursorError,
9:   MessageNotFoundError,
10:   ServiceUnavailableError,
11:   SessionNotFoundError,
12:   UnknownError,
13: } from "@opencode-ai/protocol/errors"
14: import { AbsolutePath } from "@opencode-ai/core/schema"
15: 
16: const DefaultSessionsLimit = 50
17: const DefaultSessionHistoryLimit = 50
18: 
19: export const SessionHandler = HttpApiBuilder.group(Api, "server.session", (handlers) =>
20:   Effect.gen(function* () {
21:     const session = yield* SessionV2.Service
22: 
23:     return handlers
24:       .handle(
25:         ...
gateway · 2026-09-14 08:17:09
result
<path>/home/byk/Code/opencode/packages/server/src/handlers/session.ts</path>
<type>file</type>
<content>
170:         }),
171:       )
172:       .handle(
173:         "session.compact",
174:         Effect.fn(function* (ctx) {
175:           yield* session.compact({ sessionID: ctx.params.sessionID }).pipe(
176:             Effect.catchTag("Session.NotFoundError", (error) =>
177:               Effect.fail(
178:                 new SessionNotFoundError({
179:                   sessionID: error.sessionID,
180:                   message: `Session not found: ${error.sessionID}`,
181:                 }),
182:               ),
183:             ),
184:             Effect.catchTag("Session.OperationUnavailableError", (error) =>
185:               Effect.fail(
186:                 new ServiceUnavailableError({
187:                   message: `Session ${error.operation} is not available yet`,
188:                   service: `session.${error.operation}`,
189:                 }),
190:             ...
gateway · 2026-09-14 08:17:15
result
Found 100 matches (more matches available)
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 248:       resume: coordinator.run,

  Line 355:     resume: false,

  Line 357:   yield* session.resume(sessionID)

  Line 479:     yield* session.prompt({ sessionID, prompt: Prompt.make({ text: prompt }), resume: false })

  Line 485:     yield* session.resume(sessionID)

  Line 510:     yield* session.prompt({ sessionID, prompt: Prompt.make({ text: prompt }), resume: false })

  Line 513:     expect(yield* session.resume(sessionID).pipe(Effect.flip)).toBe(failure)

  Line 530:     const fixture = fragmentFixture(kind, fragmentID(kind, "interrupted"), ["Partial"])

  Line 532:     yield* session.prompt({ sessionID, prompt: Prompt.make({ text: prompt }), resume: false })

  Line 547:         error: { type: "unknown", message: "Provider turn interrupted" },

  Line 550:             ? ...
gateway · 2026-09-14 08:17:23
result
<path>/home/byk/Code/opencode/packages/core/src/session/event.ts</path>
<type>file</type>
<content>
1: export * from "@opencode-ai/schema/session-event"
2: export * as SessionEvent from "@opencode-ai/schema/session-event"

(End of file - total 2 lines)
</content>
gateway · 2026-09-14 08:17:27
result
/home/byk/Code/opencode/packages/schema/src/v1/session.ts
/home/byk/Code/opencode/packages/schema/src/session.ts
/home/byk/Code/opencode/packages/schema/src/session-v1.ts
/home/byk/Code/opencode/packages/schema/src/session-todo.ts
/home/byk/Code/opencode/packages/schema/src/session-status-event.ts
/home/byk/Code/opencode/packages/schema/src/session-message.ts
/home/byk/Code/opencode/packages/schema/src/session-input.ts
/home/byk/Code/opencode/packages/schema/src/session-id.ts
/home/byk/Code/opencode/packages/schema/src/session-event.ts
/home/byk/Code/opencode/packages/schema/src/session-delivery.ts
/home/byk/Code/opencode/packages/schema/src/session-compaction-event.ts
gateway · 2026-09-14 08:17:32
result
<path>/home/byk/Code/opencode/packages/schema/src/session-event.ts</path>
<type>file</type>
<content>
1: export * as SessionEvent from "./session-event"
2: 
3: import { Schema } from "effect"
4: import { optional } from "./schema"
5: import { Event } from "./event"
6: import { ProviderMetadata, ToolContent } from "./llm"
7: import { Delivery } from "./session-delivery"
8: import { Model } from "./model"
9: import { DateTimeUtcFromMillis, NonNegativeInt, RelativePath } from "./schema"
10: import { FileAttachment, Prompt } from "./prompt"
11: import { SessionID } from "./session-id"
12: import { Location } from "./location"
13: import { SessionMessage } from "./session-message"
14: import { Revert } from "./revert"
15: 
16: export { FileAttachment }
17: 
18: export const Source = Schema.Struct({
19:   start: NonNegativeInt,
20:   end: NonNegativeInt,
21:   text: Schema.String,
22: }).annotate({
23:   identifier: "session.next.event.source",
24: })
25: export interface Source extends ...
gateway · 2026-09-14 08:17:37
result
<path>/home/byk/Code/opencode/packages/core/src/session/runner/publish-llm-event.ts</path>
<type>file</type>
<content>
1: import { ToolOutput, type LLMEvent, type ProviderMetadata, type ToolResultValue, type Usage } from "@opencode-ai/llm"
2: import { DateTime, Effect } from "effect"
3: import { EventV2 } from "../../event"
4: import { ModelV2 } from "../../model"
5: import { SessionEvent } from "../event"
6: import { SessionMessage } from "../message"
7: import { SessionSchema } from "../schema"
8: 
9: type Input = {
10:   readonly sessionID: SessionSchema.ID
11:   readonly agent: string
12:   readonly model: ModelV2.Ref
13:   readonly snapshot?: string
14: }
15: 
16: const safe = (value: number | undefined) => Math.max(0, Number.isFinite(value) ? (value ?? 0) : 0)
17: 
18: const tokens = (usage: Usage | undefined) => {
19:   const reasoning = safe(usage?.reasoningTokens)
20:   const read = safe(usage?.cacheReadInputTokens)
21:   const write = safe(usage?.cacheWriteInputTokens)
22:   ...
gateway · 2026-09-14 08:17:55
result
Found 100 matches (more matches available)
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 357:   yield* session.resume(sessionID)

  Line 485:     yield* session.resume(sessionID)

  Line 513:     expect(yield* session.resume(sessionID).pipe(Effect.flip)).toBe(failure)

  Line 587:       yield* session.resume(sessionID)

  Line 645:       yield* session.resume(sessionID)

  Line 668:       const exit = yield* session.resume(sessionID).pipe(Effect.exit)

  Line 699:       yield* session.resume(sessionID)

  Line 708:       const exit = yield* session.resume(sessionID).pipe(Effect.exit)

  Line 723:       yield* session.resume(sessionID)

  Line 733:       const exit = yield* session.resume(sessionID).pipe(Effect.exit)

  Line 749:       yield* session.resume(sessionID)

  Line 752:       yield* session.resume(sessionID)

  Line 790:       yield* session.resume(sessionID)

  Line 816:       yield* session.resume(sessionID)

  Line 845:       yield* ...
gateway · 2026-09-14 08:18:01
result
No files found
gateway · 2026-09-14 08:18:10
result
Found 100 matches (more matches available)
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 17: import { LayerNode } from "@opencode-ai/core/effect/layer-node"

  Line 154: const echoNode = makeLocationNode({ name: "test/session-runner-tools", layer: echo, deps: [ToolRegistry.node] })

  Line 157: const models = SessionRunnerModel.layerWith((session) =>

  Line 249:       wake: coordinator.wake,

  Line 374:     const recorded = yield* db

  Line 386:       recorded.map((event) => ({

  Line 459:       const expectedContent = { type: "tool", id, state: { status: "pending", input: text } }

  Line 741:   it.effect("reuses one durable baseline after the context producer changes", () =>

  Line 775:   it.effect("includes the effective default agent system before durable context", () =>

  Line 941:   it.effect("admits removed context as a chronological System message", () =>

  Line 1039:   it.effect("rebuilds the baseline directly after completed compaction", () ...
gateway · 2026-09-14 08:18:16
result
<path>/home/byk/Code/opencode/packages/core/test/session-runner.test.ts</path>
<type>file</type>
<content>
1840:       yield* session.prompt({ sessionID, prompt: Prompt.make({ text: "Run once" }), resume: false })
1841: 
1842:       requests.length = 0
1843:       responses = undefined
1844:       response = [
1845:         LLMEvent.stepStart({ index: 0 }),
1846:         LLMEvent.textStart({ id: "text-once" }),
1847:         LLMEvent.textDelta({ id: "text-once", text: "Once" }),
1848:         LLMEvent.textEnd({ id: "text-once" }),
1849:         LLMEvent.stepFinish({ index: 0, reason: "stop" }),
1850:         LLMEvent.finish({ reason: "stop" }),
1851:       ]
1852:       streamGate = yield* Deferred.make<void>()
1853:       streamStarted = yield* Deferred.make<void>()
1854: 
1855:       const first = yield* session.resume(sessionID).pipe(Effect.forkChild)
1856:       yield* Deferred.await(streamStarted)
1857:       const second = yield* ...
gateway · 2026-09-14 08:18:24
result
Found 22 matches
/home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts:
  Line 5: /** Serializes execution for each key while allowing different keys to run concurrently. */

  Line 7:   /** Snapshots keys with an execution owned by this coordinator. */

  Line 9:   /** Starts execution while idle or joins the active execution. */

  Line 13:   /** Stops active execution and waits for its cleanup. */

  Line 19:   owner?: Fiber.Fiber<void, never>

  Line 39:       const owner = fork(

  Line 47:       entry.owner = owner

  Line 97:         if (entry?.owner === undefined) return Effect.void

  Line 100:         return Fiber.interrupt(entry.owner)


/home/byk/Code/opencode/packages/core/src/session/execution.ts:
  Line 1: export * as SessionExecution from "./execution"

  Line 10:   /** Snapshots active execution owned by this process. */

  Line 12:   /** Starts execution while idle or joins the active execution. ...
gateway · 2026-09-14 08:18:32
result
<path>/home/byk/Code/opencode/packages/core/src/session/projector.ts</path>
<type>file</type>
<content>
1: export * as SessionProjector from "./projector"
2: 
3: import { and, desc, eq, gt, or, sql } from "drizzle-orm"
4: import { DateTime, Effect, Layer, Schema } from "effect"
5: import { Database } from "../database/database"
6: import { EventV2 } from "../event"
7: import { makeGlobalNode } from "../effect/app-node"
8: import { SessionEvent } from "./event"
9: import { SessionV1 } from "../v1/session"
10: import { WorkspaceTable } from "../control-plane/workspace.sql"
11: import { SessionMessage } from "./message"
12: import { SessionMessageUpdater } from "./message-updater"
13: import { SessionInput } from "./input"
14: import { WorkspaceV2 } from "../workspace"
15: import { MessageTable, PartTable, SessionInputTable, SessionMessageTable, SessionTable } from "./sql"
16: import type { DeepMutable } from "../schema"
17: 
18: type DatabaseService = Database.Interface["db"]
19: 
20: ...
gateway · 2026-09-14 08:18:40
result
<path>/home/byk/Code/opencode/packages/core/src/event.ts</path>
<type>file</type>
<content>
1: export * as EventV2 from "./event"
2: 
3: import { Cause, Context, Effect, Layer, Option, PubSub, Queue, Schema, Stream } from "effect"
4: import { Event } from "@opencode-ai/schema/event"
5: import type { Data, Definition, Payload } from "@opencode-ai/schema/event"
6: import { and, asc, eq, gt, inArray } from "drizzle-orm"
7: import { Database } from "./database/database"
8: import { EventSequenceTable, EventTable } from "./event/sql"
9: import { Location } from "./location"
10: import { makeGlobalNode } from "./effect/app-node"
11: import { isDeepStrictEqual } from "node:util"
12: import { Durable } from "@opencode-ai/schema/durable-event-manifest"
13: 
14: export const ID = Event.ID
15: export type ID = import("@opencode-ai/schema/event").ID
16: export type { Data, Definition, Payload } from "@opencode-ai/schema/event"
17: 
18: export type Subscriber<D extends Definition = Definition> = ...
gateway · 2026-09-14 08:18:50
result
<path>/home/byk/Code/opencode/packages/core/src/session/message-updater.ts</path>
<type>file</type>
<content>
1: import { castDraft, produce, type WritableDraft } from "immer"
2: import { Effect } from "effect"
3: import { SessionEvent } from "./event"
4: import { SessionMessage } from "./message"
5: 
6: export type MemoryState = {
7:   messages: SessionMessage.Message[]
8: }
9: 
10: export interface Adapter {
11:   readonly getCurrentAssistant: () => Effect.Effect<SessionMessage.Assistant | undefined>
12:   readonly getAssistant: (messageID: SessionMessage.ID) => Effect.Effect<SessionMessage.Assistant | undefined>
13:   readonly getCurrentShell: (callID: string) => Effect.Effect<SessionMessage.Shell | undefined>
14:   readonly updateAssistant: (assistant: SessionMessage.Assistant) => Effect.Effect<void>
15:   readonly updateShell: (shell: SessionMessage.Shell) => Effect.Effect<void>
16:   readonly appendMessage: (message: SessionMessage.Message) => Effect.Effect<void>
17: }
18: 
19: ...
gateway · 2026-09-14 08:18:54
result
<path>/home/byk/Code/opencode/packages/core/src/session/history.ts</path>
<type>file</type>
<content>
1: import { and, asc, desc, eq, gt, gte, ne, or } from "drizzle-orm"
2: import { Effect, Schema } from "effect"
3: import { Database } from "../database/database"
4: import { MessageDecodeError } from "./error"
5: import { SessionMessage } from "./message"
6: import { SessionSchema } from "./schema"
7: import { SessionContextEpochTable, SessionMessageTable } from "./sql"
8: 
9: type DatabaseService = Database.Interface["db"]
10: 
11: const decode = Schema.decodeUnknownEffect(SessionMessage.Message)
12: 
13: export const latestCompaction = Effect.fnUntraced(function* (db: DatabaseService, sessionID: SessionSchema.ID) {
14:   return yield* db
15:     .select({ seq: SessionMessageTable.seq })
16:     .from(SessionMessageTable)
17:     .where(and(eq(SessionMessageTable.session_id, sessionID), eq(SessionMessageTable.type, "compaction")))
18:     .orderBy(desc(SessionMessageTable.seq))
19:  ...
gateway · 2026-09-14 08:19:07
result
<path>/home/byk/Code/opencode/packages/core/src/session/runner/to-llm-message.ts</path>
<type>file</type>
<content>
1: import {
2:   Message,
3:   ToolCallPart,
4:   ToolOutput,
5:   ToolResultPart,
6:   type ContentPart,
7:   type Model,
8:   type ProviderMetadata,
9: } from "@opencode-ai/llm"
10: import { SessionMessage } from "../message"
11: import type { FileAttachment } from "../prompt"
12: 
13: const media = (file: FileAttachment): ContentPart => ({
14:   type: "media",
15:   mediaType: file.mime,
16:   data: file.uri,
17:   filename: file.name,
18:   metadata: file.description === undefined ? undefined : { description: file.description },
19: })
20: 
21: const toolInput = (tool: SessionMessage.AssistantTool) => {
22:   if (tool.state.status !== "pending") return tool.state.input
23:   try {
24:     return JSON.parse(tool.state.input) as unknown
25:   } catch {
26:     return tool.state.input
27:   }
28: }
29: 
30: const toolCall = (tool: SessionMessage.AssistantTool, ...
gateway · 2026-09-14 08:19:26
result
<path>/home/byk/Code/opencode/packages/core/test/session-prompt.test.ts</path>
<type>file</type>
<content>
1: import { describe, expect } from "bun:test"
2: import { DateTime, Effect, Fiber, Layer, Stream } from "effect"
3: import { eq } from "drizzle-orm"
4: import { Database } from "@opencode-ai/core/database/database"
5: import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
6: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
7: import { EventV2 } from "@opencode-ai/core/event"
8: import { EventTable } from "@opencode-ai/core/event/sql"
9: import { SessionEvent } from "@opencode-ai/core/session/event"
10: import { Project } from "@opencode-ai/core/project"
11: import { ProjectTable } from "@opencode-ai/core/project/sql"
12: import { AbsolutePath } from "@opencode-ai/core/schema"
13: import { SessionV2 } from "@opencode-ai/core/session"
14: import { Prompt } from "@opencode-ai/core/session/prompt"
15: import { SessionMessage } from ...
gateway · 2026-09-14 08:19:34
result
Found 7 matches
/home/byk/Code/opencode/packages/opencode/specs/v2/message-shape.md:
  Line 5: - stored messages need enough data to replay and resume a session later

  Line 23:     tools?: Record<string, boolean>

  Line 49:   parts: [{ type: "text", text: "Summarize the tool output above and continue." }],

  Line 76:   parts: [{ type: "text", text: "Summarize the tool output above and continue." }],

  Line 99:     tools?: Record<string, boolean>

  Line 123:     model: { providerID: "openai", modelID: "gpt-5" },

  Line 132:   parts: [{ type: "text", text: "Summarize the tool output above and continue." }],
gateway · 2026-09-14 08:19:39
result
/home/byk/Code/opencode/packages/opencode/specs/v2/tui-command-shim.md
/home/byk/Code/opencode/packages/opencode/specs/v2/notifications.md
/home/byk/Code/opencode/packages/opencode/specs/v2/message-shape.md
gateway · 2026-09-14 08:19:53
result
Found 2 matches
/home/byk/Code/opencode/packages/protocol/src/groups/session.ts:
  Line 146:       HttpApiEndpoint.get("session.active", "/api/session/active", {

  Line 345:       HttpApiEndpoint.post("session.interrupt", "/api/session/:sessionID/interrupt", {
gateway · 2026-09-14 08:20:00
result
<path>/home/byk/Code/opencode/packages/protocol/src/groups/session.ts</path>
<type>file</type>
<content>
120:         OpenApi.annotations({
121:           identifier: "v2.session.list",
122:           summary: "List sessions",
123:           description:
124:             "Retrieve sessions in the requested order. Items keep that order across pages; use cursor.next or cursor.previous to move through the ordered list.",
125:         }),
126:       ),
127:     )
128:     .add(
129:       HttpApiEndpoint.post("session.create", "/api/session", {
130:         payload: Schema.Struct({
131:           id: Session.ID.pipe(Schema.optional),
132:           agent: Agent.ID.pipe(Schema.optional),
133:           model: Model.Ref.pipe(Schema.optional),
134:           location: Location.Ref.pipe(Schema.optional),
135:         }),
136:         success: Schema.Struct({ data: Session.Info }),
137:       }).annotateMerge(
138:         OpenApi.annotations({
139:           identifier: ...
gateway · 2026-09-14 08:20:11
result
Found 13 matches
/home/byk/Code/opencode/packages/cli/src/services/daemon.ts:
  Line 48:       // Keep one private credential across server restarts so discovered clients


/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 2262:   it.effect("durably fails local tools left running by a prior process before continuing", () =>

  Line 2322:   it.effect("durably fails hosted tools left running by a prior process before continuing inline", () =>

  Line 2382:   it.effect("durably fails pending tool input left by a prior process before continuing", () =>


/home/byk/Code/opencode/packages/core/test/tool-bash.test.ts:
  Line 430:     "Persist background job status and define restart recovery before exposing remote observation.",


/home/byk/Code/opencode/packages/core/src/file-mutation.ts:
  Line 207: // TODO: Define crash recovery and idempotency for side effects between Tool.Called and durable ...
gateway · 2026-09-14 08:20:20
result
<path>/home/byk/Code/opencode/packages/core/src/file-mutation.ts</path>
<type>file</type>
<content>
150:           }
151:           yield* typeof input.content === "string"
152:             ? fs.writeFileString(input.target.canonical, input.content)
153:             : fs.writeFile(input.target.canonical, input.content)
154:           return writeResult(input.target, true)
155:         }),
156:       ),
157:     )
158: 
159:     const remove = Effect.fn("FileMutation.remove")((input: RemoveInput) =>
160:       withTargetLock(input.target)(
161:         Effect.gen(function* () {
162:           const existed = yield* fs.remove(input.target.canonical).pipe(
163:             Effect.as(true),
164:             Effect.catchReason("PlatformError", "NotFound", () => Effect.succeed(false)),
165:           )
166:           return removeResult(input.target, existed)
167:         }),
168:       ),
169:     )
170: 
171:     return Service.of({ create, write, writeTextPreservingBom, writeIfUnchanged, ...
gateway · 2026-09-14 08:20:27
result
<path>/home/byk/Code/opencode/packages/core/src/tool/registry.ts</path>
<type>file</type>
<content>
1: export * as ToolRegistry from "./registry"
2: 
3: import { ToolOutput, type ToolCall, type ToolDefinition, type ToolResultValue } from "@opencode-ai/llm"
4: import { Context, Effect, Layer, Scope } from "effect"
5: import { AgentV2 } from "../agent"
6: import { PermissionV2 } from "../permission"
7: import { SessionMessage } from "../session/message"
8: import { SessionSchema } from "../session/schema"
9: import { ToolOutputStore } from "../tool-output-store"
10: import { Wildcard } from "../util/wildcard"
11: import { ApplicationTools } from "./application-tools"
12: import { definition, permission, settle, validateName, type AnyTool, type RegistrationError } from "./tool"
13: import { Tools } from "./tools"
14: import { makeLocationNode } from "../effect/app-node"
15: 
16: export type ExecuteInput = {
17:   readonly sessionID: SessionSchema.ID
18:   readonly agent: AgentV2.ID
19:   ...
gateway · 2026-09-14 08:20:45
result
Found 4 matches
/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts:
  Line 64:  *   - [x] Stream exactly one `llm.stream(request)` provider turn.

  Line 85:  * Use `llm.stream(request)` for each provider turn. Keep tool execution and continuation here.

  Line 209:             "x-session-affinity": session.id,

  Line 239:       const providerStream = llm.stream(request).pipe(
gateway · 2026-09-14 08:20:55
result
<path>/home/byk/Code/opencode/packages/core/test/session-runner.test.ts</path>
<type>file</type>
<content>
1: import { describe, expect } from "bun:test"
2: import {
3:   LLMClient,
4:   LLMError,
5:   LLMEvent,
6:   Model,
7:   TransportReason,
8:   InvalidRequestReason,
9:   type LLMClientShape,
10:   type LLMRequest,
11: } from "@opencode-ai/llm"
12: import * as OpenAIChat from "@opencode-ai/llm/protocols/openai-chat"
13: import { Database } from "@opencode-ai/core/database/database"
14: import { makeLocationNode } from "@opencode-ai/core/effect/app-node"
15: import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
16: import { LayerNodePlatform } from "@opencode-ai/core/effect/app-node-platform"
17: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
18: import { EventV2 } from "@opencode-ai/core/event"
19: import { PermissionV2 } from "@opencode-ai/core/permission"
20: import { EventTable } from "@opencode-ai/core/event/sql"
21: import { Project } ...
gateway · 2026-09-14 08:21:01
result
<path>/home/byk/Code/opencode/packages/core/test/session-run-coordinator.test.ts</path>
<type>file</type>
<content>
1: import { describe, expect } from "bun:test"
2: import { Cause, Deferred, Effect, Exit, Fiber, Layer } from "effect"
3: import { SessionRunCoordinator } from "@opencode-ai/core/session/run-coordinator"
4: import { testEffect } from "./lib/effect"
5: 
6: const it = testEffect(Layer.empty)
7: 
8: describe("SessionRunCoordinator", () => {
9:   it.effect("joins concurrent resumes for one key", () =>
10:     Effect.scoped(
11:       Effect.gen(function* () {
12:         const gate = yield* Deferred.make<void>()
13:         let runs = 0
14:         const coordinator = yield* SessionRunCoordinator.make({
15:           drain: () => Effect.sync(() => runs++).pipe(Effect.andThen(Deferred.await(gate))),
16:         })
17: 
18:         const first = yield* coordinator.run("session").pipe(Effect.forkChild)
19:         yield* Effect.yieldNow
20:         const second = yield* ...
gateway · 2026-09-14 08:21:07
result
Found 6 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 1687:   it.effect("starts recorded local tools eagerly and awaits settlement before continuing", () =>

  Line 2291:       yield* events.publish(SessionEvent.Tool.Called, {

  Line 2355:       yield* events.publish(SessionEvent.Tool.Called, {


/home/byk/Code/opencode/packages/core/test/application-tools.test.ts:
  Line 216:   it.effect("captures the registered record before later State rebuilds", () =>


/home/byk/Code/opencode/packages/core/test/tool-bash.test.ts:
  Line 263:   it.live("approves an explicit external workdir before bash execution", () =>


/home/byk/Code/opencode/packages/core/test/session-tool-progress.test.ts:
  Line 77:           yield* service.publish(SessionEvent.Tool.Called, {
gateway · 2026-09-14 08:21:13
result
<path>/home/byk/Code/opencode/packages/core/test/session-runner.test.ts</path>
<type>file</type>
<content>
1600:       yield* replaySessionProjection(sessionID)
1601: 
1602:       expect(yield* session.context(sessionID)).toMatchObject([
1603:         { type: "user", text: "Think first" },
1604:         {
1605:           type: "assistant",
1606:           content: [
1607:             { type: "reasoning", text: "Signed thought", providerMetadata: { anthropic: { signature: "sig_1" } } },
1608:             {
1609:               type: "reasoning",
1610:               text: "Encrypted thought",
1611:               providerMetadata: { openai: { itemId: "rs_1", reasoningEncryptedContent: "encrypted-state" } },
1612:             },
1613:           ],
1614:         },
1615:       ])
1616: 
1617:       yield* session.prompt({ sessionID, prompt: Prompt.make({ text: "Continue" }), resume: false })
1618:       response = []
1619:       yield* session.resume(sessionID)
1620: 
1621:       ...
gateway · 2026-09-14 08:22:06
result
No files found
gateway · 2026-09-14 08:22:12
result
No files found
gateway · 2026-09-14 08:22:18
result
No files found
gateway · 2026-09-14 08:22:26
result
Found 75 matches
/home/byk/Code/opencode/packages/core/src/fs-util.ts:
  Line 149:           try: () => Glob.scan(pattern, options),


/home/byk/Code/opencode/packages/core/src/tool-output-store.ts:
  Line 199: /** Runs retention scanning once globally rather than once per active Location. */


/home/byk/Code/opencode/packages/core/src/session.ts:
  Line 382:             if (input.resume !== false) yield* execution.wake(admitted.sessionID)


/home/byk/Code/opencode/packages/core/src/event.ts:
  Line 357:                       (wake) => PubSub.publish(wake, undefined),

  Line 567:           const wake = yield* PubSub.sliding<void>(1)

  Line 568:           const subscription = yield* PubSub.subscribe(wake)

  Line 571:               const wakes = pubsub.durable.get(aggregateID) ?? new Set()

  Line 572:               wakes.add(wake)

  Line 573:               pubsub.durable.set(aggregateID, wakes)

  Line 577:                 const wakes = pubsub.durable.get(aggregateID)

  Line 578:  ...
gateway · 2026-09-14 08:22:31
result
Found 4 matches
/home/byk/Code/opencode/packages/opencode/src/session/session.ts:
  Line 14: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"


/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:
  Line 67: import { SessionExecution } from "@opencode-ai/core/session/execution"

  Line 68: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"

  Line 301:         [SessionExecution.node, SessionExecutionLocal.node],
gateway · 2026-09-14 08:22:37
result
<path>/home/byk/Code/opencode/packages/opencode/src/session/session.ts</path>
<type>file</type>
<content>
1: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2: import { PermissionV1 } from "@opencode-ai/core/v1/permission"
3: import { Slug } from "@opencode-ai/core/util/slug"
4: import { SessionV1 } from "@opencode-ai/core/v1/session"
5: import { serviceUse } from "@opencode-ai/core/effect/service-use"
6: import path from "path"
7: import { BackgroundJob } from "@/background/job"
8: import { Decimal } from "decimal.js"
9: import type { ProviderMetadata, Usage } from "@opencode-ai/llm"
10: import { InstallationVersion } from "@opencode-ai/core/installation/version"
11: import { Database } from "@opencode-ai/core/database/database"
12: import { EventV2Bridge } from "@/event-v2-bridge"
13: import { SessionV2 } from "@opencode-ai/core/session"
14: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"
15: import { locationServiceMapLayer } from ...
gateway · 2026-09-14 08:22:43
result
Found 4 matches
/home/byk/Code/opencode/packages/opencode/src/session/session.ts:
  Line 13: import { SessionV2 } from "@opencode-ai/core/session"

  Line 14: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"


/home/byk/Code/opencode/packages/opencode/src/session/schema.ts:
  Line 4: import { SessionV2 } from "@opencode-ai/core/session"

  Line 7: export const SessionID = SessionV2.ID
gateway · 2026-09-14 08:22:50
result
<path>/home/byk/Code/opencode/packages/opencode/src/session/session.ts</path>
<type>file</type>
<content>
930:       updatePart,
931:       getPart,
932:       updatePartDelta,
933:       findMessage,
934:     })
935:   }),
936: )
937: 
938: const cancelBackgroundJobs = Effect.fn("Session.cancelBackgroundJobs")(function* (
939:   background: BackgroundJob.Interface,
940:   sessionID: SessionID,
941: ) {
942:   const jobs = yield* background.list()
943:   yield* Effect.forEach(
944:     jobs.filter((job) => {
945:       if (job.status !== "running") return false
946:       if (job.id === sessionID) return true
947:       if (job.metadata?.sessionId === sessionID) return true
948:       return job.metadata?.parentSessionId === sessionID
949:     }),
950:     (job) => background.cancel(job.id),
951:     { concurrency: "unbounded", discard: true },
952:   )
953: })
954: 
955: function listByProject(
956:   db: Database.Interface["db"],
957:   input: ListInput & {
958:     projectID: ...
gateway · 2026-09-14 08:22:58
result
<path>/home/byk/Code/opencode/packages/core/src/event/sql.ts</path>
<type>file</type>
<content>
1: import { sqliteTable, text, integer, index, uniqueIndex } from "drizzle-orm/sqlite-core"
2: import type { EventV2 } from "../event"
3: 
4: export const EventSequenceTable = sqliteTable("event_sequence", {
5:   aggregate_id: text().notNull().primaryKey(),
6:   seq: integer().notNull(),
7:   owner_id: text(),
8: })
9: 
10: export const EventTable = sqliteTable(
11:   "event",
12:   {
13:     id: text().$type<EventV2.ID>().primaryKey(),
14:     aggregate_id: text()
15:       .notNull()
16:       .references(() => EventSequenceTable.aggregate_id, { onDelete: "cascade" }),
17:     seq: integer().notNull(),
18:     type: text().notNull(),
19:     data: text({ mode: "json" }).$type<Record<string, unknown>>().notNull(),
20:   },
21:   (table) => [
22:     uniqueIndex("event_aggregate_seq_idx").on(table.aggregate_id, table.seq),
23:     index("event_aggregate_type_seq_idx").on(table.aggregate_id, ...
gateway · 2026-09-14 08:23:03
result
Found 19 matches
/home/byk/Code/opencode/packages/core/src/plugin/provider/openai.ts:
  Line 276:   return claim(tokens.id_token) ?? claim(tokens.access_token)

  Line 279: function claim(token: string) {


/home/byk/Code/opencode/packages/core/src/event.ts:
  Line 140:     options?: { readonly publish?: boolean; readonly ownerID?: string; readonly strictOwner?: boolean },

  Line 144:     options?: { readonly publish?: boolean; readonly ownerID?: string; readonly strictOwner?: boolean },

  Line 147:   readonly claim: (aggregateID: string, ownerID: string) => Effect.Effect<void>

  Line 211:           readonly ownerID?: string

  Line 244:                             .select({ seq: EventSequenceTable.seq, ownerID: EventSequenceTable.owner_id })

  Line 254:                           if (input?.strictOwner && row?.ownerID && row.ownerID !== input.ownerID) {

  Line 258:                                 message: `Replay owner mismatch for aggregate ${aggregateID}: expected ...
gateway · 2026-09-14 08:23:10
result
<path>/home/byk/Code/opencode/packages/core/src/event.ts</path>
<type>file</type>
<content>
510:           return source
511:         })
512:       }
513: 
514:       function remove(aggregateID: string) {
515:         return db
516:           .transaction(() =>
517:             Effect.gen(function* () {
518:               yield* db.delete(EventSequenceTable).where(eq(EventSequenceTable.aggregate_id, aggregateID)).run()
519:               yield* db.delete(EventTable).where(eq(EventTable.aggregate_id, aggregateID)).run()
520:             }),
521:           )
522:           .pipe(Effect.orDie)
523:       }
524: 
525:       function claim(aggregateID: string, ownerID: string) {
526:         return db
527:           .update(EventSequenceTable)
528:           .set({ owner_id: ownerID })
529:           .where(eq(EventSequenceTable.aggregate_id, aggregateID))
530:           .run()
531:           .pipe(Effect.orDie)
532:       }
533: 
534:       const subscribe = <D extends ...
gateway · 2026-09-14 08:23:16
result
Found 3 matches
/home/byk/Code/opencode/packages/server/src/routes.ts:
  Line 10: import { SessionExecution } from "@opencode-ai/core/session/execution"

  Line 12: import { SessionExecutionLocal } from "@opencode-ai/core/session/execution/local"

  Line 52:   const serviceLayer = AppNodeBuilder.build(applicationServices, [[SessionExecution.node, SessionExecutionLocal.node]])
gateway · 2026-09-14 08:23:23
result
Found 17 matches
/home/byk/Code/opencode/packages/opencode/src/question/index.ts:
  Line 119:       const existing = pending.get(input.requestID)

  Line 124:       pending.delete(input.requestID)


/home/byk/Code/opencode/packages/opencode/src/permission/index.ts:
  Line 111:       const existing = pending.get(input.requestID)

  Line 114:       pending.delete(input.requestID)


/home/byk/Code/opencode/packages/opencode/src/session/session.ts:
  Line 14: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"


/home/byk/Code/opencode/packages/opencode/src/session/processor.ts:
  Line 243:           state: { status: "pending", input: {}, raw: "" },


/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:
  Line 67: import { SessionExecution } from "@opencode-ai/core/session/execution"

  Line 68: import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"

  Line 301:         [SessionExecution.node, ...
gateway · 2026-09-14 08:23:54
result
<path>/home/byk/Code/opencode/packages/core/test/session-prompt.test.ts</path>
<type>file</type>
<content>
400:     }),
401:   )
402: 
403:   it.effect("reprojects pending inbox input without scheduling execution", () =>
404:     Effect.gen(function* () {
405:       yield* setup
406:       const { db } = yield* Database.Service
407:       const session = yield* SessionV2.Service
408:       const events = yield* EventV2.Service
409:       wakeCalls.length = 0
410:       yield* session.prompt({
411:         id: messageID,
412:         sessionID,
413:         prompt: Prompt.make({ text: "Replay pending" }),
414:         resume: false,
415:       })
416:       const recorded = yield* db
417:         .select()
418:         .from(EventTable)
419:         .where(eq(EventTable.aggregate_id, sessionID))
420:         .all()
421:         .pipe(Effect.orDie)
422: 
423:       yield* events.remove(sessionID)
424:       yield* db.delete(SessionInputTable).where(eq(SessionInputTable.session_id, ...
gateway · 2026-09-14 08:24:21
result
Found 76 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 626:       expect(requests).toHaveLength(1)

  Line 647:       expect(requests).toHaveLength(1)

  Line 658:   it.effect("retries the first provider turn after system context becomes available", () =>

  Line 672:       expect(requests).toHaveLength(0)

  Line 685:       expect(requests).toHaveLength(1)

  Line 711:       expect(requests).toHaveLength(1)

  Line 737:       expect(requests).toHaveLength(0)

  Line 1103:       expect(requests).toHaveLength(2)

  Line 1139:       expect(requests).toHaveLength(2)

  Line 1170:       expect(requests).toHaveLength(2)

  Line 1201:       expect(requests).toHaveLength(2)

  Line 1226:       expect(requests).toHaveLength(3)

  Line 1256:       expect(requests).toHaveLength(3)

  Line 1284:       expect(requests).toHaveLength(3)

  Line 1302:       expect(requests).toHaveLength(2)

  Line 1332:       expect(requests).toHaveLength(2)

  Line 1431:       ...
gateway · 2026-09-14 08:24:29
result
<path>/home/byk/Code/opencode/packages/core/test/session-runner.test.ts</path>
<type>file</type>
<content>
580:           LLMEvent.toolCall({ id: "call-application", name: "application_context", input: { query: "hello" } }),
581:           LLMEvent.stepFinish({ index: 0, reason: "tool-calls" }),
582:           LLMEvent.finish({ reason: "tool-calls" }),
583:         ],
584:         [],
585:       ]
586: 
587:       yield* session.resume(sessionID)
588: 
589:       expect(requests[0]?.tools.map((tool) => tool.name)).toContain("application_context")
590:       expect(contexts).toEqual([
591:         {
592:           sessionID,
593:           agent: AgentV2.ID.make("build"),
594:           assistantMessageID: expect.stringMatching(/^msg_/),
595:           toolCallID: "call-application",
596:         },
597:       ])
598:       expect(yield* session.context(sessionID)).toMatchObject([
599:         { type: "user", text: "Use application context" },
600:         {
601:           type: ...
gateway · 2026-09-14 08:24:38
result
Found 5 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 2441:   it.effect("retries inbox input after prompt projection rolls back", () =>

  Line 2467:   it.effect("does not strand a committed promotion when a post-commit listener defects", () =>


/home/byk/Code/opencode/packages/core/test/event.test.ts:
  Line 175:   it.effect("commits local operational state inside a new durable event transaction", () =>

  Line 192:   it.effect("rolls back the durable event and projector when the local commit fails", () =>


/home/byk/Code/opencode/packages/core/test/filesystem/filesystem.test.ts:
  Line 147:       "is idempotent",
gateway · 2026-09-14 08:24:50
result
<path>/home/byk/Code/opencode/packages/core/test/event.test.ts</path>
<type>file</type>
<content>
90:       const fiber = yield* events.subscribe(Message).pipe(Stream.take(1), Stream.runCollect, Effect.forkScoped)
91:       yield* Effect.yieldNow
92:       const event = yield* events.publish(Message, { text: "hello" })
93:       const received = Array.from(yield* Fiber.join(fiber))
94: 
95:       expect(received).toEqual([event])
96:       expect(event.type).toBe("test.message")
97:       expect(event).not.toHaveProperty("version")
98:       expect(event.data).toEqual({ text: "hello" })
99:       expect(event.location).toEqual({
100:         directory: AbsolutePath.make("project"),
101:         workspaceID: WorkspaceV2.ID.make("wrk_test"),
102:       })
103:     }),
104:   )
105: 
106:   itWithoutLocation.effect("omits location when no location is available", () =>
107:     Effect.gen(function* () {
108:       const events = yield* EventV2.Service
109:       const event = yield* ...
gateway · 2026-09-14 08:24:56
result
Found 3 matches
/home/byk/Code/opencode/packages/protocol/src/groups/session.ts:
  Line 83: const SessionActive = Schema.Struct({

  Line 85: }).annotate({ identifier: "SessionActive" })

  Line 147:         success: Schema.Struct({ data: Schema.Record(Session.ID, SessionActive) }),
gateway · 2026-09-14 08:25:01
result
<path>/home/byk/Code/opencode/packages/protocol/src/groups/session.ts</path>
<type>file</type>
<content>
70:       make: (input: typeof SessionsCursorInput.Type) => make(Encoding.encodeBase64Url(encodeSessionsCursor(input))),
71:       parse: (input: string) =>
72:         Effect.suspend(() => {
73:           const result = Encoding.decodeBase64UrlString(input)
74:           return Result.isFailure(result)
75:             ? Effect.fail(invalidCursor)
76:             : decodeSessionsCursor(result.success).pipe(Effect.mapError(() => invalidCursor))
77:         }),
78:     }
79:   }),
80: )
81: export type SessionsCursor = typeof SessionsCursor.Type
82: 
83: const SessionActive = Schema.Struct({
84:   type: Schema.Literal("running"),
85: }).annotate({ identifier: "SessionActive" })
86: 
87: const SessionHistoryLimit = PositiveInt.check(Schema.isLessThanOrEqualTo(100))
88: 
89: export const SessionHistoryQuery = Schema.Struct({
90:   limit: ...
gateway · 2026-09-14 08:25:07
result
Found 5 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 2262:   it.effect("durably fails local tools left running by a prior process before continuing", () =>

  Line 2322:   it.effect("durably fails hosted tools left running by a prior process before continuing inline", () =>

  Line 2382:   it.effect("durably fails pending tool input left by a prior process before continuing", () =>


/home/byk/Code/opencode/packages/core/test/session-runner-tool-registry.test.ts:
  Line 135:   it.effect("preserves an interrupted registration until its scope closes", () =>


/home/byk/Code/opencode/packages/core/test/session-run-coordinator.test.ts:
  Line 122:   it.effect("cleans active executions when its scope closes", () =>
gateway · 2026-09-14 08:25:12
result
Found 11 matches
/home/byk/Code/opencode/packages/core/test/session-runner.test.ts:
  Line 2270:       yield* events.publish(SessionEvent.Step.Started, {

  Line 2334:       yield* events.publish(SessionEvent.Step.Started, {

  Line 2394:       yield* events.publish(SessionEvent.Step.Started, {


/home/byk/Code/opencode/packages/core/test/session-projector.test.ts:
  Line 398:         .publish(SessionEvent.Step.Started, {

  Line 414:   it.effect("does not revive a stale incomplete in-memory assistant projection", () =>

  Line 439:   it.effect("updates only the newest incomplete assistant projection", () =>

  Line 488:       expect(messages[0]).not.toHaveProperty("time.completed")

  Line 497:   it.effect("does not revive a stale incomplete assistant projection", () =>


/home/byk/Code/opencode/packages/core/test/session-runner-recorded.test.ts:
  Line 186:         "session.next.step.started.1",


/home/byk/Code/opencode/packages/core/test/session-create.test.ts:
  Line 308:   ...
gateway · 2026-09-14 08:25:18
result
<path>/home/byk/Code/opencode/packages/core/test/session-projector.test.ts</path>
<type>file</type>
<content>
370:     }),
371:   )
372: 
373:   it.effect("rejects distinct creator events that reuse one projected message ID", () =>
374:     Effect.gen(function* () {
375:       const { db } = yield* Database.Service
376:       yield* db
377:         .insert(ProjectTable)
378:         .values({ id: Project.ID.global, worktree: AbsolutePath.make("/project"), sandboxes: [] })
379:         .run()
380:         .pipe(Effect.orDie)
381:       yield* db
382:         .insert(SessionTable)
383:         .values({
384:           id: sessionID,
385:           project_id: Project.ID.global,
386:           slug: "test",
387:           directory: "/project",
388:           title: "test",
389:           version: "test",
390:         })
391:         .run()
392:         .pipe(Effect.orDie)
393:       const events = yield* EventV2.Service
394:       const id = ...
gateway · 2026-09-14 08:25:24
result
<path>/home/byk/Code/opencode/packages/core/test/session-projector.test.ts</path>
<type>file</type>
<content>
497:   it.effect("does not revive a stale incomplete assistant projection", () =>
498:     Effect.gen(function* () {
499:       const { db } = yield* Database.Service
500:       yield* db
501:         .insert(ProjectTable)
502:         .values({ id: Project.ID.global, worktree: AbsolutePath.make("/project"), sandboxes: [] })
503:         .run()
504:         .pipe(Effect.orDie)
505:       yield* db
506:         .insert(SessionTable)
507:         .values({
508:           id: sessionID,
509:           project_id: Project.ID.global,
510:           slug: "test",
511:           directory: "/project",
512:           title: "test",
513:           version: "test",
514:         })
515:         .run()
516:         .pipe(Effect.orDie)
517:       yield* db
518:         .insert(SessionMessageTable)
519:         .values([
520:           ...
gateway · 2026-09-14 08:25:31
result
Found 3 matches
/home/byk/Code/opencode/packages/opencode/test/mcp/lifecycle.test.ts:
  Line 323:     yield* Effect.promise(server.restart)


/home/byk/Code/opencode/packages/opencode/test/cli/run/stream.transport.test.ts:
  Line 695:   test("preserves running footer state for resumed active sessions", async () => {


/home/byk/Code/opencode/packages/app/src/context/server-sync.test.ts:
  Line 69:   test("loads active sessions immediately and once per server cache", async () => {
gateway · 2026-09-14 08:25:37
result
<path>/home/byk/Code/opencode/packages/core/test/session-runner-recorded.test.ts</path>
<type>file</type>
<content>
1: import { HttpRecorder } from "@opencode-ai/http-recorder"
2: import { HttpRecorderInternal } from "@opencode-ai/http-recorder/internal"
3: import * as OpenAIChat from "@opencode-ai/llm/protocols/openai-chat"
4: import { Auth, LLMClient, RequestExecutor } from "@opencode-ai/llm/route"
5: import { Database } from "@opencode-ai/core/database/database"
6: import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
7: import { LayerNodePlatform } from "@opencode-ai/core/effect/app-node-platform"
8: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
9: import { EventV2 } from "@opencode-ai/core/event"
10: import { EventTable } from "@opencode-ai/core/event/sql"
11: import { PermissionV2 } from "@opencode-ai/core/permission"
12: import { AgentV2 } from "@opencode-ai/core/agent"
13: import { Config } from "@opencode-ai/core/config"
14: import { ...
gateway · 2026-09-14 08:25:42
result
Found 2 matches
/home/byk/Code/opencode/packages/protocol/src/groups/session.ts:
  Line 211:           resume: Schema.Boolean.pipe(Schema.optional),

  Line 221:             description: "Durably admit one session input and schedule agent-loop execution unless resume is false.",
gateway · 2026-09-14 08:25:48
result
<path>/home/byk/Code/opencode/packages/core/src/database/migration/20260213144116_wakeful_the_professor.ts</path>
<type>file</type>
<content>
1: import { Effect } from "effect"
2: import type { DatabaseMigration } from "../migration"
3: 
4: export default {
5:   id: "20260213144116_wakeful_the_professor",
6:   up(tx) {
7:     return Effect.gen(function* () {
8:       yield* tx.run(`
9:         CREATE TABLE \`control_account\` (
10:           \`email\` text NOT NULL,
11:           \`url\` text NOT NULL,
12:           \`access_token\` text NOT NULL,
13:           \`refresh_token\` text NOT NULL,
14:           \`token_expiry\` integer,
15:           \`active\` integer NOT NULL,
16:           \`time_created\` integer NOT NULL,
17:           \`time_updated\` integer NOT NULL,
18:           CONSTRAINT \`control_account_pk\` PRIMARY KEY(\`email\`, \`url\`)
19:         );
20:       `)
21:     })
22:   },
23: } satisfies DatabaseMigration.Migration

(End of file - total 23 lines)
</content>
gateway · 2026-09-14 08:25:55
result
Found 4 matches
/home/byk/Code/opencode/packages/core/src/database/migration/20260604172448_event_sourced_session_input.ts:
  Line 37:         `CREATE INDEX \`session_input_session_pending_delivery_seq_idx\` ON \`session_input\` (\`session_id\`,\`promoted_seq\`,\`delivery\`,\`admitted_seq\`);`,


/home/byk/Code/opencode/packages/core/src/database/migration/20260603160727_jittery_ezekiel_stane.ts:
  Line 8:       yield* tx.run(`DROP INDEX IF EXISTS \`session_input_session_pending_seq_idx\`;`)

  Line 13:         `CREATE INDEX IF NOT EXISTS \`session_input_session_pending_delivery_seq_idx\` ON \`session_input\` (\`session_id\`,\`promoted_seq\`,\`delivery\`,\`seq\`);`,


/home/byk/Code/opencode/packages/core/src/database/migration/20260603141458_session_input_inbox.ts:
  Line 21:         `CREATE INDEX \`session_input_session_pending_seq_idx\` ON \`session_input\` (\`session_id\`,\`promoted_seq\`,\`seq\`);`,
gateway · 2026-09-14 08:26:04
result
<path>/home/byk/Code/opencode/packages/core/src/database/migration/20260604172448_event_sourced_session_input.ts</path>
<type>file</type>
<content>
1: import { Effect } from "effect"
2: import type { DatabaseMigration } from "../migration"
3: 
4: export default {
5:   id: "20260604172448_event_sourced_session_input",
6:   up(tx) {
7:     return Effect.gen(function* () {
8:       yield* tx.run(`DELETE FROM \`session_input\`;`)
9:       yield* tx.run(`DELETE FROM \`session_message\`;`)
10:       yield* tx.run(`DELETE FROM \`event\`;`)
11:       yield* tx.run(`DELETE FROM \`event_sequence\`;`)
12:       yield* tx.run(`UPDATE \`session\` SET \`workspace_id\` = NULL;`)
13:       yield* tx.run(`DELETE FROM \`workspace\`;`)
14:       yield* tx.run(`DROP INDEX IF EXISTS \`event_aggregate_seq_idx\`;`)
15:       yield* tx.run(`CREATE UNIQUE INDEX \`event_aggregate_seq_idx\` ON \`event\` (\`aggregate_id\`,\`seq\`);`)
16:       yield* tx.run(`DROP INDEX IF EXISTS ...
gateway · 2026-09-14 08:26:10
result
Found 3 matches
/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/handlers/tui.ts:
  Line 14:   session_interrupt: "session.interrupt",


/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts:
  Line 324:             identifier: "session.prompt",

  Line 337:             identifier: "session.prompt_async",
gateway · 2026-09-14 08:26:21
result
Found 92 matches
/home/byk/Code/opencode/packages/opencode/src/session/tools.ts:
  Line 69:         if (!["running", "pending"].includes(match.state.status)) return match

  Line 75:             status: "running",

  Line 77:             time: match.state.status === "running" ? match.state.time : { start: Date.now() },


/home/byk/Code/opencode/packages/opencode/src/session/session.ts:
  Line 945:       if (job.status !== "running") return false


/home/byk/Code/opencode/packages/opencode/src/session/retry.ts:
  Line 89:     const status = error.data.statusCode

  Line 94:       !(status !== undefined && status >= 500) &&


/home/byk/Code/opencode/packages/opencode/src/session/instruction.ts:
  Line 21:       if (part.type === "tool" && part.tool === "read" && part.state.status === "completed") {


/home/byk/Code/opencode/packages/opencode/src/session/prompt.ts:
  Line 36: import { SessionStatus } from "./status"

  Line 99:   return part.state.status === "error" && ...
gateway · 2026-09-14 08:26:57
result
Found 43 matches
/home/byk/Code/opencode/packages/llm/src/schema/events.ts:
  Line 204:   retryable: Schema.optional(Schema.Boolean),


/home/byk/Code/opencode/packages/llm/src/schema/errors.ts:
  Line 19:   retryAfterMs: Schema.optional(Schema.Number),

  Line 42:   get retryable() {

  Line 53:   get retryable() {

  Line 69:   get retryable() {

  Line 77:   retryAfterMs: Schema.optional(Schema.Number),

  Line 82:   get retryable() {

  Line 93:   get retryable() {

  Line 104:   get retryable() {

  Line 113:   retryAfterMs: Schema.optional(Schema.Number),

  Line 117:   get retryable() {

  Line 129:   get retryable() {

  Line 143:   get retryable() {

  Line 155:   get retryable() {

  Line 181:   get retryable() {

  Line 182:     return this.reason.retryable

  Line 185:   get retryAfterMs() {

  Line 186:     return "retryAfterMs" in this.reason ? this.reason.retryAfterMs : undefined


/home/byk/Code/opencode/packages/llm/src/route/executor.ts:
  Line 91: const ...
gateway · 2026-09-14 08:27:06
result
<path>/home/byk/Code/opencode/packages/llm/src/route/executor.ts</path>
<type>file</type>
<content>
330:   const request = "request" in error ? error.request : undefined
331:   if (error.reason._tag === "TransportError") {
332:     return transportError({
333:       message: error.reason.description ?? "HTTP transport failed",
334:       kind: error.reason._tag,
335:       request,
336:     })
337:   }
338:   return transportError({
339:     message: `HTTP transport failed: ${error.reason._tag}`,
340:     kind: error.reason._tag,
341:     request,
342:   })
343: }
344: 
345: const retryDelay = (error: LLMError, attempt: number) => {
346:   if (error.retryAfterMs !== undefined) return Effect.succeed(Math.min(error.retryAfterMs, MAX_DELAY_MS))
347:   return Random.nextBetween(
348:     Math.min(BASE_DELAY_MS * 2 ** attempt * 0.8, MAX_DELAY_MS),
349:     Math.min(BASE_DELAY_MS * 2 ** attempt * 1.2, MAX_DELAY_MS),
350:   ).pipe(Effect.map((delay) => Math.round(delay)))
351: }
352: 
353: ...
gateway · 2026-09-14 08:27:24
result
Found 23 matches
/home/byk/Code/opencode/packages/core/src/session/compaction.ts:
  Line 106:         if (part.state.status === "completed")

  Line 111:         if (part.state.status === "error")


/home/byk/Code/opencode/packages/core/src/session/todo.ts:
  Line 47:                   status: todo.status,

  Line 69:         status: row.status,


/home/byk/Code/opencode/packages/core/src/session/sql.ts:
  Line 108:     status: text().notNull(),


/home/byk/Code/opencode/packages/core/src/session/run-coordinator.ts:
  Line 9:   /** Starts execution while idle or joins the active execution. */


/home/byk/Code/opencode/packages/core/src/session/message-updater.ts:
  Line 258:                 state: SessionMessage.ToolStatePending.make({ status: "pending", input: "" }),

  Line 268:           if (match && match.state.status === "pending") match.state.input = event.data.text

  Line 279:                 status: "running",

  Line 291:           if (match && match.state.status === ...
gateway · 2026-09-14 08:27:38
result
Found 100 matches (more matches available)
/home/byk/Code/opencode/AGENTS.md:
  Line 11: Examples: `session-recovery`, `fix-scroll-state`, `regenerate-sdk`.

  Line 153: - Keep durable prompt admission separate from model execution. `SessionV2.prompt(...)` admits one durable `session_input` row before scheduling advisory `SessionExecution.wake(sessionID)` unless `resume: false` requests admit-only behavior. The serialized runner promotes admitted inputs into visible user messages at safe boundaries.

  Line 157: - Preserve one explicit `llm.stream(request)` call per provider turn and reload projected history before durable continuation. Do not bridge through legacy `SessionPrompt.loop(...)` or delegate orchestration to an in-memory tool loop.

  Line 158: - Keep local Session drains process-local until clustering is implemented. `SessionRunCoordinator` joins explicit same-Session resumes, coalesces prompt wakeups, and allows different Sessions to run concurrently. ...
gateway · 2026-09-14 08:27:54
result
<path>/home/byk/Code/opencode/specs/v2/session.md</path>
<type>file</type>
<content>
1: # Session API
2: 
3: ## Current V2 Core Slice
4: 
5: The Effect-native core facade treats prompt recording and execution as separate responsibilities:
6: 
7: ```text
8: sessions.create({ id?, location, ... })
9:   -> omitted ID generates one internal Session ID
10:   -> supplied ID creates the Session when absent
11:   -> reused ID returns the existing Session identity
12: 
13: sessions.prompt({ id?, sessionID, prompt, delivery?, resume? })
14:   -> omitted ID generates one internal message ID
15:   -> supplied ID inserts one durable Session inbox row when absent
16:   -> exact reuse returns the same admission receipt
17:   -> reusing one message ID for another Session, prompt, or delivery mode fails
18:   -> exact retry schedules another wake unless resume is false
19:   -> resume omitted or true schedules execution after admission
20:   -> resume false admits only
21: 
22: ...
gateway · 2026-09-14 08:28:05
result
<path>/home/byk/Code/opencode/specs/v2/todo.md</path>
<type>file</type>
<content>
1: # TODO
2: 
3: ok we need to work towards a launch of v2 so we can get out of this rebuild phase
4: 
5: ## Post-Hono cleanup - Kit
6: 
7: The opencode server has moved to the Effect HttpApi backend. Remaining work is
8: mostly cleanup: delete compatibility shims, shrink Zod surfaces, and simplify
9: test harnesses that used to compare Hono and HttpApi behavior.
10: 
11: ## New Data Mode - Dax
12: 
13: This is mostly done. I'm working through modeling subagents, skill invocations
14: and shell commands.
15: 
16: ## Rework agent loop - Kit?
17: 
18: The first Effect-native local runner slice is implemented without bridging
19: through legacy `SessionPrompt.loop(...)`:
20: 
21: - process-global `SessionExecution.resume(sessionID)` discovers Location from
22:   the Session read model
23: - cached Location-scoped `SessionRunner` resolves one supported catalog model
24:   and issues one explicit ...
gateway · 2026-09-14 08:29:08
result
<path>/home/byk/Code/opencode/packages/opencode/src/session/run-state.ts</path>
<type>file</type>
<content>
1: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2: import { InstanceState } from "@/effect/instance-state"
3: import { SessionV1 } from "@opencode-ai/core/v1/session"
4: import { Runner } from "@/effect/runner"
5: import { BackgroundJob } from "@/background/job"
6: import { Effect, Latch, Layer, Scope, Context } from "effect"
7: import { Session } from "./session"
8: import { SessionID } from "./schema"
9: import { SessionStatus } from "./status"
10: 
11: export interface Interface {
12:   readonly assertNotBusy: (sessionID: SessionID) => Effect.Effect<void, Session.BusyError>
13:   readonly cancel: (sessionID: SessionID) => Effect.Effect<void>
14:   readonly ensureRunning: (
15:     sessionID: SessionID,
16:     onInterrupt: Effect.Effect<SessionV1.WithParts>,
17:     work: Effect.Effect<SessionV1.WithParts>,
18:   ) => Effect.Effect<SessionV1.WithParts>
19:  ...
gateway · 2026-09-14 08:29:17
result
<path>/home/byk/Code/opencode/CONTEXT.md</path>
<type>file</type>
<content>
35: 
36: **Unavailable Context**:
37: An expected temporary inability to observe a **Context Source** value; the runtime retains its prior effective state and emits no update, or omits it until first successfully loaded.
38: 
39: **Safe Provider-Turn Boundary**:
40: The point immediately before a provider call, after durable input promotion and any required tool settlement, where context changes may be admitted chronologically.
41: 
42: **Admitted Prompt**:
43: A durable user input accepted into the Session inbox but not yet included in **Session History**.
44: 
45: **Prompt Promotion**:
46: The durable transition that removes an **Admitted Prompt** from pending input and appends its user message to **Session History**.
47: 
48: **Provider Turn**:
49: One request to a model provider and the response projected from that request. ...
gateway · 2026-09-14 08:29:43
result
<path>/home/byk/Code/opencode/packages/llm/src/route/executor.ts</path>
<type>file</type>
<content>
1: import { Cause, Context, Effect, Layer, Random } from "effect"
2: import {
3:   FetchHttpClient,
4:   Headers,
5:   HttpClient,
6:   HttpClientError,
7:   HttpClientRequest,
8:   HttpClientResponse,
9: } from "effect/unstable/http"
10: import {
11:   AuthenticationReason,
12:   ContentPolicyReason,
13:   HttpContext,
14:   HttpRateLimitDetails,
15:   HttpRequestDetails,
16:   HttpResponseDetails,
17:   InvalidRequestReason,
18:   LLMError,
19:   ProviderInternalReason,
20:   QuotaExceededReason,
21:   RateLimitReason,
22:   TransportReason,
23:   UnknownProviderReason,
24: } from "../schema"
25: import { isContextOverflow } from "../provider-error"
26: 
27: export interface Interface {
28:   readonly execute: (
29:     request: HttpClientRequest.HttpClientRequest,
30:   ) => Effect.Effect<HttpClientResponse.HttpClientResponse, LLMError>

(Showing lines 1-30 of 385. ...
gateway · 2026-09-14 08:29:51
result
Found 5 matches
/home/byk/Code/opencode/packages/llm/src/route/executor.ts:
  Line 36: const MAX_RETRIES = 2

  Line 37: const BASE_DELAY_MS = 500

  Line 348:     Math.min(BASE_DELAY_MS * 2 ** attempt * 0.8, MAX_DELAY_MS),

  Line 349:     Math.min(BASE_DELAY_MS * 2 ** attempt * 1.2, MAX_DELAY_MS),

  Line 355:   retries = MAX_RETRIES,
gateway · 2026-09-14 08:29:59
result
<path>/home/byk/Code/opencode/packages/llm/src/route/executor.ts</path>
<type>file</type>
<content>
30:   ) => Effect.Effect<HttpClientResponse.HttpClientResponse, LLMError>
31: }
32: 
33: export class Service extends Context.Service<Service, Interface>()("@opencode/LLM/RequestExecutor") {}
34: 
35: const BODY_LIMIT = 16_384
36: const MAX_RETRIES = 2
37: const BASE_DELAY_MS = 500
38: const MAX_DELAY_MS = 10_000
39: const REDACTED = "<redacted>"
40: 
41: // One source of truth for what counts as a sensitive name across headers,
42: // URL query keys, and field names embedded inside request/response bodies.
43: //
44: // `SENSITIVE_NAME` is used as both a substring matcher (for free-form header
45: // names like `Authorization` / `X-API-Key`) and as the body-field alternation
46: // list. `SHORT_QUERY_NAME` covers anchored short keys like `?key=…` / `?sig=…`
47: // that are too generic to redact substring-style without false positives.

(Showing lines 30-47 of 385. ...
gateway · 2026-09-14 08:30:48
result
<path>/home/byk/Code/opencode/packages/opencode/src/session/status.ts</path>
<type>file</type>
<content>
1: import { LayerNode } from "@opencode-ai/core/effect/layer-node"
2: import { InstanceState } from "@/effect/instance-state"
3: import { SessionID } from "./schema"
4: import { Effect, Layer, Context } from "effect"
5: import { EventV2Bridge } from "@/event-v2-bridge"
6: import { SessionStatusEvent } from "@opencode-ai/schema/session-status-event"
7: 
8: export const Info = SessionStatusEvent.Info
9: export type Info = SessionStatusEvent.Info
10: 
11: export const Event = SessionStatusEvent
12: 
13: export interface Interface {
14:   readonly get: (sessionID: SessionID) => Effect.Effect<Info>
15:   readonly list: () => Effect.Effect<Map<SessionID, Info>>
16:   readonly set: (sessionID: SessionID, status: Info) => Effect.Effect<void>
17: }
18: 
19: export class Service extends Context.Service<Service, Interface>()("@opencode/SessionStatus") {}
20: 
21: const layer = ...
gateway · 2026-09-14 08:32:25

Verdict

V2 does not resume active Session execution after a server restart.

It durably preserves:

  • unpromoted steer and queue prompts,
  • promoted conversation history,
  • partial assistant and tool state,
  • completed tool settlements and provider metadata.

It does not durably preserve or reconstruct:

  • active drains,
  • pending wakeups,
  • provider-attempt ownership,
  • whether a provider request was dispatched,
  • whether an external side effect completed,
  • busy/retrying/recovery status.

After restart, pending prompts remain dormant until a later wake. A new prompt or an exact prompt retry normally supplies that wake; Core also has an explicit resume, but the public HTTP API does not expose it.

Evidence

1. Admission is durable and precedes execution

SessionV2.prompt resolves and admits the prompt inside an uninterruptible region, validates exact retries, then issues only an advisory wake unless resume:false:

  • /home/byk/Code/opencode/packages/core/src/session.ts:360-385
  • /home/byk/Code/opencode/packages/core/src/session/input.ts:41-80

PromptAdmitted and the session_input projection commit in the durable event transaction:

  • /home/byk/Code/opencode/packages/core/src/session/projector.ts:362-373
  • /home/byk/Code/opencode/packages/core/src/event.ts:237-353

The durable inbox stores admitted_seq, nullable promoted_seq, and delivery mode:

  • /home/byk/Code/opencode/packages/core/src/session/sql.ts:140-165

Tests establish:

  • admission before transcript visibility:
    /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:143-163
  • exact retry creates one admission:
    /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:252-269
  • concurrent exact retries create one event/row:
    /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:342-359
  • exact retry can supply a new wake:
    /home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:272-289
  • replay ...
gpt-5.6-sol · 2026-09-14 08:32:25 · ~2.8K tokens

Distillations (15)

Gen 0 2026-09-14 09:21:59 · 2571 tokens

Date: Sep 14, 2026 * 🟡 (08:32) `/home/byk/Code/opencode/packages/opencode/src/session/status.ts` defines `SessionStatus.Interface` with `get(sessionID)`, `list()`, and `set(sessionID, status)`. State is an `InstanceState`-backed process-local `Map<SessionID, Info>`; absent sessions read as `{ type: "idle" }`, `list()` returns a copied `Map`, and `set()` publishes `Event.Status`. Setting `idle` a…

Gen 0 2026-09-14 09:21:01 · 1535 tokens

Date: Sep 14, 2026 * 🔴 (08:29) User stated Context Source changes are sampled and admitted lazily at a Safe Provider-Turn Boundary and are never pushed asynchronously when their source changes. * 🔴 (08:29) User stated the project needs to work toward launching V2 to exit the rebuild phase. * 🟡 (08:29) `/home/byk/Code/opencode/specs/v2/todo.md` reports Post-Hono cleanup after migration to the E…

Gen 0 2026-09-14 09:20:19 · 1015 tokens

Date: Sep 14, 2026 * 🟡 (08:28) User surfaced Session API semantics: supplying an absent Session ID creates the Session; `sessions.prompt({ id?, sessionID, prompt, delivery?, resume? })` returns the same admission receipt for exact ID reuse, and omitted or `true` `resume` schedules execution after admission; `sessions.interrupt(sessionID)` clears any coalesced follow-up wake registered with the c…

Gen 0 2026-09-14 09:08:19 · 2863 tokens

Date: Sep 14, 2026 * 🟡 (08:26) User found exactly 4 pending-index migration matches. `/home/byk/Code/opencode/packages/core/src/database/migration/20260603141458_session_input_inbox.ts:21` creates `session_input_session_pending_seq_idx` on (`session_id`,`promoted_seq`,`seq`); `/home/byk/Code/opencode/packages/core/src/database/migration/20260603160727_jittery_ezekiel_stane.ts:8,13` drops that in…

Gen 0 2026-09-14 08:54:14 · 2100 tokens

Date: Sep 14, 2026 * 🟡 (08:23) User found exactly 17 matches while searching pending/session-execution references. Relevant results: `/home/byk/Code/opencode/packages/opencode/src/question/index.ts:119,124` and `/home/byk/Code/opencode/packages/opencode/src/permission/index.ts:111,114` retrieve/delete pending entries by `input.requestID`; `/home/byk/Code/opencode/packages/opencode/src/session/pr…

Gen 0 2026-09-14 08:53:23 · 1178 tokens

Date: Sep 14, 2026 * 🔴 (08:22) User stated protected paths must “never be watched.” * 🟡 (08:22) User inspected `/home/byk/Code/opencode/packages/core/test/session-runner.test.ts` lines 1600-1849. Tests cover: durable provider reasoning metadata replay (`anthropic.signature`, `openai.itemId`, `openai.reasoningEncryptedContent`); inline replay of provider-executed `web_search` tool calls/results;…

Gen 0 2026-09-14 08:52:50 · 266 tokens

Date: Sep 14, 2026 * 🔴 (08:21) User’s search found exactly 6 matches related to recorded/captured tool execution: 3 in `/home/byk/Code/opencode/packages/core/test/session-runner.test.ts` (line 1687 test `"starts recorded local tools eagerly and awaits settlement before continuing"`; `events.publish(SessionEvent.Tool.Called, ...)` at lines 2291 and 2355), 1 in `/home/byk/Code/opencode/packages/co…

Gen 0 2026-09-14 08:48:11 · 1826 tokens

Date: Sep 14, 2026 * 🔴 (08:19) User’s search reported exactly 7 matches in `/home/byk/Code/opencode/packages/opencode/specs/v2/message-shape.md`, including the replay/resume requirement (“stored messages need enough data to replay and resume a session later”), `tools?: Record<string, boolean>`, model example `{ providerID: "openai", modelID: "gpt-5" }`, and repeated prompt text `"Summarize the t…

Gen 0 2026-09-14 08:44:15 · 809 tokens

Date: Sep 14, 2026 * 🔴 (08:18) User reaffirmed the projection invariant in `/home/byk/Code/opencode/packages/core/src/session/projector.ts:22`: “A newer turn supersedes stale incomplete rows; never resume an older assistant projection.” * 🟡 (08:19) `/home/byk/Code/opencode/packages/core/src/session/history.ts` loads projected session history using `SessionMessageTable.seq`: `latestCompaction()`…

Gen 0 2026-09-14 08:38:42 · 350 tokens

Date: Sep 14, 2026 * 🔴 (08:18) User directed: “Replace local ownership with durable multi-node ownership when clustered.” This replaces the current process-local Session ownership model documented in `/home/byk/Code/opencode/packages/core/src/session/runner/llm.ts`. * 🔴 (08:18) User established the projection invariant: “never resume an older assistant projection.” In `/home/byk/Code/opencode/p…

Gen 0 2026-09-14 08:33:05 · 1424 tokens

Date: Sep 14, 2026 * 🟡 (08:17) `/home/byk/Code/opencode/packages/core/src/session/event.ts` is a 2-line re-export module: line 1 is `export * from "@opencode-ai/schema/session-event"` and line 2 is `export * as SessionEvent from "@opencode-ai/schema/session-event"`. * 🟡 (08:17) Session-related schema files enumerated under `/home/byk/Code/opencode/packages/schema/src/`: `v1/session.ts`, `sessio…

Gen 0 2026-09-14 08:25:55 · 1757 tokens

Date: Sep 14, 2026 * 🟡 (08:16) `/home/byk/Code/opencode/packages/opencode/src/server/routes/instance/httpapi/server.ts:271-312` defines `createRoutes(corsOptions?)` by merging, in order, `rootApiRoutes`, `eventApiRoutes`, `ptyConnectApiRoutes`, `instanceRoutes`, `serverRoutes`, `docRoute`, and `uiRoute`; it then provides `errorLayer`, `compressionLayer`, `corsVaryFix`, `fenceLayer`, `cors(corsOp…

Gen 0 2026-09-14 08:25:11 · 1752 tokens

Date: Sep 14, 2026 * 🟡 (08:15) Investigation evidence from `/home/byk/Code/opencode/packages/core/src/session/store.ts`: `SessionStore.Interface` exposes `get(sessionID)`, `context(sessionID)`, `runnerContext(sessionID, baselineSeq)`, and `message(messageID)`; `Service` is identified as `@opencode/v2/SessionStore`. * 🟡 (08:15) `SessionStore.get` reads `SessionTable` by `id` and converts a found…

Gen 0 2026-09-14 08:17:18 · 2277 tokens

Date: Sep 14, 2026 * 🔴 (08:15) User specified that after building a standalone executable with `./packages/opencode/script/build.ts --single`, it is run as `./packages/opencode/dist/opencode-<platform>/bin/opencode`; replace `<platform>` with the actual platform, such as `darwin-arm64` or `linux-x64`. * 🔴 (08:15) Repository contribution policy in `/home/byk/Code/opencode/CONTRIBUTING.md`: UI or…

Gen 0 2026-09-14 08:16:18 · 1354 tokens

Date: Sep 14, 2026 * 🔴 [requested-research-only] (08:14) User instructed research only in `/home/byk/Code/opencode`; do not edit files. * 🟡 (08:14) User asked for a very thorough investigation of V2 session durable admission/execution and restart recovery behavior, specifically whether V2 resumes active sessions after a server restart or only preserves queued prompts. * 🟡 (08:14) User requeste…