refactor(protocol): harden simulation wire contract - #42628
Merged
Conversation
kitlangton
force-pushed
the
simulation-protocol
branch
from
August 14, 2026 19:59
6a9c554 to
39171b2
Compare
This was referenced Aug 15, 2026
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
Harden the public
@opencode-ai/protocol/simulationcontract before standalone Drive deletes its copied schema.The canonical module now exposes typed backend notifications, models JSON-RPC responses as an exact success/error union, and preserves the existing protocol-v1 request, capability, and RPC declarations explicitly.
This advances #42136. After this lands in an OpenCode
nextrelease, Drive can pin that Protocol version and remove its 629-line copy.How
packages/protocol/src/simulation.tsSchema.Union(..., { mode: "oneOf" })and oppositeSchema.Neverfields, making success/error exclusivity hold at runtime and in TypeScript.Backend.Notificationand decoders forllm.request,tool.invocation, andtool.cancel.packages/simulation/test/protocol.test.tspackages/simulation/test/simulated-provider.test.tsScope
This PR does not migrate
opencode-drive; that follows the Protocol publication gate.This PR does not change simulation activation. The typed launch profile and unified activation path remain separate follow-up work.
Testing
bun typecheckinpackages/protocolbun run buildinpackages/protocolbun typecheckinpackages/simulationbun run testinpackages/simulation(42 tests)bun run lint packages/protocol/src/simulation.ts packages/simulation/test/protocol.test.tsFlow