Skip to content

resolveSessionConfig/sessionConfigCompletions for custom metadata in createSession flow - #42

Merged
roblourens merged 8 commits into
mainfrom
copilot/distinctive-moth
Apr 12, 2026
Merged

roblourens merged 8 commits into
mainfrom
copilot/distinctive-moth

Conversation

@roblourens

Copy link
Copy Markdown
Member

No description provided.

@roblourens roblourens self-assigned this Apr 8, 2026
@roblourens
roblourens force-pushed the copilot/distinctive-moth branch from 52b2cfc to 3782c3e Compare April 10, 2026 15:43
- 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)
@roblourens roblourens changed the title Prototype resolveSessionConfig for custom metadata in createSession flow resolveSessionConfig/sessionConfigCompletions for custom metadata in createSession flow Apr 10, 2026
@roblourens
roblourens requested a review from Copilot April 10, 2026 22:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 resolveSessionConfig and sessionConfigCompletions commands plus supporting schema/value types.
  • Adds session/configChanged action and reducer logic + reducer test cases to persist/merge summary.config.
  • Extends state, exports, Swift generation inputs, and JSON schemas to include config and configSchema.
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

Comment thread types/reducers.ts Resolved
Comment thread schema/state.schema.json Resolved
Comment thread schema/notifications.schema.json Resolved
Comment thread schema/actions.schema.json Resolved
roblourens and others added 2 commits April 10, 2026 16:03
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]>
@roblourens
roblourens requested a review from Copilot April 11, 2026 22:57
@roblourens
roblourens marked this pull request as ready for review April 11, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 resolveSessionConfig and sessionConfigCompletions JSON-RPC commands, and adds config support to createSession.
  • Adds ISessionConfigState (+ schema types) to ISessionState, plus a new session/configChanged action 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

Comment thread types/state.ts Resolved
@roblourens
roblourens marked this pull request as draft April 11, 2026 23:14
@roblourens
roblourens marked this pull request as ready for review April 12, 2026 00:13
@roblourens
roblourens enabled auto-merge April 12, 2026 00:13
@roblourens
roblourens merged commit 9be2f2b into main Apr 12, 2026
3 checks passed
@roblourens
roblourens deleted the copilot/distinctive-moth branch April 12, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants