Dashboard › opencode › Distillation
d33786cf-ae1a-4982-9a5c-68f23c1b7504["lore_tm_v1_1gNQtZnSv4gRsNY8snrtT3Nc3wL06dv0SLhhPGS3G2w","lore_tm_v1_9bJc4HZ1gJ25V1Z1M8wdaUuLxpWESyk-g7Entd3fSd4","lore_tm_v1_Hv9MTRk4-Z_2vYpFXFlbog7sC8F3zlZ5o-AtN8oachY","lore_tm_v1_JxzGGSUE-ca8j5deIT5bIVGSFzHsFGU7DBo_ffqwxZo","lore_tm_v1_ufoXm8MtJ-IlpOdKGhPA4G-SXgUYYvOKQOTnebc3FtY","lore_tm_v1_jxVvA6yo2t3rQhw0DOC6OORPaTSbNRkUmV3XLQXGnu0","lore_tm_v1_b3CDi212-ur6wTTtz23VnLv-xMflcTVM4mJsIzMzEAA","lore_tm_v1_x_IL92RaNU3qNA7s4TMsBMlFKl6tlvgKFbg8B4eeS10","lore_tm_v1_qCWnY1q8bV7O7L78FFNJ7zYKoXo21Lql44tzx2GHZ3E","lore_tm_v1_pxi3aXMzFl74UzRtIugn0Ut3w0lFcbc7TNTKYN29_5E","lore_tm_v1_sPv-bse8-xvt4p10uvzzC4bVNQpOlvVjYX4WxFCtD4A","lore_tm_v1_Jh2TPU8LL5gXGOGJFecAOrBAk3H0-iqXeiqGIiO9Z9M","lore_tm_v1_P9zBN8m2wIm_ejBhnsmBZdrl6-XT5qkw0FXNj6H_vRA","lore_tm_v1_DeyV04-GeqOuEJetG7PE-YTNVBY2FeCmSyvNqWROREo","lore_tm_v1_exzpChPDxuOqt-0WobvvUgMOb1MFZOaAJCGVXH_s1pw","lore_tm_v1_On0ZlHvD4Xu1B5XtRYTZHxkAkIJMCCy-LB9pWJhU2a0"]
Date: Sep 14, 2026
/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/processor.ts:243 initializes tool state as { status: "pending", input: {}, raw: "" }; /home/byk/Code/opencode/packages/opencode/src/acp/tool.ts:124 exports pendingToolCall; /home/byk/Code/opencode/packages/opencode/src/cli/cmd/run/stream.transport.ts:994 checks !pending || replayDisabled || closed || input.footer.isClosed; /home/byk/Code/opencode/packages/opencode/src/provider/auth.ts:180,192 stores and retrieves pending authentication by input.providerID./home/byk/Code/opencode/packages/core/test/session-prompt.test.ts:403-582. Tests establish: replaying a pending inbox prompt "Replay pending" restores admission without creating visible messages or calling wake; exact retries of legacy projected prompts preserve "Historical prompt" and gain promotedSeq; exact retries of legacy queued prompts preserve delivery: "queue"; globally unique messageID reuse across sessionID and ses_prompt_other returns Session.PromptConflictError; a prompt ID already used by visible SessionEvent.Synthetic history also returns Session.PromptConflictError and is not admitted; default prompting and resume: true each call wake exactly once with sessionID and make no direct execution call; resume: false only records the prompt and makes neither execution nor wake calls./home/byk/Code/opencode/packages/core/test/session-runner.test.ts and related tests found exactly 76 matches for request-count assertions, exactness, retries, steering, failures, and interrupted tools. Named runner scenarios include retrying after system context becomes available, steering an active provider turn, running steering input after active-turn failure, awaiting local tools before surfacing stream failure, durably failing blocked local tools on interruption, interrupting blocked provider turns, projecting provider errors/raw stream failures as terminal assistant-step failures, and durably failing unresolved hosted tools after provider errors, normal EOF, or raw stream failure./home/byk/Code/opencode/packages/core/test/session-runner.test.ts:580-759. Verified behaviors: application_context receives { sessionID, agent: AgentV2.ID.make("build"), assistantMessageID, toolCallID: "call-application" } and projects structured result { answer: "HELLO" }; default prompt "Run automatically" starts exactly 1 real provider request; two non-resuming prompts "First" then "Second" produce one chronological request using model, tools ["echo", "defect"], and two user messages; when SystemContext.InitializationBlocked occurs, there are 0 provider requests, steer input remains pending, and no SessionContextEpochTable row exists, after which retrying the same messageID when context becomes available produces exactly 1 request; moving a session to /moved interrupts its source-location runner, leaves exactly 1 prior request, and retains pending steer input; an invalid stored snapshot { invalid: { value: "bad" } } yields ContextSnapshotDecodeError with 0 requests; after systemBaseline changes from "Initial context" to "Changed context", both requests retain the durable "Initial context" system baseline while the second request appends "Changed context" as a final system message./home/byk/Code/opencode/packages/core/test/session-runner.test.ts:2441 retries inbox input after prompt projection rollback; :2467 prevents a committed promotion from becoming stranded when a post-commit listener defects; /home/byk/Code/opencode/packages/core/test/event.test.ts:175 commits local operational state within a new durable-event transaction; :192 rolls back the durable event and projector when local commit fails; /home/byk/Code/opencode/packages/core/test/filesystem/filesystem.test.ts:147 contains an idempotency test./home/byk/Code/opencode/packages/core/test/event.test.ts:90-223. Durable-event tests verify: published events reach subscribers with type test.message, data { text: "hello" }, no top-level version, and location { directory: AbsolutePath.make("project"), workspaceID: WorkspaceV2.ID.make("wrk_test") }; global events omit location; versioned durable definitions publish durable.version: 2; Event.latest(...) selects version 2 regardless of declaration order; typed and wildcard subscriptions both receive the same event; projectors run inline; durable publish ordering is exactly ["projector", "commit:0"]; a failing local commit (Effect.die("commit failed")) rolls back projector writes, EventTable, and EventSequenceTable; live-only events reject commit hooks with "Local commit hooks require a durable event"./home/byk/Code/opencode/packages/protocol/src/groups/session.ts:83-92: SessionActive is exactly { type: Schema.Literal("running") }; SessionHistoryLimit is a positive integer no greater than 100; SessionHistoryQuery accepts optional number-from-string fields limit and nonnegative after./home/byk/Code/opencode/packages/core/test/session-runner.test.ts:2262 durably fails local tools left running by a prior process; :2322 durably fails hosted tools left running by a prior process before continuing inline; :2382 durably fails pending tool input left by a prior process; /home/byk/Code/opencode/packages/core/test/session-runner-tool-registry.test.ts:135 preserves interrupted registration until its scope closes; /home/byk/Code/opencode/packages/core/test/session-run-coordinator.test.ts:122 cleans active executions when its scope closes./home/byk/Code/opencode/packages/core/test/session-projector.test.ts:373-566. Projector tests verify: distinct creator events cannot reuse projected message ID msg_creator_collisionβa SessionEvent.Step.Started collision fails and preserves the prior synthetic message; in-memory getCurrentAssistant() does not revive stale incomplete msg_assistant_stale when a newer msg_assistant_completed exists; SessionEvent.Step.Ended updates only newest incomplete assistant msg_assistant_2, setting finish: "stop" and completion time while leaving msg_assistant_1 incomplete; SessionEvent.Text.Started targeting completed msg_assistant_completed adds text part { type: "text", id: "text-stale", text: "" } without clearing its completion time or reviving the separate stale assistant./home/byk/Code/opencode/packages/opencode/test/mcp/lifecycle.test.ts:323 invokes server.restart; /home/byk/Code/opencode/packages/opencode/test/cli/run/stream.transport.test.ts:695 preserves running footer state for resumed active sessions; /home/byk/Code/opencode/packages/app/src/context/server-sync.test.ts:69 loads active sessions immediately and once per server cache./home/byk/Code/opencode/packages/core/test/session-runner-recorded.test.ts. The recorded HTTP test uses cassette session-runner/openai-chat-streams-text under fixtures/recordings, records when RECORD === "true", configures OpenAI Chat at https://api.openai.com/v1 with bearer OPENAI_API_KEY ?? "fixture", generation { maxTokens: 20, temperature: 0 }, and model gpt-4o-mini. It prompts session ses_runner_recorded with "Say hello in one short sentence.", resumes it, expects exactly 2 context messages and assistant text "Hello!", and verifies durable event ordering exactly: 1. session.next.prompt.admitted.1, 2. session.next.prompted.1, 3. session.next.step.started.1, 4. session.next.text.started.1, 5. session.next.text.ended.1, 6. session.next.step.ended.2./home/byk/Code/opencode/packages/protocol/src/groups/session.ts:211,221: resume is an optional Boolean, and the operation is described as "Durably admit one session input and schedule agent-loop execution unless resume is false."/home/byk/Code/opencode/packages/core/src/database/migration/20260213144116_wakeful_the_professor.ts. Migration ID 20260213144116_wakeful_the_professor creates table control_account with required text columns email, url, access_token, refresh_token; nullable integer token_expiry; required integer columns active, time_created, time_updated; and composite primary-key constraint control_account_pk on (email, url).