refactor(agent): remove unused prompt refresh callback
- commit
- 8bfedf7979e06d8e52382aba51b4b6f77b4977c8
- author
- brice · · 2026-10-06 08:06 UTC
- parent
- f27a376
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +4 -29
M docs/zutfiles.md +1 -1
| @@ -115,7 +115,7 @@ Set `replace_system_prompt` to `true` in the manifest to use `AGENT.md` as the r | |||
| 115 | 115 | } | |
| 116 | 116 | ``` | |
| 117 | 117 | ||
| 118 | - | Replacement is intended for fully specialized agents. It replaces zut's built-in identity, while global append addenda such as project context and skills retain their normal inclusion rules. The default layering behavior is usually preferable because it retains zut's normal identity and tool-use guidance. | |
| 118 | + | Replacement is intended for fully specialized agents. It replaces zut's built-in identity, while shared harness guidance and global append addenda such as project context and skills retain their normal inclusion rules. The default layering behavior is usually preferable because it retains zut's normal identity and tool-use guidance. | |
| 119 | 119 | ||
| 120 | 120 | ## Bundled skills | |
| 121 | 121 | ||
| @@ -115,7 +115,7 @@ Set `replace_system_prompt` to `true` in the manifest to use `AGENT.md` as the r | |||||
| 115 | } | 115 | } | ||
| 116 | ``` | 116 | ``` | ||
| 117 | 117 | ||||
| 118 | - | Replacement is intended for fully specialized agents. It replaces zut's built-in identity, while global append addenda such as project context and skills retain their normal inclusion rules. The default layering behavior is usually preferable because it retains zut's normal identity and tool-use guidance. | 118 | + | Replacement is intended for fully specialized agents. It replaces zut's built-in identity, while shared harness guidance and global append addenda such as project context and skills retain their normal inclusion rules. The default layering behavior is usually preferable because it retains zut's normal identity and tool-use guidance. |
| 119 | 119 | ||||
| 120 | ## Bundled skills | 120 | ## Bundled skills | ||
| 121 | 121 | ||||
M packages/agent/cli.go +1 -10
| @@ -2808,16 +2808,7 @@ func runInteractive(ctx context.Context, args Args, version string) (runErr erro | |||
| 2808 | 2808 | setWebSearchAvailable(webSearchPolicy == subagents.WebSearchAllow) | |
| 2809 | 2809 | return nil | |
| 2810 | 2810 | }, | |
| 2811 | - | SetWebSearchAvailable: setWebSearchAvailable, | |
| 2812 | - | RefreshPrompt: func() error { | |
| 2813 | - | current := liveInteractiveAgent(iv, ag) | |
| 2814 | - | webSearchPolicy, err := refreshAgentToolsAndPrompt(args, sharedSandbox, extToolAdapter, current, prepareInteractiveRegistryWithScheduler, iv) | |
| 2815 | - | if err != nil { | |
| 2816 | - | return err | |
| 2817 | - | } | |
| 2818 | - | setWebSearchAvailable(webSearchPolicy == subagents.WebSearchAllow) | |
| 2819 | - | return nil | |
| 2820 | - | }, | |
| 2811 | + | SetWebSearchAvailable: setWebSearchAvailable, | |
| 2821 | 2812 | AuthManager: mgr, | |
| 2822 | 2813 | LlamaCPPConfig: ResolveLlamaCPPConfig, | |
| 2823 | 2814 | RefreshLlamaCPPModels: RefreshLlamaCPPModels, | |
| @@ -2808,16 +2808,7 @@ func runInteractive(ctx context.Context, args Args, version string) (runErr erro | |||||
| 2808 | setWebSearchAvailable(webSearchPolicy == subagents.WebSearchAllow) | 2808 | setWebSearchAvailable(webSearchPolicy == subagents.WebSearchAllow) | ||
| 2809 | return nil | 2809 | return nil | ||
| 2810 | }, | 2810 | }, | ||
| 2811 | - | SetWebSearchAvailable: setWebSearchAvailable, | 2811 | + | SetWebSearchAvailable: setWebSearchAvailable, |
| 2812 | - | RefreshPrompt: func() error { | |||
| 2813 | - | current := liveInteractiveAgent(iv, ag) | |||
| 2814 | - | webSearchPolicy, err := refreshAgentToolsAndPrompt(args, sharedSandbox, extToolAdapter, current, prepareInteractiveRegistryWithScheduler, iv) | |||
| 2815 | - | if err != nil { | |||
| 2816 | - | return err | |||
| 2817 | - | } | |||
| 2818 | - | setWebSearchAvailable(webSearchPolicy == subagents.WebSearchAllow) | |||
| 2819 | - | return nil | |||
| 2820 | - | }, | |||
| 2821 | AuthManager: mgr, | 2812 | AuthManager: mgr, | ||
| 2822 | LlamaCPPConfig: ResolveLlamaCPPConfig, | 2813 | LlamaCPPConfig: ResolveLlamaCPPConfig, | ||
| 2823 | RefreshLlamaCPPModels: RefreshLlamaCPPModels, | 2814 | RefreshLlamaCPPModels: RefreshLlamaCPPModels, | ||
M packages/agent/modes/interactive.go +0 -4
| @@ -228,10 +228,6 @@ type InteractiveConfig struct { | |||
| 228 | 228 | // web-search guard and resident child policy. | |
| 229 | 229 | SetWebSearchAvailable func(bool) | |
| 230 | 230 | ||
| 231 | - | // RefreshPrompt re-resolves the complete live prompt and tool registry | |
| 232 | - | // after a prompt-affecting setting changes. Optional for embedders. | |
| 233 | - | RefreshPrompt func() error | |
| 234 | - | ||
| 235 | 231 | // AutoSubmitInitial, when true, auto-submits InitialInput after | |
| 236 | 232 | // StartupPre completes (or immediately when StartupPre is empty). | |
| 237 | 233 | // When false, InitialInput only pre-fills the editor. | |
| @@ -228,10 +228,6 @@ type InteractiveConfig struct { | |||||
| 228 | // web-search guard and resident child policy. | 228 | // web-search guard and resident child policy. | ||
| 229 | SetWebSearchAvailable func(bool) | 229 | SetWebSearchAvailable func(bool) | ||
| 230 | 230 | ||||
| 231 | - | // RefreshPrompt re-resolves the complete live prompt and tool registry | |||
| 232 | - | // after a prompt-affecting setting changes. Optional for embedders. | |||
| 233 | - | RefreshPrompt func() error | |||
| 234 | - | ||||
| 235 | // AutoSubmitInitial, when true, auto-submits InitialInput after | 231 | // AutoSubmitInitial, when true, auto-submits InitialInput after | ||
| 236 | // StartupPre completes (or immediately when StartupPre is empty). | 232 | // StartupPre completes (or immediately when StartupPre is empty). | ||
| 237 | // When false, InitialInput only pre-fills the editor. | 233 | // When false, InitialInput only pre-fills the editor. | ||
M packages/agent/systemprompt_test.go +2 -14
| @@ -6,20 +6,6 @@ import ( | |||
| 6 | 6 | "time" | |
| 7 | 7 | ) | |
| 8 | 8 | ||
| 9 | - | func TestBuildSystemPromptAlwaysIncludesVerificationGuidance(t *testing.T) { | |
| 10 | - | for _, custom := range []string{"", "Custom identity"} { | |
| 11 | - | prompt := BuildSystemPrompt(SystemPromptOpts{Custom: custom, Append: []string{"Project context"}}) | |
| 12 | - | for _, want := range []string{ | |
| 13 | - | "Verify changes with checks appropriate to their scope.", | |
| 14 | - | "Report which checks ran and what remains unverified.", | |
| 15 | - | } { | |
| 16 | - | if count := strings.Count(prompt, want); count != 1 { | |
| 17 | - | t.Fatalf("verification guidance %q count = %d, want 1", want, count) | |
| 18 | - | } | |
| 19 | - | } | |
| 20 | - | } | |
| 21 | - | } | |
| 22 | - | ||
| 23 | 9 | func TestBuildSystemPromptAlwaysPrefersDedicatedTools(t *testing.T) { | |
| 24 | 10 | for _, custom := range []string{"", "Custom identity"} { | |
| 25 | 11 | prompt := BuildSystemPrompt(SystemPromptOpts{Custom: custom}) | |
| @@ -127,6 +113,8 @@ func TestBuildSystemPromptAlwaysIncludesTaskAndSkillGuidance(t *testing.T) { | |||
| 127 | 113 | "Final answers contain the result of the work or a concrete blocker", | |
| 128 | 114 | "Respect requests for explanation, planning, or review without making unsolicited changes", | |
| 129 | 115 | "Ask only when a necessary decision blocks safe, correct progress", | |
| 116 | + | "Verify changes with checks appropriate to their scope.", | |
| 117 | + | "Report which checks ran and what remains unverified.", | |
| 130 | 118 | "Preserve tool permissions, required confirmations, and explicit approval requirements", | |
| 131 | 119 | "Explicit user instructions take precedence over skill guidelines", | |
| 132 | 120 | "Skills do not grant permissions or override system or developer constraints", | |
| @@ -6,20 +6,6 @@ import ( | |||||
| 6 | "time" | 6 | "time" | ||
| 7 | ) | 7 | ) | ||
| 8 | 8 | ||||
| 9 | - | func TestBuildSystemPromptAlwaysIncludesVerificationGuidance(t *testing.T) { | |||
| 10 | - | for _, custom := range []string{"", "Custom identity"} { | |||
| 11 | - | prompt := BuildSystemPrompt(SystemPromptOpts{Custom: custom, Append: []string{"Project context"}}) | |||
| 12 | - | for _, want := range []string{ | |||
| 13 | - | "Verify changes with checks appropriate to their scope.", | |||
| 14 | - | "Report which checks ran and what remains unverified.", | |||
| 15 | - | } { | |||
| 16 | - | if count := strings.Count(prompt, want); count != 1 { | |||
| 17 | - | t.Fatalf("verification guidance %q count = %d, want 1", want, count) | |||
| 18 | - | } | |||
| 19 | - | } | |||
| 20 | - | } | |||
| 21 | - | } | |||
| 22 | - | ||||
| 23 | func TestBuildSystemPromptAlwaysPrefersDedicatedTools(t *testing.T) { | 9 | func TestBuildSystemPromptAlwaysPrefersDedicatedTools(t *testing.T) { | ||
| 24 | for _, custom := range []string{"", "Custom identity"} { | 10 | for _, custom := range []string{"", "Custom identity"} { | ||
| 25 | prompt := BuildSystemPrompt(SystemPromptOpts{Custom: custom}) | 11 | prompt := BuildSystemPrompt(SystemPromptOpts{Custom: custom}) | ||
| @@ -127,6 +113,8 @@ func TestBuildSystemPromptAlwaysIncludesTaskAndSkillGuidance(t *testing.T) { | |||||
| 127 | "Final answers contain the result of the work or a concrete blocker", | 113 | "Final answers contain the result of the work or a concrete blocker", | ||
| 128 | "Respect requests for explanation, planning, or review without making unsolicited changes", | 114 | "Respect requests for explanation, planning, or review without making unsolicited changes", | ||
| 129 | "Ask only when a necessary decision blocks safe, correct progress", | 115 | "Ask only when a necessary decision blocks safe, correct progress", | ||
| 116 | + | "Verify changes with checks appropriate to their scope.", | |||
| 117 | + | "Report which checks ran and what remains unverified.", | |||
| 130 | "Preserve tool permissions, required confirmations, and explicit approval requirements", | 118 | "Preserve tool permissions, required confirmations, and explicit approval requirements", | ||
| 131 | "Explicit user instructions take precedence over skill guidelines", | 119 | "Explicit user instructions take precedence over skill guidelines", | ||
| 132 | "Skills do not grant permissions or override system or developer constraints", | 120 | "Skills do not grant permissions or override system or developer constraints", | ||