Dashboard › opencode › Distillation
7b2ad068-9ae6-487e-9d12-c289434314d7["lore_tm_v1_k_sQzBE8P8dJqJ0D1mdsd-ECm1-WBM2FEZqRjR6Aorg","lore_tm_v1_vjgRrSrwH2YB_HErLomH-sNDaup6B-8x1TfEEQtJbnI","lore_tm_v1_vFSawzjLGtfVnum4qIQx6f7sd2OclBOK1-CiLOFf1xo","lore_tm_v1_vQImivlNPcajSGXcBWPDPUzaIm-trhajHT47uhQUF6w","lore_tm_v1_PaLU-HzWq4l5aHWCp-ciwTBkR4pQMXqUcUBoAtmFjmU","lore_tm_v1_yrPeXYtj9oYwUuNRalPLXFh-0tZylCmW56XWIkY73tk","lore_tm_v1_09LetoIk1spXM91f2E1NL-XRMmvWsnP6RRM3ONpHbbI","lore_tm_v1__-eucPUye1cvHMLCwBnUhncbe7XXc0Dnq6dTZ1dFj_0","lore_tm_v1_exPy_XHXmhmSH1u22UL6Gv2ykPvdi-7MVyjlJPpBXrw","lore_tm_v1_DGDkGGXq5yCol4_GyFYA6NkcO1cgA1FqUeu-REbu4_4","lore_tm_v1_MSAD55D7_NVr6Reu_WCR1AJxS6_UfKWZmf18_LQ9JWg","lore_tm_v1_RmRYVzyu4eVZEhhn_yQtpYfJLm7wYLiwSb7rJ1LBuiA","lore_tm_v1_Xdbiq9a4VX51Izj85QmkRI2BZpwoOmeFlGXFS3pAt44","lore_tm_v1_P2LuIRCNmmc7ZXszsvpUZPb_1fGNDT5NdQtWa7Ulytc"]
/home/byk/Code/opencode/packages/protocol/src contains exactly 4 entries: api.ts, errors.ts, groups/, and middleware/./home/byk/Code/opencode/packages/protocol/src/groups contains exactly 18 files: agent.ts, command.ts, credential.ts, event.ts, fs.ts, health.ts, integration.ts, location.ts, message.ts, model.ts, permission.ts, project-copy.ts, provider.ts, pty.ts, question.ts, reference.ts, session.ts, and skill.ts./home/byk/Code/opencode/packages/protocol/src/groups/provider.ts defines ProviderGroup = HttpApiGroup.make("server.provider") with 2 routes: provider.list (GET /api/provider, optional location query via LocationQuery, success Location.response(Schema.Array(Provider.Info)), error ServiceUnavailableError, OpenAPI identifier v2.provider.list) and provider.get (GET /api/provider/:providerID, Provider.ID path parameter, location query, success Location.response(Provider.Info), errors ProviderNotFoundError and ServiceUnavailableError, identifier v2.provider.get). Group metadata title is "providers" and description is "Experimental provider routes."./home/byk/Code/opencode/packages/protocol/src/groups/model.ts defines ModelGroup = HttpApiGroup.make("server.model") with only model.list: GET /api/model, location query via LocationQuery, success Location.response(Schema.Array(Model.Info)), error ServiceUnavailableError, identifier v2.model.list, and description "Retrieve available models ordered by release date."; no current /api/model/default route appears in this protocol file./home/byk/Code/opencode/packages/protocol/src/groups/session.ts defines session-list query fields workspace, positive integer limit (default documented as newest 50), order ("asc" or "desc"), and search; location selectors support directory, or project plus optional subpath, or all sessions.SessionsCursor in /home/byk/Code/opencode/packages/protocol/src/groups/session.ts:49-81 is an opaque branded string made by JSON-encoding a query with limit omitted and a required Session.ListAnchor, then Base64URL-encoding it. SessionsCursor.parse() Base64URL-decodes and schema-decodes it, mapping either failure to the literal "Invalid cursor"./home/byk/Code/opencode/packages/protocol/src/groups/session.ts limits session history pages with SessionHistoryLimit = PositiveInt.check(Schema.isLessThanOrEqualTo(100)); SessionHistoryQuery accepts optional limit and optional nonnegative after.makeSessionGroup() in /home/byk/Code/opencode/packages/protocol/src/groups/session.ts defines 17 current session endpoints in this order: 1. session.list — GET /api/session; 2. session.create — POST /api/session; 3. session.active — GET /api/session/active; 4. session.get — GET /api/session/:sessionID; 5. session.switchAgent — POST /api/session/:sessionID/agent; 6. session.switchModel — POST /api/session/:sessionID/model; 7. session.prompt — POST /api/session/:sessionID/prompt; 8. session.compact — POST /api/session/:sessionID/compact; 9. session.wait — POST /api/session/:sessionID/wait; 10. session.revert.stage — POST /api/session/:sessionID/revert/stage; 11. session.revert.clear — POST /api/session/:sessionID/revert/clear; 12. session.revert.commit — POST /api/session/:sessionID/revert/commit; 13. session.context — GET /api/session/:sessionID/context; 14. session.history — GET /api/session/:sessionID/history; 15. session.events — GET /api/session/:sessionID/event; 16. session.interrupt — POST /api/session/:sessionID/interrupt; 17. session.message — GET /api/session/:sessionID/message/:messageID.session.list returns { data: Session.Info[], cursor: { previous?, next? } } and can return InvalidCursorError or InvalidRequestError; session.create accepts optional id, agent, model, and location; session.active returns a record of session IDs to { type: "running" }; session.prompt accepts optional message id, required prompt, optional delivery, and optional resume, returning SessionInput.Admitted with ConflictError or SessionNotFoundError; session.events streams SessionEvent.Durable over SSE; session.interrupt returns NoContent.session.prompt durably admits one input and schedules agent-loop execution unless resume is false; session.active reports foreground drains owned by the current OpenCode process; session.wait waits until the agent loop becomes idle; session.interrupt interrupts active execution owned by the current process and is a no-op when idle; session.context returns messages after the last compaction; session.history reads a finite page after an exclusive aggregate sequence; session.events replays durable events after a sequence and then streams new durable events.Found 74 matches. Relevant current implementation hits include /home/byk/Code/opencode/packages/core/src/catalog.ts (DefaultModel, defaultModel?, and catalog.model.default()), /home/byk/Code/opencode/packages/core/src/session/runner/model.ts:190 (uses catalog.model.default() when session.model is absent), /home/byk/Code/opencode/packages/app/src/hooks/provider-catalog.ts (resolveDefaultModel()), /home/byk/Code/opencode/packages/app/src/pages/session/composer/prompt-model-selection.ts:25, and /home/byk/Code/opencode/packages/app/src/context/local.tsx:153./home/byk/Code/opencode/packages/app/src/context/global-sync/bootstrap.ts:240, which calls sdk.model.default(location), and /home/byk/Code/opencode/packages/app/e2e/regression/remote-session-settings.spec.ts:189, which mocks /api/model/default with { data: null }, despite the current protocol model.ts exposing only GET /api/model./home/byk/Code/opencode/packages/app/src/hooks/provider-catalog.test.ts tests resolveDefaultModel(): a server default { providerID: "openai", modelID: "gpt-5" } takes precedence over config "anthropic/claude"; explicit null yields undefined; undefined falls back to the configured model./api/session, /api/model, and /api/provider routes returned exactly Found 100 matches (more matches available) and was truncated. It confirmed generated SDK v2 route declarations in /home/byk/Code/opencode/packages/sdk/js/src/v2/gen/types.gen.ts and implementations in /home/byk/Code/opencode/packages/sdk/js/src/v2/gen/sdk.gen.ts, plus generated client routes in /home/byk/Code/opencode/packages/client/src/generated/client.ts.session.ts: /home/byk/Code/opencode/packages/protocol/src/groups/message.ts defines GET /api/session/:sessionID/message; question.ts defines list/reply/reject routes under /api/session/:sessionID/question; and permission.ts defines create/list/get/reply routes under /api/session/:sessionID/permission./home/byk/Code/opencode/packages/app/node_modules/@opencode-ai/client/dist contains exactly 6 entries: contract.d.ts, contract.js, effect/, promise/, service.d.ts, and service.js; its promise/ directory contains exactly 7 entries: api.d.ts, api.js, generated/, index.d.ts, index.js, service.d.ts, and service.js./home/byk/Code/opencode/packages/app/node_modules/@opencode-ai/client/dist/promise/generated/client.js returned exactly Found 100 matches (more matches available) and was truncated. This installed/generated client contains routes not present in the current packages/protocol/src/groups/session.ts, including DELETE /api/session/:sessionID, /fork, /rename, /move, /command, /skill, /synthetic, /shell, /pending, /instructions/entries, /generate, and /background./home/byk/Code/opencode/packages/app/node_modules/@opencode-ai/client/dist/promise/generated/client.js:464-473 contains both /api/model and /api/model/default; it also contains /api/provider and /api/provider/:providerID at lines 493-502. This establishes a generated-client/current-protocol mismatch around /api/model/default./home/byk/Code/opencode/packages/server/src/handlers.ts merges exactly 18 handler layers in this order: HealthHandler, LocationHandler, AgentHandler, SessionHandler, MessageHandler, ModelHandler, ProviderHandler, IntegrationHandler, CredentialHandler, PermissionHandler, FileSystemHandler, CommandHandler, SkillHandler, EventHandler, PtyHandler, QuestionHandler, ReferenceHandler, and ProjectCopyHandler./home/byk/Code/opencode/packages/server/src/handlers/provider.ts implements provider.list by returning response(catalog.provider.available()); provider.get calls catalog.provider.get(ctx.params.providerID) and returns ProviderNotFoundError with message Provider not found: ${ctx.params.providerID} when absent, otherwise wrapping the provider with response(Effect.succeed(provider))./home/byk/Code/opencode/packages/server/src/handlers/model.ts implements only model.list, returning response(catalog.model.available()); there is no model.default handler in this current file./home/byk/Code/opencode/packages/server/src/handlers/session.ts sets DefaultSessionsLimit = 50 and DefaultSessionHistoryLimit = 50.session.list in /home/byk/Code/opencode/packages/server/src/handlers/session.ts:24-66 parses ctx.query.cursor with SessionsCursor.parse(), maps parse failure to InvalidCursorError({ message: "Invalid cursor" }), passes workspaceID: query.workspace and limit: ctx.query.limit ?? 50 to session.list(), and emits previous and next cursors anchored to the first and last session IDs and creation times with directions "previous" and "next".session.create in /home/byk/Code/opencode/packages/server/src/handlers/session.ts:67-79 forwards optional id, agent, model, and location; when location is absent it defaults to { directory: AbsolutePath.make(process.cwd()) }.session.active in /home/byk/Code/opencode/packages/server/src/handlers/session.ts:80-89 converts session.active IDs to { [sessionID]: { type: "running" } }.Session.NotFoundError → protocol SessionNotFoundError; Session.PromptConflictError → ConflictError with the conflicting message ID as resource; Session.OperationUnavailableError in compact/wait → ServiceUnavailableError with service session.${error.operation}; Session.MessageNotFoundError → MessageNotFoundError./home/byk/Code/opencode/packages/server/src/handlers/session.ts maps Snapshot.Error during session.revert.stage or session.revert.clear to a logged UnknownError with a generated reference of form err_${crypto.randomUUID().slice(0, 8)} and public message "Unexpected server error. Check server logs for details.".session.context maps Session.MessageDecodeError to a logged UnknownError, annotating logs with ref, sessionID, and messageID; session.history defaults to 50 records and maps { events, hasMore } to { data, hasMore }; session.events returns session.events(...).pipe(Stream.orDie); session.interrupt directly invokes session.interrupt(sessionID) and returns NoContent.session.interrupt handler in /home/byk/Code/opencode/packages/server/src/handlers/session.ts:365-371 contains no explicit HTTP 499 handling and no local catch/mapping for interruption errors.