Repository navigation
resolveSessionConfig/sessionConfigCompletions for custom metadata in createSession flow - #42
Merged
Merged
Conversation
roblourens
force-pushed
the
copilot/distinctive-moth
branch
from
April 10, 2026 15:43
52b2cfc to
3782c3e
Compare
- Add sessionMutable flag to ISessionConfigPropertySchema - Add configSchema to ISessionState for reconnecting clients - Add session/configChanged action (clientDispatchable) to update mutable config values mid-session - Add reducer logic + test fixtures - Update v1 compatibility checks, version registry, Swift generator - Regenerate schemas and action-origin types (Written by Copilot)
(Written by Copilot)
There was a problem hiding this comment.
Pull request overview
Adds a session-configuration “metadata” flow to AHP so clients can iteratively resolve a config schema during createSession, fetch dynamic enum completions, and propagate config changes into session state.
Changes:
- Introduces
resolveSessionConfigandsessionConfigCompletionscommands plus supporting schema/value types. - Adds
session/configChangedaction and reducer logic + reducer test cases to persist/mergesummary.config. - Extends state, exports, Swift generation inputs, and JSON schemas to include
configandconfigSchema.
Show a summary per file
| File | Description |
|---|---|
| types/version/v1.ts | Adds v1 compatibility aliases/checks for new commands/types and the new action. |
| types/version/registry.ts | Registers session/configChanged in the action→version map. |
| types/version/message-checks.ts | Updates compile-time command map exhaustiveness to include new commands. |
| types/test-cases/reducers/113-session-configchanged-merges-into-summary-config.json | Adds reducer test for merging config updates into summary.config. |
| types/test-cases/reducers/114-session-configchanged-adds-config-when-undefined.json | Adds reducer test for initializing summary.config when previously absent. |
| types/state.ts | Adds configSchema to ISessionState and config to ISessionSummary. |
| types/reducers.ts | Handles SessionConfigChanged by merging into summary.config and bumping modifiedAt. |
| types/messages.ts | Registers the two new JSON-RPC methods in ICommandMap. |
| types/index.ts | Re-exports the new action + command/schema types from the public types entrypoint. |
| types/commands.ts | Defines the new commands and schema/value item types; adds config to createSession params. |
| types/actions.ts | Adds ActionType.SessionConfigChanged and ISessionConfigChangedAction to the action unions. |
| types/action-origin.generated.ts | Marks the new action as client-dispatchable and includes it in session action unions. |
| scripts/generate-swift.ts | Includes the new action/command structs in Swift codegen inputs. |
| schema/state.schema.json | Adds configSchema and config fields to the generated state schema. |
| schema/notifications.schema.json | Adds configSchema/config to notification-related generated schema shapes. |
| schema/commands.schema.json | Adds config to createSession params and introduces schema for the new commands/types. |
| schema/actions.schema.json | Adds schema for ISessionConfigChangedAction and references configSchema in state shapes. |
Copilot's findings
- Files reviewed: 17/17 changed files
- Comments generated: 4
Move session config schema types into state so generated schemas that reference session state include the corresponding definitions, and make configChanged reducer merging handle missing existing config. (Written by Copilot)
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds first-class “session config” support to the Agent Host Protocol so clients can resolve agent-specific metadata during createSession, request dynamic completions for config fields, and apply mid-session config updates via a state action.
Changes:
- Introduces
resolveSessionConfigandsessionConfigCompletionsJSON-RPC commands, and addsconfigsupport tocreateSession. - Adds
ISessionConfigState(+ schema types) toISessionState, plus a newsession/configChangedaction and reducer handling. - Regenerates version checks, Swift generator inputs, and JSON schemas; adds reducer fixtures for config merging behavior.
Show a summary per file
| File | Description |
|---|---|
| types/version/v1.ts | Adds v1 compatibility aliases/assertions for new session config types, actions, and commands. |
| types/version/registry.ts | Registers session/configChanged as introduced in protocol v1. |
| types/version/message-checks.ts | Updates exhaustiveness checks to include the two new command names. |
| types/test-cases/reducers/114-session-configchanged-adds-config-when-undefined.json | Adds reducer fixture for session/configChanged behavior when state.config is absent. |
| types/test-cases/reducers/113-session-configchanged-merges-into-summary-config.json | Adds reducer fixture verifying merge into state.config.values and modifiedAt bump. |
| types/state.ts | Adds config?: ISessionConfigState to ISessionState and defines session-config schema/state types. |
| types/reducers.ts | Implements SessionConfigChanged reducer branch to merge config values and bump modifiedAt. |
| types/messages.ts | Registers the new commands in ICommandMap. |
| types/index.ts | Re-exports new session config state/types, action, and command types. |
| types/commands.ts | Adds config to ICreateSessionParams and defines the new config-resolution + completions commands and types. |
| types/actions.ts | Adds ActionType.SessionConfigChanged and ISessionConfigChangedAction to the state action union. |
| types/action-origin.generated.ts | Marks session/configChanged as client-dispatchable and includes it in session action unions. |
| scripts/generate-swift.ts | Extends Swift generation lists to include the new state type, action variant, and command structs. |
| schema/state.schema.json | Regenerates state JSON Schema to include ISessionConfigState and related defs. |
| schema/notifications.schema.json | Regenerates notifications JSON Schema to include updated ISessionState shape/defs. |
| schema/commands.schema.json | Regenerates commands JSON Schema for createSession.config and new commands/types. |
| schema/actions.schema.json | Regenerates actions JSON Schema to include ISessionConfigChangedAction and updated state defs. |
Copilot's findings
- Files reviewed: 17/17 changed files
- Comments generated: 3
roblourens
marked this pull request as draft
April 11, 2026 23:14
roblourens
marked this pull request as ready for review
April 12, 2026 00:13
roblourens
enabled auto-merge
April 12, 2026 00:13
joshspicer
approved these changes
Apr 12, 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.
No description provided.