feat(session): Add namespaced session defaults profiles#215
feat(session): Add namespaced session defaults profiles#215cameroncooke wants to merge 1 commit intomainfrom
Conversation
Add profile-aware session defaults so agents can switch between global and named defaults in multi-target projects. Keep existing global defaults behavior fully backward compatible while enabling per-profile persistence in project config. Add session_use_defaults_profile, config schema support, runtime/bootstrap wiring, docs updates, and tests for profile activation and persistence behavior. Co-Authored-By: Claude <noreply@anthropic.com>
commit: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| description: Select the active session defaults profile for multi-target workflows. | ||
| annotations: | ||
| title: Use Session Defaults Profile | ||
| readOnlyHint: true |
There was a problem hiding this comment.
State-modifying tool incorrectly annotated as read-only
High Severity
The session_use_defaults_profile manifest declares readOnlyHint: true, but the tool mutates session state via sessionStore.setActiveProfile and can write to the config file on disk when persist: true. The sibling tools session_set_defaults and session_clear_defaults correctly use destructiveHint: true for the same reason. MCP clients rely on readOnlyHint to decide whether a tool can be auto-approved without user confirmation, so this annotation could allow silent, unconfirmed state and filesystem changes.


Add namespaced session defaults profiles so one session can switch cleanly between iOS, watchOS, and other target setups without rewriting global defaults each time.
Session defaults were previously effectively global per session, which caused friction in monorepos and multi-target projects. This change keeps the existing global behavior fully backward compatible while adding profile-scoped defaults and an explicit active profile.
The change adds
sessionDefaultsProfilesandactiveSessionDefaultsProfilesupport in config/schema resolution, introducessession_use_defaults_profile(including optional persistence to config), and wires profile-aware behavior through runtime bootstrap and Xcode defaults sync paths. It also updates docs with full config examples and startup flow guidance, and adds coverage for profile selection and persistence behavior in unit/integration tests.I considered replacing
sessionDefaultsentirely with profile-only config, but kept both so existing setups continue to work unchanged and users can adopt named profiles incrementally.