Repository navigation
refactor(core): rename system context to instructions - #35583
Merged
Merged
Conversation
Pure vocabulary and contract rename; behavior is unchanged. - Rename the SystemContext algebra to Instructions and move it to src/instructions, with InstructionBuiltIns, InstructionDiscovery (formerly InstructionContext), InstructionEntry, and InstructionCheckpoint replacing the context-named modules. - Rename tables session_context_entry and session_context_epoch to instruction_entry and instruction_checkpoint; the migration renames in place and rewrites durable session.context.updated event types to session.instructions.updated. - Nest API-managed entry routes under /api/session/:sessionID/instructions/entries with session.instructions.entry.* operation ids, keeping bare session.instructions.* free for the composed instruction surface. - Teach httpapi-codegen nested client paths so generated clients expose session.instructions.entry.list/put/remove. - Separate Model Context from Instructions in CONTEXT.md and update specs; regenerate clients, SDK types, and the codemode fixture.
This was referenced Jul 7, 2026
This was referenced Jul 19, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 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.
Pure vocabulary and contract rename — behavior is unchanged. The durable path-local discovery redesign that previously traveled with this rename is split into the stacked follow-up PR based on this branch.
What renames
SystemContextalgebra becomesInstructions(packages/core/src/instructions), withInstructionBuiltIns,InstructionDiscovery(formerlyInstructionContext),InstructionEntry(formerlySessionContextEntry), andInstructionCheckpoint(formerlySessionContextCheckpoint). TheSessionInstructionssynthetic injection mechanism is untouched.session_context_entry->instruction_entry,session_context_epoch->instruction_checkpoint(also fixing the old epoch/checkpoint name mismatch). The migration renames in place.session.context.updated->session.instructions.updated; the migration rewrites existing durable event types in place, preserving history./api/session/:sessionID/context-entryto/api/session/:sessionID/instructions/entries[/:key]withsession.instructions.entry.*operation ids, keeping baresession.instructions.*free for the composed instruction surface. httpapi-codegen learns nested client paths so clients exposesession.instructions.entry.list/put/remove.Verification
bun typecheckclean in core, protocol, server, client, codemode, sdk-next, schema, httpapi-codegen.bun script/migration.ts --checkpasses; clients, SDK types, and the codemode fixture regenerate cleanly with rename-only diffs.contract-identity.test.tsmodule resolution and schemav1-isolation(filesystem-v1.ts) failures reproduce on the base branch.