Repository navigation
feat(protocol): graduate session instruction entries from experimental - #56688
Draft
kitlangton wants to merge 2 commits into
Draft
kitlangton wants to merge 2 commits into
kitlangton wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Why
Session instruction entries were originally added as stable
/api/session/:sessionID/context-entryin #34941 (2026-07-02), renamed to/api/session/:sessionID/instructions/entriesin #35583 (2026-07-06), and moved under/api/experimental/in648d01eec7(#49067, 2026-09-14) during the V2 HTTP API audit (V2_HTTP_API_AUDIT.mdrows 077–079) because there was no first-party caller at the time.The plugin SDK change in #56550 exposes
ctx.session.instructions.entry.{list,put,remove}for keyed, replaceable, durable instructions that announce updates at the next step boundary. GenUI #56548 fixes the immediate extra-step bug withSystemPartand does not use instruction entries; moving GenUI onto keyed entries remains a separate follow-up. Neither change requires these HTTP routes to graduate, so this PR proposes a stable HTTP commitment alongside that plugin surface.What Changes
Graduate the three session instruction entry endpoints back to
/api/session/:sessionID/instructions/entries[/:key]while keeping the/api/experimental/...paths as deprecated aliases sharing the same handlers and middleware:GET/api/session/:sessionID/instructions/entriessession.instructions.entry.list/api/experimental/session/:sessionID/instructions/entriesexperimental.session.instructions.entry.list(deprecated: true)PUT/api/session/:sessionID/instructions/entries/:keysession.instructions.entry.put/api/experimental/session/:sessionID/instructions/entries/:keyexperimental.session.instructions.entry.put(deprecated: true)DELETE/api/session/:sessionID/instructions/entries/:keysession.instructions.entry.remove/api/experimental/session/:sessionID/instructions/entries/:keyexperimental.session.instructions.entry.remove(deprecated: true)packages/protocol,packages/server,services/www): Both route sets usesessionLocationMiddlewareand share the sameSessionHandlerimplementations (listInstructionEntries,putInstructionEntry,removeInstructionEntry). The experimental aliases remain inopenapi.jsonwithdeprecated: trueand descriptions pointing to the stable operations.packages/protocol/src/client.ts,packages/client): Bothsession.instructions.entry.*andexperimental.session.instructions.entry.*live inSessionGroupand project to the same client path (session.instructions.entry.*). Because@opencode/httpapi-codegenintentionally keeps endpoint filtering policy in the caller rather than applying implicit annotation rules (packages/httpapi-codegen/README.md), the deprecated alias operation IDs are omitted viapromiseOmitEndpointsandeffectOmitEndpointsso generated Promise and Effect clients expose a singleclient.session.instructions.entry.{list,put,remove}tree hitting/api/session/:sessionID/instructions/entries[/:key].V2_HTTP_API_AUDIT.md): Rows 077–079 now record theKeepdisposition on the stable routes alongside the deprecated/api/experimental/...aliases.Open Question for @thdxr / Dax
session.instructions.entry.{list,put,remove}back to/api/session/:sessionID/instructions/entries[/:key]look good to you alongside the plugin SDK surface (feat(plugin): expose session instruction entries to plugins #56550) and the planned GenUI migration to keyed entries? GenUI fix(genui): stop GenUI reminder from triggering an extra turn #56548 itself usesSystemPart, not this API./api/experimental/session/:sessionID/instructions/entries[/:key]asdeprecated: truealiases so any existing callers on the experimental URLs don't break immediately. Proposal: keep the aliases for two minor releases (or remove them right away if we don't need a compatibility window for/api/experimental/).Scope
This PR owns graduating the session instruction entry HTTP routes to
/api/session/:sessionID/instructions/entries[/:key], retaining deprecated/api/experimental/...aliases on the server and in OpenAPI, and updating generated clients and tests. Instruction entry key validation hardening is tracked in a separate PR.Verification
packages/protocol: OpenAPI generation check, typecheck, and 9/9 tests passed.packages/client: client codegen check, typecheck, and 49/49 Promise + Effect client tests passed against/api/session/:sessionID/instructions/entries[/:key].packages/server: typecheck and 13/13test/fetch.test.tstests passed, includingsessionLocationMiddlewarechecks and shared-state roundtrips across/api/session/:sessionID/instructions/entries[/:key]and/api/experimental/session/:sessionID/instructions/entries[/:key].packages/sdk: typecheck and 4/4test/contract-identity.test.tstests passed.