From 256025253956524b705ca1cbd6289e740d5bbe05 Mon Sep 17 00:00:00 2001 From: Sven Pfleiderer Date: Fri, 6 Mar 2026 16:10:43 -0800 Subject: [PATCH 1/3] Explicitly disable agent hooks when entire was disabled Entire-Checkpoint: 3abce9c62df3 --- cmd/entire/cli/hooks_git_cmd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/entire/cli/hooks_git_cmd.go b/cmd/entire/cli/hooks_git_cmd.go index 5cfe1b19b..6fff27182 100644 --- a/cmd/entire/cli/hooks_git_cmd.go +++ b/cmd/entire/cli/hooks_git_cmd.go @@ -89,15 +89,15 @@ func newHooksGitCmd() *cobra.Command { Long: "Commands called by git hooks. These delegate to the current strategy.", Hidden: true, // Internal command, not for direct user use PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - ctx := cmd.Context() // Check if Entire is set up and enabled before doing any work. // This prevents global git hooks from doing anything in repos where // Entire was never enabled or has been disabled. - if !settings.IsSetUpAndEnabled(ctx) { + if !settings.IsSetUpAndEnabledFast() { + gitHooksDisabled = true return nil } - hookLogCleanup = initHookLogging(ctx) + hookLogCleanup = initHookLogging(cmd.Context()) return nil }, PersistentPostRunE: func(_ *cobra.Command, _ []string) error { From 7887a539a79313d9042ee4f8f6db819e5c3ec90b Mon Sep 17 00:00:00 2001 From: Sven Pfleiderer Date: Fri, 6 Mar 2026 16:27:48 -0800 Subject: [PATCH 2/3] Undo IsSetupAndEnabledFast() Entire-Checkpoint: 8037f00020b4 --- cmd/entire/cli/hook_registry.go | 4 ++++ cmd/entire/cli/hooks_git_cmd.go | 6 +++--- cmd/entire/cli/strategy/common_test.go | 10 +++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmd/entire/cli/hook_registry.go b/cmd/entire/cli/hook_registry.go index 0ca44bdae..967475bcd 100644 --- a/cmd/entire/cli/hook_registry.go +++ b/cmd/entire/cli/hook_registry.go @@ -14,6 +14,7 @@ import ( "github.com/entireio/cli/cmd/entire/cli/agent/types" "github.com/entireio/cli/cmd/entire/cli/logging" "github.com/entireio/cli/cmd/entire/cli/paths" + "github.com/entireio/cli/cmd/entire/cli/settings" "github.com/entireio/cli/cmd/entire/cli/strategy" "github.com/entireio/cli/perf" @@ -53,6 +54,9 @@ func newAgentHooksCmd(agentName types.AgentName, handler agent.HookSupport) *cob Short: handler.Description() + " hook handlers", Hidden: true, PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + if !settings.IsSetUpAndEnabled(cmd.Context()) { + return nil + } agentHookLogCleanup = initHookLogging(cmd.Context()) return nil }, diff --git a/cmd/entire/cli/hooks_git_cmd.go b/cmd/entire/cli/hooks_git_cmd.go index 6fff27182..5cfe1b19b 100644 --- a/cmd/entire/cli/hooks_git_cmd.go +++ b/cmd/entire/cli/hooks_git_cmd.go @@ -89,15 +89,15 @@ func newHooksGitCmd() *cobra.Command { Long: "Commands called by git hooks. These delegate to the current strategy.", Hidden: true, // Internal command, not for direct user use PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() // Check if Entire is set up and enabled before doing any work. // This prevents global git hooks from doing anything in repos where // Entire was never enabled or has been disabled. - if !settings.IsSetUpAndEnabledFast() { - + if !settings.IsSetUpAndEnabled(ctx) { gitHooksDisabled = true return nil } - hookLogCleanup = initHookLogging(cmd.Context()) + hookLogCleanup = initHookLogging(ctx) return nil }, PersistentPostRunE: func(_ *cobra.Command, _ []string) error { diff --git a/cmd/entire/cli/strategy/common_test.go b/cmd/entire/cli/strategy/common_test.go index 96cff0db6..43f85c0e2 100644 --- a/cmd/entire/cli/strategy/common_test.go +++ b/cmd/entire/cli/strategy/common_test.go @@ -1432,8 +1432,8 @@ func TestReadLatestSessionPromptFromCommittedTree(t *testing.T) { // Session 1 (latest) has no prompt.txt, session 0 does. // This happens when a test session gets condensed alongside a real one. tree := buildCommittedTree(t, map[string]string{ - "a3/b2c4d5e6f7/0/prompt.txt": "Real session prompt", - "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"test"}`, + "a3/b2c4d5e6f7/0/prompt.txt": "Real session prompt", + "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"test"}`, }) got := ReadLatestSessionPromptFromCommittedTree(tree, cpID, 2) @@ -1446,9 +1446,9 @@ func TestReadLatestSessionPromptFromCommittedTree(t *testing.T) { t.Parallel() // Sessions 2 and 1 have no prompt, session 0 does. tree := buildCommittedTree(t, map[string]string{ - "a3/b2c4d5e6f7/0/prompt.txt": "Original prompt", - "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"s1"}`, - "a3/b2c4d5e6f7/2/metadata.json": `{"session_id":"s2"}`, + "a3/b2c4d5e6f7/0/prompt.txt": "Original prompt", + "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"s1"}`, + "a3/b2c4d5e6f7/2/metadata.json": `{"session_id":"s2"}`, }) got := ReadLatestSessionPromptFromCommittedTree(tree, cpID, 3) From 089f952a1a2e6df6abecff49ab189692b7186114 Mon Sep 17 00:00:00 2001 From: Sven Pfleiderer Date: Fri, 6 Mar 2026 17:33:22 -0800 Subject: [PATCH 3/3] Undo unrelated test changes --- cmd/entire/cli/strategy/common_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/entire/cli/strategy/common_test.go b/cmd/entire/cli/strategy/common_test.go index 43f85c0e2..96cff0db6 100644 --- a/cmd/entire/cli/strategy/common_test.go +++ b/cmd/entire/cli/strategy/common_test.go @@ -1432,8 +1432,8 @@ func TestReadLatestSessionPromptFromCommittedTree(t *testing.T) { // Session 1 (latest) has no prompt.txt, session 0 does. // This happens when a test session gets condensed alongside a real one. tree := buildCommittedTree(t, map[string]string{ - "a3/b2c4d5e6f7/0/prompt.txt": "Real session prompt", - "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"test"}`, + "a3/b2c4d5e6f7/0/prompt.txt": "Real session prompt", + "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"test"}`, }) got := ReadLatestSessionPromptFromCommittedTree(tree, cpID, 2) @@ -1446,9 +1446,9 @@ func TestReadLatestSessionPromptFromCommittedTree(t *testing.T) { t.Parallel() // Sessions 2 and 1 have no prompt, session 0 does. tree := buildCommittedTree(t, map[string]string{ - "a3/b2c4d5e6f7/0/prompt.txt": "Original prompt", - "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"s1"}`, - "a3/b2c4d5e6f7/2/metadata.json": `{"session_id":"s2"}`, + "a3/b2c4d5e6f7/0/prompt.txt": "Original prompt", + "a3/b2c4d5e6f7/1/metadata.json": `{"session_id":"s1"}`, + "a3/b2c4d5e6f7/2/metadata.json": `{"session_id":"s2"}`, }) got := ReadLatestSessionPromptFromCommittedTree(tree, cpID, 3)