fix(agent): keep Ponytail guidance independent
- commit
- f73cf18835dbb9b46700cc9627125bc6d1f1fe98
- author
- brice · · 2026-08-07 07:47 UTC
- committer
- brice · · 2026-08-07 07:48 UTC
- parent
- 6d13ad6
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +4 -6
M packages/agent/modes/interactive.go +3 -0
| @@ -6937,6 +6937,9 @@ func (i *Interactive) restoreCurrentCompactHandoff() compactContinuationState { | |||
| 6937 | 6937 | return state | |
| 6938 | 6938 | } | |
| 6939 | 6939 | ||
| 6940 | + | // autoCompactContinuationPrompt is an interactive-only compact-handoff | |
| 6941 | + | // instruction. Its completion criteria must stay separate from Ponytail so | |
| 6942 | + | // toggling the optional coding-style addendum never changes recovery behavior. | |
| 6940 | 6943 | const autoCompactContinuationPrompt = `Context was compacted while work was in progress. Continue the user's most recent active request now; do not wait for them to type "continue". Inspect the context summary and kept recent messages, treating active constraints and preferences there as still in force, including delegation/subagent instructions. If a newer request supersedes earlier plans in the summary, follow the newer request. A progress report, plan update, or statement of future work is not completion: if required work remains, take the next concrete action now. Only finish when the request is actually complete or when a specific user decision is required. If nothing remains, give a brief truthful completion; do not invent work or force a tool call.` | |
| 6941 | 6944 | ||
| 6942 | 6945 | type compactHandoffResume uint8 | |
| @@ -6937,6 +6937,9 @@ func (i *Interactive) restoreCurrentCompactHandoff() compactContinuationState { | |||||
| 6937 | return state | 6937 | return state | ||
| 6938 | } | 6938 | } | ||
| 6939 | 6939 | ||||
| 6940 | + | // autoCompactContinuationPrompt is an interactive-only compact-handoff | |||
| 6941 | + | // instruction. Its completion criteria must stay separate from Ponytail so | |||
| 6942 | + | // toggling the optional coding-style addendum never changes recovery behavior. | |||
| 6940 | const autoCompactContinuationPrompt = `Context was compacted while work was in progress. Continue the user's most recent active request now; do not wait for them to type "continue". Inspect the context summary and kept recent messages, treating active constraints and preferences there as still in force, including delegation/subagent instructions. If a newer request supersedes earlier plans in the summary, follow the newer request. A progress report, plan update, or statement of future work is not completion: if required work remains, take the next concrete action now. Only finish when the request is actually complete or when a specific user decision is required. If nothing remains, give a brief truthful completion; do not invent work or force a tool call.` | 6943 | const autoCompactContinuationPrompt = `Context was compacted while work was in progress. Continue the user's most recent active request now; do not wait for them to type "continue". Inspect the context summary and kept recent messages, treating active constraints and preferences there as still in force, including delegation/subagent instructions. If a newer request supersedes earlier plans in the summary, follow the newer request. A progress report, plan update, or statement of future work is not completion: if required work remains, take the next concrete action now. Only finish when the request is actually complete or when a specific user decision is required. If nothing remains, give a brief truthful completion; do not invent work or force a tool call.` | ||
| 6941 | 6944 | ||||
| 6942 | type compactHandoffResume uint8 | 6945 | type compactHandoffResume uint8 | ||
M packages/agent/ponytail.md +0 -5
| @@ -11,9 +11,4 @@ When coding, debugging, reviewing, or changing software: | |||
| 11 | 11 | - Avoid speculative features, boilerplate, and unrelated refactors. | |
| 12 | 12 | - Before finishing non-trivial work, run the narrowest useful check and report what remains uncertain. | |
| 13 | 13 | ||
| 14 | - | For an active multi-step implementation task, a progress report, plan update, | |
| 15 | - | or statement of future work is not a completed response. Continue with the | |
| 16 | - | next concrete action now. End only after required work and validation are | |
| 17 | - | complete, or when blocked on a specific decision that requires the user. | |
| 18 | - | ||
| 19 | 14 | This is coding guidance, not a permission or security policy. Apply it to engineering work, not ordinary conversation or creative requests. | |
| @@ -11,9 +11,4 @@ When coding, debugging, reviewing, or changing software: | |||||
| 11 | - Avoid speculative features, boilerplate, and unrelated refactors. | 11 | - Avoid speculative features, boilerplate, and unrelated refactors. | ||
| 12 | - Before finishing non-trivial work, run the narrowest useful check and report what remains uncertain. | 12 | - Before finishing non-trivial work, run the narrowest useful check and report what remains uncertain. | ||
| 13 | 13 | ||||
| 14 | - | For an active multi-step implementation task, a progress report, plan update, | |||
| 15 | - | or statement of future work is not a completed response. Continue with the | |||
| 16 | - | next concrete action now. End only after required work and validation are | |||
| 17 | - | complete, or when blocked on a specific decision that requires the user. | |||
| 18 | - | ||||
| 19 | This is coding guidance, not a permission or security policy. Apply it to engineering work, not ordinary conversation or creative requests. | 14 | This is coding guidance, not a permission or security policy. Apply it to engineering work, not ordinary conversation or creative requests. | ||
M packages/agent/ponytail_test.go +1 -1
| @@ -34,7 +34,7 @@ func TestPonytailSystemAddendumIsCompact(t *testing.T) { | |||
| 34 | 34 | if len(addendum) > 2000 { | |
| 35 | 35 | t.Fatalf("Ponytail system addendum is %d bytes, want at most 2000", len(addendum)) | |
| 36 | 36 | } | |
| 37 | - | for _, want := range []string{"YAGNI", "standard library", "validation", "ordinary conversation", "active multi-step implementation task", "required work and validation", "specific decision that requires the user"} { | |
| 37 | + | for _, want := range []string{"YAGNI", "standard library", "validation", "ordinary conversation"} { | |
| 38 | 38 | if !strings.Contains(addendum, want) { | |
| 39 | 39 | t.Fatalf("Ponytail system addendum missing %q:\n%s", want, addendum) | |
| 40 | 40 | } | |
| @@ -34,7 +34,7 @@ func TestPonytailSystemAddendumIsCompact(t *testing.T) { | |||||
| 34 | if len(addendum) > 2000 { | 34 | if len(addendum) > 2000 { | ||
| 35 | t.Fatalf("Ponytail system addendum is %d bytes, want at most 2000", len(addendum)) | 35 | t.Fatalf("Ponytail system addendum is %d bytes, want at most 2000", len(addendum)) | ||
| 36 | } | 36 | } | ||
| 37 | - | for _, want := range []string{"YAGNI", "standard library", "validation", "ordinary conversation", "active multi-step implementation task", "required work and validation", "specific decision that requires the user"} { | 37 | + | for _, want := range []string{"YAGNI", "standard library", "validation", "ordinary conversation"} { |
| 38 | if !strings.Contains(addendum, want) { | 38 | if !strings.Contains(addendum, want) { | ||
| 39 | t.Fatalf("Ponytail system addendum missing %q:\n%s", want, addendum) | 39 | t.Fatalf("Ponytail system addendum missing %q:\n%s", want, addendum) | ||
| 40 | } | 40 | } | ||