SEP Phase 4 (engine): commands, session actions, hot reload#29
Merged
Conversation
ExtensionHost gains command dispatch (command/execute + command/complete), the session-action delegate seam (send_message/send_user_message/append_entry) guarded by the command-tier + epoch context check (-32003 ContextViolation), and hot reload (session_shutdown → epoch fence → respawn → re-init → session_start). New protocol types for commands/shortcuts/flags/session + sep-echo-peer command support. Additive: no host attached = unchanged loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 9df7916 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Problem
Phase 4 of the Smooth Extension Protocol needs the engine to support extension-registered slash commands, session-mutating actions, and hot reload — with the two-tier context guard that prevents an extension from mutating the session outside a command handler or across a reload.
Solution
Additive to
ExtensionHost/HostDelegate/ protocol (zero behavior change with no host attached):run_command(command/execute, COMMAND-tier context) +complete_command(command/complete, best-effort autocomplete);commands()/shortcuts()surface registrations for a frontend palette.HostDelegate::session_send_message/session_send_user_message(deliver_assteer/follow_up/next_turn) /session_append_entry, each gated byvalidate_command_context(command tier + current epoch → else-32003 ContextViolation, fired before the delegate). Headless defaults report-32004 CapabilityDisabled.reload(name)firessession_shutdown{reason:reload}, bumps the shared epoch (invalidating stale tokens), respawns (generation guard drops late replies), re-inits, firessession_start{reason:reload}. Declared-events clamp re-applied on reload (no cross-restart escalation).CommandExecute*,CommandComplete*,Completion,ShortcutRegistration,DeliverAs,Session*Params),InitializeParams.flags,Registrations.shortcuts.sep-echo-peerregisters a command + shortcut and answers command/execute + command/complete.Verification
cargo testgreen (45 unit incl. exhaustivevalidate_command_contextcases + aHostInboundsession-routing test; newsep_command_reloadintegration test covers dispatch, autocomplete, and reload-epoch-fence). fmt clean; the 2 clippy warnings are pre-existing incheckpoint.rs.🤖 Generated with Claude Code