MCPcopy Index your code
hub / github.com/docker/docker-agent / applyUserSettings

Method applyUserSettings

cmd/root/run.go:529–548  ·  view source on GitHub ↗

loadTeamInWorktree creates the requested worktree (if any) and then loads the team with the worktree as its working directory. The ordering matters: toolsets capture runConfig.WorkingDir when they are constructed during LoadTeam, so the worktree must be settled first for every tool — the shell inclu

(ctx context.Context, userSettings *userconfig.Settings)

Source from the content-addressed store, hash-verified

527// --worktree nor --worktree-pr was given) and the working directory to run in
528// (the worktree's directory when one was created, otherwise wd unchanged).
529func (f *runExecFlags) applyUserSettings(ctx context.Context, userSettings *userconfig.Settings) {
530 if userSettings.HideToolResults && !f.hideToolResults {
531 f.hideToolResults = true
532 slog.DebugContext(ctx, "Applying user settings", "hide_tool_results", true)
533 }
534 if userSettings.YOLO && !f.autoApprove {
535 f.autoApprove = true
536 slog.DebugContext(ctx, "Applying user settings", "YOLO", true)
537 }
538 // The tour needs the full TUI's overlay support, so a lean default from
539 // user config is not applied when the tour was requested.
540 if userSettings.Lean && !f.leanChanged && !f.lean && !f.tour {
541 f.lean = true
542 slog.DebugContext(ctx, "Applying user settings", "lean", true)
543 }
544 if userSettings.SnapshotsEnabled() {
545 f.snapshotsEnabled = true
546 slog.DebugContext(ctx, "Applying user settings", "snapshot", true)
547 }
548}
549
550func (f *runExecFlags) loadTeamInWorktree(ctx context.Context, b backend, wd string) (*teamloader.LoadResult, *worktree.Worktree, string, error) {
551 createdWorktree, err := f.setupWorktree(ctx, wd)

Callers 2

runOrExecMethod · 0.95

Calls 1

SnapshotsEnabledMethod · 0.45

Tested by 1