Repository navigation
feat: add repo-level default override setup - #90
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds an optional, interactive repo-scoped "runtime defaults" step to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as Setup Command
participant Config as Workspace Config
participant Runtime as Runtime Defaults
User->>CLI: Run 'compozy setup' (interactive, non-global)
CLI->>CLI: buildInstallPlan (include runtimeDefaultsPlan)
CLI->>Config: Load existing workspace config
Config-->>CLI: return config (or none)
CLI->>Runtime: Prompt user for IDE/model/reasoning_effort
User->>Runtime: Choose values / decline
Runtime-->>CLI: runtimeDefaultsPlan (enabled/disabled + values)
CLI->>CLI: confirmPlan + executeInstall
alt install succeeds
CLI->>Config: Reload config
CLI->>Config: WriteConfig(.compozy/config.toml) with merged defaults
Config-->>CLI: write success
CLI-->>User: Setup complete (defaults saved)
else install fails
CLI-->>User: Setup failed (do not persist config)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/cli/setup.go (1)
123-137:⚠️ Potential issue | 🟠 MajorPropagate
cmd.Context()through the new workspace/config I/O path.The helpers in the install flow start fresh
context.Background()values for workspace resolution, config loads, and config writes. This drops cancellation from the Cobra command exactly where filesystem I/O happens, allowing a canceled setup to continue running through discovery or persistence.Functions affected:
resolveRuntimeDefaultsPlan()(line 279): Usescontext.Background()inloadConfigFilecallruntimeDefaultsPath()(line 388): Usescontext.Background()inresolveWorkspaceContextcallpersistRuntimeDefaults()(lines 400, 407): Usescontext.Background()in bothloadConfigFileandwriteConfigcallsSuggested fix
-func (s *setupCommandState) buildInstallPlan( - cmd *cobra.Command, +func (s *setupCommandState) buildInstallPlan( + ctx context.Context, + cmd *cobra.Command, skills []setup.Skill, resolver setup.ResolverOptions, supportedAgents []setup.Agent, detectedAgents []setup.Agent, ) (setup.InstallConfig, []setup.PreviewItem, []setup.ReusableAgentPreviewItem, runtimeDefaultsPlan, error) { @@ - runtimePlan, err := s.resolveRuntimeDefaultsPlan(globalScope) + runtimePlan, err := s.resolveRuntimeDefaultsPlan(ctx, globalScope) @@ -func (s *setupCommandState) executeInstall( +func (s *setupCommandState) executeInstall( + ctx context.Context, cmd *cobra.Command, cfg setup.InstallConfig, runtimePlan runtimeDefaultsPlan, ) error { @@ - if err := s.persistRuntimeDefaults(runtimePlan); err != nil { + if err := s.persistRuntimeDefaults(ctx, runtimePlan); err != nil { return err } return nil } -func (s *setupCommandState) resolveRuntimeDefaultsPlan(global bool) (runtimeDefaultsPlan, error) { +func (s *setupCommandState) resolveRuntimeDefaultsPlan(ctx context.Context, global bool) (runtimeDefaultsPlan, error) { @@ - configPath, err := s.runtimeDefaultsPath() + configPath, err := s.runtimeDefaultsPath(ctx) @@ - currentConfig, exists, err := s.loadConfigFile(context.Background(), configPath) + currentConfig, exists, err := s.loadConfigFile(ctx, configPath) @@ -func (s *setupCommandState) runtimeDefaultsPath() (string, error) { - workspaceCtx, err := resolveWorkspaceContext(context.Background()) +func (s *setupCommandState) runtimeDefaultsPath(ctx context.Context) (string, error) { + workspaceCtx, err := resolveWorkspaceContext(ctx) @@ -func (s *setupCommandState) persistRuntimeDefaults(plan runtimeDefaultsPlan) error { +func (s *setupCommandState) persistRuntimeDefaults(ctx context.Context, plan runtimeDefaultsPlan) error { @@ - currentConfig, _, err := s.loadConfigFile(context.Background(), plan.ConfigPath) + currentConfig, _, err := s.loadConfigFile(ctx, plan.ConfigPath) @@ - if err := s.writeConfig(context.Background(), plan.ConfigPath, currentConfig); err != nil { + if err := s.writeConfig(ctx, plan.ConfigPath, currentConfig); err != nil { return err }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cli/setup.go` around lines 123 - 137, The install flow currently uses context.Background() for workspace/config I/O which drops Cobra command cancellation; update the calls so the Cobra command context is propagated: obtain ctx := cmd.Context() in the caller path and pass it into resolveRuntimeDefaultsPlan, runtimeDefaultsPath, and persistRuntimeDefaults (or add a ctx parameter to those functions) and replace context.Background() usages inside resolveRuntimeDefaultsPlan (loadConfigFile), runtimeDefaultsPath (resolveWorkspaceContext), and persistRuntimeDefaults (loadConfigFile and writeConfig) to use the passed ctx instead of context.Background(); ensure signatures for resolveRuntimeDefaultsPlan, runtimeDefaultsPath, and persistRuntimeDefaults (and any intermediate helpers) accept a context.Context and thread it into loadConfigFile, resolveWorkspaceContext, and writeConfig calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cli/setup.go`:
- Around line 420-425: preferredRuntimeModel currently always falls back to
defaultModelForIDE(model.IDECodex) when defaults.Model is unset, causing
inherited IDEs to be ignored; change it to use defaults.Ide (if
present/non-empty) to choose the IDE-specific default model. Update
preferredRuntimeModel(workspace.DefaultsConfig) to: if defaults.Model is
nil/empty then check defaults.Ide (trim and ensure non-empty) and call
defaultModelForIDE with that IDE identifier; only if defaults.Ide is
missing/empty fall back to defaultModelForIDE(model.IDECodex). Keep existing
trimming/nullable checks and retain function name preferredRuntimeModel and the
callsite behavior used by editRuntimeDefaultsSelection.
---
Outside diff comments:
In `@internal/cli/setup.go`:
- Around line 123-137: The install flow currently uses context.Background() for
workspace/config I/O which drops Cobra command cancellation; update the calls so
the Cobra command context is propagated: obtain ctx := cmd.Context() in the
caller path and pass it into resolveRuntimeDefaultsPlan, runtimeDefaultsPath,
and persistRuntimeDefaults (or add a ctx parameter to those functions) and
replace context.Background() usages inside resolveRuntimeDefaultsPlan
(loadConfigFile), runtimeDefaultsPath (resolveWorkspaceContext), and
persistRuntimeDefaults (loadConfigFile and writeConfig) to use the passed ctx
instead of context.Background(); ensure signatures for
resolveRuntimeDefaultsPlan, runtimeDefaultsPath, and persistRuntimeDefaults (and
any intermediate helpers) accept a context.Context and thread it into
loadConfigFile, resolveWorkspaceContext, and writeConfig calls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 15b483aa-5cd5-4f7f-8c6c-845239c3f6b5
📒 Files selected for processing (7)
internal/cli/setup.gointernal/cli/setup_test.gointernal/core/agent/registry_specs.gointernal/core/model/runtime_config.gointernal/core/workspace/config.gointernal/core/workspace/config_test.gointernal/core/workspace/config_types.go
a6a94a7 to
17fa372
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/cli/setup.go (1)
123-137:⚠️ Potential issue | 🟠 MajorThread
cmd.Context()through the runtime-defaults resolution flow instead of usingcontext.Background().The code calls workspace I/O at lines 279, 388, 400, and 407 with
context.Background(), which disables command cancellation and timeout handling. Passcmd.Context()intobuildInstallPlan,resolveRuntimeDefaultsPlan,runtimeDefaultsPath, andpersistRuntimeDefaultsto respect cancellation signals. This aligns with the coding guideline: "Pass context.Context as the first argument to all functions crossing runtime boundaries; avoid context.Background() outside main and focused tests."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cli/setup.go` around lines 123 - 137, The install flow uses context.Background() in workspace I/O calls which prevents cancellation; thread cmd.Context() through the runtime-defaults resolution by changing buildInstallPlan to accept a context (use cmd.Context() when calling s.buildInstallPlan) and update all downstream functions: resolveRuntimeDefaultsPlan, runtimeDefaultsPath, and persistRuntimeDefaults to take a context.Context as their first parameter; then pass the received ctx through each call path so workspace I/O at the points currently using context.Background() uses the propagated cmd.Context() instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cli/setup.go`:
- Around line 274-286: The code calls s.loadConfigFile(configPath) (via
s.runtimeDefaultsPath()) before prompting the user in
promptRuntimeDefaultsConfig, which makes a malformed/unreadable
.compozy/config.toml abort setup even if the user would decline opt‑in; change
the flow in the runtime defaults logic (runtimeDefaultsPlan creation path) to
either (a) call promptRuntimeDefaultsConfig first and only call s.loadConfigFile
if the user opts in, or (b) treat load errors as non-fatal by skipping the
repo-defaults flow when s.loadConfigFile returns an error (returning a
default/empty currentConfig to promptRuntimeDefaultsConfig). Update code paths
referencing runtimeDefaultsPlan, s.runtimeDefaultsPath, s.loadConfigFile and
promptRuntimeDefaultsConfig accordingly so config file parsing is deferred until
after the user confirms opt-in or gracefully ignored on read failures.
---
Outside diff comments:
In `@internal/cli/setup.go`:
- Around line 123-137: The install flow uses context.Background() in workspace
I/O calls which prevents cancellation; thread cmd.Context() through the
runtime-defaults resolution by changing buildInstallPlan to accept a context
(use cmd.Context() when calling s.buildInstallPlan) and update all downstream
functions: resolveRuntimeDefaultsPlan, runtimeDefaultsPath, and
persistRuntimeDefaults to take a context.Context as their first parameter; then
pass the received ctx through each call path so workspace I/O at the points
currently using context.Background() uses the propagated cmd.Context() instead.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f3bfac45-2f7a-4d61-a065-d7e638febf2e
📒 Files selected for processing (7)
internal/cli/setup.gointernal/cli/setup_test.gointernal/core/agent/registry_specs.gointernal/core/model/runtime_config.gointernal/core/workspace/config.gointernal/core/workspace/config_test.gointernal/core/workspace/config_types.go
🚧 Files skipped from review as they are similar to previous changes (5)
- internal/core/model/runtime_config.go
- internal/core/workspace/config_test.go
- internal/cli/setup_test.go
- internal/core/workspace/config.go
- internal/core/workspace/config_types.go
17fa372 to
a902be8
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/cli/setup.go (1)
381-387: Consider threading context from the command.This function and
persistRuntimeDefaultsusecontext.Background()rather than accepting a context parameter. While acceptable for CLI commands, threadingcmd.Context()would align better with the codebase guidelines and enable cancellation if the CLI infrastructure supports it.♻️ Optional: Thread context through the call chain
-func (s *setupCommandState) runtimeDefaultsPath() (string, error) { - workspaceCtx, err := resolveWorkspaceContext(context.Background()) +func (s *setupCommandState) runtimeDefaultsPath(ctx context.Context) (string, error) { + workspaceCtx, err := resolveWorkspaceContext(ctx) if err != nil { return "", err } return workspaceCtx.ConfigPath, nil }And propagate from callers using
cmd.Context().🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cli/setup.go` around lines 381 - 387, Change runtimeDefaultsPath to accept a context.Context parameter and use it when calling resolveWorkspaceContext instead of context.Background(); do the same for persistRuntimeDefaults so both functions take ctx and propagate cancellation. Update callers to pass through the command context (cmd.Context()) into persistRuntimeDefaults and runtimeDefaultsPath. Keep the same return values and error handling, only replace context.Background() with the passed-in ctx and ensure resolveWorkspaceContext is invoked with that ctx.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/cli/setup.go`:
- Around line 381-387: Change runtimeDefaultsPath to accept a context.Context
parameter and use it when calling resolveWorkspaceContext instead of
context.Background(); do the same for persistRuntimeDefaults so both functions
take ctx and propagate cancellation. Update callers to pass through the command
context (cmd.Context()) into persistRuntimeDefaults and runtimeDefaultsPath.
Keep the same return values and error handling, only replace
context.Background() with the passed-in ctx and ensure resolveWorkspaceContext
is invoked with that ctx.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3c6549ab-61fe-4884-97f4-b7f0e32d1b8c
📒 Files selected for processing (7)
internal/cli/setup.gointernal/cli/setup_test.gointernal/core/agent/registry_specs.gointernal/core/model/runtime_config.gointernal/core/workspace/config.gointernal/core/workspace/config_test.gointernal/core/workspace/config_types.go
✅ Files skipped from review due to trivial changes (1)
- internal/core/workspace/config_types.go
🚧 Files skipped from review as they are similar to previous changes (2)
- internal/core/model/runtime_config.go
- internal/cli/setup_test.go
a902be8 to
b0ce303
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/cli/setup.go (1)
397-410: Move this config update behind a single atomic workspace helper.This is now a full read-modify-write of
.compozy/config.toml. Becauseworkspace.LoadConfigFileandworkspace.WriteConfigare separate operations ininternal/core/workspace/config.go:87-124, concurrent writers can still drop unrelated config edits. I’d rather keep the merge-and-write logic in one workspace-layer helper so atomic write/locking behavior lives in one place.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cli/setup.go` around lines 397 - 410, persistRuntimeDefaults currently does a separate read (s.loadConfigFile) and write (s.writeConfig) which can lead to lost concurrent updates; replace that read-modify-write here with a single atomic workspace helper (e.g., add workspace.ModifyConfig or workspace.UpdateConfig that takes the ConfigPath and a callback to mutate the loaded config under a lock and writes it back). Move the merge logic that sets Defaults.IDE, Defaults.Model, Defaults.ReasoningEffort into that callback and call the new helper from persistRuntimeDefaults (keep signature of runtimeDefaultsPlan and persistRuntimeDefaults), removing the direct calls to s.loadConfigFile and s.writeConfig so all config mutations go through the workspace-level atomic helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/cli/setup.go`:
- Around line 296-315: The code currently sets runtimeDefaultsPlan.Existing
based only on the file-exists flag `exists` returned by `loadConfigFile`; change
this so Existing reflects whether `[defaults]` actually exists in the loaded
config by checking `currentConfig.Defaults` (or the concrete field that
represents defaults) and only setting Existing = true when `exists` AND the
defaults section is non-nil/non-empty; update the creation of
runtimeDefaultsPlan (and any related logic that expects Existing) to use this
combined condition so creating a new `[defaults]` from a file that lacks the
defaults section is treated as a create rather than an update.
---
Nitpick comments:
In `@internal/cli/setup.go`:
- Around line 397-410: persistRuntimeDefaults currently does a separate read
(s.loadConfigFile) and write (s.writeConfig) which can lead to lost concurrent
updates; replace that read-modify-write here with a single atomic workspace
helper (e.g., add workspace.ModifyConfig or workspace.UpdateConfig that takes
the ConfigPath and a callback to mutate the loaded config under a lock and
writes it back). Move the merge logic that sets Defaults.IDE, Defaults.Model,
Defaults.ReasoningEffort into that callback and call the new helper from
persistRuntimeDefaults (keep signature of runtimeDefaultsPlan and
persistRuntimeDefaults), removing the direct calls to s.loadConfigFile and
s.writeConfig so all config mutations go through the workspace-level atomic
helper.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 74d24c06-1e69-4942-85dc-02ea10c121e0
📒 Files selected for processing (7)
internal/cli/setup.gointernal/cli/setup_test.gointernal/core/agent/registry_specs.gointernal/core/model/runtime_config.gointernal/core/workspace/config.gointernal/core/workspace/config_test.gointernal/core/workspace/config_types.go
✅ Files skipped from review due to trivial changes (4)
- internal/core/model/runtime_config.go
- internal/cli/setup_test.go
- internal/core/workspace/config.go
- internal/core/workspace/config_types.go
🚧 Files skipped from review as they are similar to previous changes (1)
- internal/core/workspace/config_test.go
b0ce303 to
3fa10b0
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/cli/setup.go (1)
413-415: Wrap the runtime-defaults write failure with local context.If
writeConfigfails here, the caller loses the fact that setup was persisting repo defaults, which makes a post-install failure harder to diagnose.Proposed fix
currentConfig.Defaults.IDE = plan.Defaults.IDE currentConfig.Defaults.Model = plan.Defaults.Model currentConfig.Defaults.ReasoningEffort = plan.Defaults.ReasoningEffort if err := s.writeConfig(ctx, plan.ConfigPath, currentConfig); err != nil { - return err + return fmt.Errorf("write runtime defaults config %q: %w", plan.ConfigPath, err) } return nil }As per coding guidelines, "Prefer explicit error returns with wrapped context using
fmt.Errorf("context: %w", err)".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cli/setup.go` around lines 413 - 415, When persisting repo defaults using s.writeConfig(ctx, plan.ConfigPath, currentConfig) a raw error is returned to the caller; wrap that error with local context so callers know this was a failure writing runtime-defaults. Update the return to wrap the error using fmt.Errorf("persisting repo defaults to %s: %w", plan.ConfigPath, err) (or similar) where s.writeConfig is called, referencing s.writeConfig, plan.ConfigPath and currentConfig so the failure message includes the config path and context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/cli/setup.go`:
- Around line 413-415: When persisting repo defaults using s.writeConfig(ctx,
plan.ConfigPath, currentConfig) a raw error is returned to the caller; wrap that
error with local context so callers know this was a failure writing
runtime-defaults. Update the return to wrap the error using
fmt.Errorf("persisting repo defaults to %s: %w", plan.ConfigPath, err) (or
similar) where s.writeConfig is called, referencing s.writeConfig,
plan.ConfigPath and currentConfig so the failure message includes the config
path and context.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 022a95fe-70f8-444b-9646-cb58e90d0912
📒 Files selected for processing (7)
internal/cli/setup.gointernal/cli/setup_test.gointernal/core/agent/registry_specs.gointernal/core/model/runtime_config.gointernal/core/workspace/config.gointernal/core/workspace/config_test.gointernal/core/workspace/config_types.go
✅ Files skipped from review due to trivial changes (3)
- internal/core/workspace/config_test.go
- internal/cli/setup_test.go
- internal/core/workspace/config_types.go
🚧 Files skipped from review as they are similar to previous changes (2)
- internal/core/model/runtime_config.go
- internal/core/workspace/config.go
3fa10b0 to
8341c23
Compare
pedronauck
left a comment
There was a problem hiding this comment.
Thanks for the PR. I like the direction here: integrating repo-level runtime defaults into compozy setup closes a real usability gap, and I confirmed the branch passes make verify locally on commit 8341c23.
I do not think this is ready to merge yet, because the new flow conflicts with existing workspace/setup semantics in a few important ways:
-
Project-scope setup and workspace config can target different directories.
resolveRuntimeDefaultsPlan()/runtimeDefaultsPath()ininternal/cli/setup.gonow resolve.compozy/config.tomlthrough workspace discovery, but project-scope skill installation ininternal/setup/install.gostill resolves paths relative to the current working directory. Ifcompozy setupis run from a nested directory, this PR can write config in the workspace root while installing skills under the nested directory's.agents/skills, creating split state across two locations. -
The runtime-defaults prompt ignores the agents selected in the same setup run.
The install plan already knowsselectedAgents, but the defaults step still falls back to Codex when there is no existing config. That means a user can install only Claude or Cursor, accept the suggested defaults, and still end up withdefaults.ide = "codex". Because workspace defaults are later applied directly to command state ininternal/cli/workspace_config.go, and bundled-skill preflight validates the selected IDE ininternal/cli/skills_preflight.go, the nextstart/fix-reviewsinvocation can fail with missing Codex skills immediately after setup. -
The "optional" defaults step is not actually optional when config parsing fails.
Before the user answers the opt-in prompt,runtimeDefaultsPath()resolves the workspace, andworkspace.Resolve()already loads/parses.compozy/config.toml. A malformed or unreadable config now aborts interactivecompozy setupeven if the user would chooseNoand skip repo defaults entirely. That looks like a regression in the current setup flow.
Recommendation: I would address these before merging. The feature itself is useful and not duplicative, but the current implementation introduces scope inconsistencies and post-setup failure modes.
8341c23 to
6251f58
Compare
6251f58 to
de37eca
Compare
pedronauck
left a comment
There was a problem hiding this comment.
@camopy there are some conflicts to solve here
de37eca to
95b1487
Compare
|
| Filename | Overview |
|---|---|
| internal/cli/setup.go | Core feature addition: interactive repo-level defaults step with IDE/model/reasoning selection, opt-in prompt, and conditional persistence after successful install. Well-structured with injected dependencies for all I/O operations. |
| internal/core/workspace/config.go | Adds WriteConfig and LoadConfigFile public functions. Minor style inconsistency: cfg.Validate() error is returned bare while all other errors in the function are wrapped. |
| internal/core/workspace/config_types.go | Adds omitempty to top-level ProjectConfig fields and RuntimeOverrides pointer fields, preventing empty TOML sections from appearing in WriteConfig output. |
| internal/cli/setup_test.go | Comprehensive new test coverage: context propagation, config preservation, global-mode skipping, failure-skipping, and existing-defaults detection — all wired through the real resolveRuntimeDefaultsPlan rather than re-implementing its logic. |
| internal/core/agent/registry_specs.go | Adds DefaultModel(ide string) string lookup that returns the registry-backed default model for a given IDE, falling back to empty string on unknown IDE. |
| internal/cli/skills_preflight.go | Adds preflightResolverOptions helper that merges stored ResolverOptions with the live workspace root, ensuring CWD is always propagated to bundled-skill verify/refresh calls. |
| internal/core/model/runtime_config.go | Extracts DefaultReasoningEffort = "medium" constant and uses it in ApplyDefaults, eliminating the hardcoded literal that setup now also references. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([compozy setup]) --> B[resolverOptions\nresolveWorkspace once]
B --> C[loadCatalog]
C --> D[buildInstallPlan]
D --> E{--yes or\n--global?}
E -- Yes --> F[runtimePlan.Enabled = false]
E -- No --> G[promptRuntimeDefaultsOptIn]
G -- declined --> F
G -- accepted --> H[loadConfigFile\nget current defaults]
H --> I[editRuntimeDefaultsSelection\nIDE to Model to ReasoningEffort]
I --> J[runtimePlan.Enabled = true]
F --> K[confirmPlan\nprint preview]
J --> K
K --> L[executeInstall\nskills + agents]
L --> M{failures > 0?}
M -- Yes --> N([return error\nskip config write])
M -- No --> O[persistRuntimeDefaults\nreload then merge then WriteConfig]
O --> P([done])
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A([compozy setup]) --> B[resolverOptions\nresolveWorkspace once]
B --> C[loadCatalog]
C --> D[buildInstallPlan]
D --> E{--yes or\n--global?}
E -- Yes --> F[runtimePlan.Enabled = false]
E -- No --> G[promptRuntimeDefaultsOptIn]
G -- declined --> F
G -- accepted --> H[loadConfigFile\nget current defaults]
H --> I[editRuntimeDefaultsSelection\nIDE to Model to ReasoningEffort]
I --> J[runtimePlan.Enabled = true]
F --> K[confirmPlan\nprint preview]
J --> K
K --> L[executeInstall\nskills + agents]
L --> M{failures > 0?}
M -- Yes --> N([return error\nskip config write])
M -- No --> O[persistRuntimeDefaults\nreload then merge then WriteConfig]
O --> P([done])
Reviews (3): Last reviewed commit: "feat: simplify repo-level default setup ..." | Re-trigger Greptile
95b1487 to
e259f24
Compare
e259f24 to
082bcad
Compare
Add human-written release notes for the next release covering the work merged since v0.2.10: - feat: dependency-aware parallel task execution (--parallel-tasks) (#212) - feat: agentic recovery for failed runs (--recovery) (#212) - feat: COMPOZY_HOME for isolated per-project daemons (#216) - feat: repo-level default overrides in compozy setup (#90) - fix: safer worktree management for parallel runs (#217, #223) - fix: ACP runs consistently apply the selected model (#215) - fix: run TUI elapsed timer restored across all terminal outcomes (#221) Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
Add an optional repo-level config step to
compozy setupso interactive setup can override built-in runtime defaults and save those overrides to.compozy/config.toml.Why
Compozy already works without a repo config file because it has built-in defaults. This change makes repo-level overrides easier to set.
The README already documents workspace config and shows recommended
[defaults]values, but setup previously stopped at skill installation. This change closes that gap by letting users change and save repo-specific defaults from the setup flow instead of editing TOML manually.What Changed
compozy setupNocompozy setup --globalConfig Written
When the user opts in, setup updates:
Behavior Notes
.compozy/config.tomlTesting
Verification
Passed locally.
Closes #89
Summary by CodeRabbit
New Features
Tests