66 "github.com/coder/agentapi/lib/msgfmt"
77)
88
9- func calcAmpDynamicHeader (lines []string ) (int , bool ) {
10- dynamicHeaderEnd := - 1
9+ func calcAmpAnimatedContent (lines []string ) (int , bool ) {
10+ animatedContentEnd := - 1
1111 firstTextEncountered := false
1212 continueRemoving := true
1313
@@ -22,16 +22,16 @@ func calcAmpDynamicHeader(lines []string) (int, bool) {
2222 }
2323 if firstTextEncountered && len (strings .Trim (lines [i ], " \n " )) == 0 && len (strings .Trim (lines [i + 1 ], " \n " )) == 0 &&
2424 len (strings .Trim (lines [i + 2 ], " \n " )) == 0 {
25- dynamicHeaderEnd = i
25+ animatedContentEnd = i
2626 break
2727
2828 }
2929 }
3030 }
31- return dynamicHeaderEnd , continueRemoving
31+ return animatedContentEnd , continueRemoving
3232}
3333
34- func calcOpencodeDynamicHeader (lines []string ) (int , bool ) {
34+ func calcOpencodeAnimatedContent (lines []string ) (int , bool ) {
3535 // Skip header lines for Opencode agent type to avoid false positives
3636 // The header contains dynamic content (token count, context percentage, cost)
3737 // that changes between screens, causing line comparison mismatches:
@@ -44,16 +44,16 @@ func calcOpencodeDynamicHeader(lines []string) (int, bool) {
4444 return - 1 , true
4545}
4646
47- func removeDynamicHeader (screen string , agentType msgfmt.AgentType ) (string , bool ) {
47+ func removeAnimatedContent (screen string , agentType msgfmt.AgentType ) (string , bool ) {
4848 lines := strings .Split (screen , "\n " )
49- dynamicHeaderEnd := - 1
49+ animatedContentEnd := - 1
5050 var continueRemoving bool
5151 if agentType == msgfmt .AgentTypeAmp {
52- dynamicHeaderEnd , continueRemoving = calcAmpDynamicHeader (lines )
52+ animatedContentEnd , continueRemoving = calcAmpAnimatedContent (lines )
5353 } else if agentType == msgfmt .AgentTypeOpencode {
54- dynamicHeaderEnd , continueRemoving = calcOpencodeDynamicHeader (lines )
54+ animatedContentEnd , continueRemoving = calcOpencodeAnimatedContent (lines )
5555 } else {
5656 continueRemoving = false
5757 }
58- return strings .Join (lines [dynamicHeaderEnd + 1 :], "\n " ), continueRemoving
58+ return strings .Join (lines [animatedContentEnd + 1 :], "\n " ), continueRemoving
5959}
0 commit comments