Repository navigation
feat(session): expose transient generation API - #37433
Merged
Merged
Conversation
This was referenced Jul 19, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Exposes the existing read-only
SessionV2.generatecapability through the V2 HTTP API, generated Promise and Effect clients, and plugin session contexts. Applications and plugins can now request transient text from current Session context without admitting input or mutating durable history.How
POST /api/session/:sessionID/generateto the Session Protocol group.SessionV2.generateimplementation.ctx.session.generatein Promise and Effect V2 plugin contexts and wires both plugin adapters.Scope
This PR only exposes the generic transient generation capability. It does not include recap prompts, stale-result suppression, idle waiting, caching, timers, or TUI presentation; those remain in the separate recap work.
Testing
bun turbo typecheck --concurrency=3: 32 package tasks passed.bun run testinpackages/client: 43 passed.bun run testinpackages/plugin: 7 passed.bun run testinpackages/server: 10 passed.packages/core/test/plugin/promise.test.ts: 9 passed.git diff --checkpassed.Flow
sequenceDiagram participant App as App or plugin participant Client as V2 client participant Server as Session HTTP handler participant Core as SessionV2.generate App->>Client: session.generate(sessionID, prompt) Client->>Server: POST /api/session/:sessionID/generate Server->>Core: generate(sessionID, prompt) Core-->>Server: transient text Server-->>Client: { data: { text } } Client-->>App: { text }