Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/entire/cli/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/entireio/cli/cmd/entire/cli/agent"
"github.com/entireio/cli/cmd/entire/cli/paths"
"github.com/entireio/cli/cmd/entire/cli/session"
settings_pkg "github.com/entireio/cli/cmd/entire/cli/settings"
"github.com/entireio/cli/cmd/entire/cli/strategy"

"github.com/charmbracelet/huh"
Expand Down Expand Up @@ -610,6 +611,17 @@ func setupAgentHooksNonInteractive(w io.Writer, ag agent.Agent, strategyName str
return fmt.Errorf("failed to save settings: %w", err)
}

// Clear stale enabled:false in settings.local.json left by a prior "entire disable"
localPath, pathErr := paths.AbsPath(EntireSettingsLocalFile)
if pathErr == nil {
if ls, err := settings_pkg.LoadFromFile(localPath); err == nil && !ls.Enabled {
ls.Enabled = true
if err := SaveEntireSettingsLocal(ls); err != nil {
return fmt.Errorf("failed to clear stale local settings: %w", err)
}
}
}
Comment on lines +614 to +623
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

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

This bug fix lacks test coverage. Consider adding a test that reproduces the original bug scenario: enable with --agent, disable, then enable again with --agent, and verify that the status shows "Enabled". The existing TestEnableDisable integration test uses --strategy which already handled this correctly via determineSettingsTarget, so it wouldn't catch this specific bug in the --agent code path.

Copilot uses AI. Check for mistakes.

// Install git hooks AFTER saving settings (InstallGitHook reads local_dev from settings)
if _, err := strategy.InstallGitHook(true); err != nil {
return fmt.Errorf("failed to install git hooks: %w", err)
Expand Down