Skip to content

Commit c70bf83

Browse files
committed
wip
1 parent f1c653e commit c70bf83

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

lib/httpapi/server.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,16 +327,13 @@ func (s *Server) StartSnapshotLoop(ctx context.Context) {
327327
// Send initial prompt when agent becomes stable for the first time
328328
if !s.conversation.InitialPromptSent && convertStatus(currentStatus) == AgentStatusStable {
329329

330-
fmt.Printf("AgentType: %s\n", mf.AgentTypeOpencode)
331-
332330
// If agent type is opencode
333331
if s.agentType == mf.AgentTypeOpencode {
334332
time.Sleep(5 * time.Second)
335-
}
336-
337-
// If we still have it as stable, go ahead.
338-
if convertStatus(s.conversation.Status()) != AgentStatusStable {
339-
continue
333+
// If we still have it as stable, go ahead.
334+
if convertStatus(s.conversation.Status()) != AgentStatusStable {
335+
continue
336+
}
340337
}
341338

342339
if err := s.conversation.SendMessage(FormatMessage(s.agentType, s.conversation.InitialPrompt)...); err != nil {

lib/msgfmt/message_box.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func removeOpencodeMessageBox(msg string) string {
7373
for i := len(lines) - 1; i >= 2; i-- {
7474
if strings.ReplaceAll(lines[i-2], " ", "") != "┃┃" &&
7575
strings.ReplaceAll(lines[i], " ", "") == "┃┃" {
76-
//fmt.Printf("Magic at line: %d, %s\n", i, lines[i])
7776
lines = lines[:i-1]
7877
break
7978
}

lib/msgfmt/msgfmt.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ func RemoveUserInput(msgRaw string, userInputRaw string, agentType AgentType) st
196196
if idx, found := skipTrailingInputBoxLine(msgLines, lastUserInputLineIdx, "┘", "└"); found {
197197
lastUserInputLineIdx = idx
198198
}
199+
} else if agentType == AgentTypeOpencode {
200+
// skip +2 lines after the input
201+
// ┃ jkmr (08:46 PM) ┃
202+
// ┃ ┃
203+
if lastUserInputLineIdx+2 < len(msgLines) {
204+
lastUserInputLineIdx += 2
205+
}
199206
}
200207

201208
return strings.Join(msgLines[lastUserInputLineIdx+1:], "\n")

lib/screentracker/conversation.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,6 @@ func (c *Conversation) StartSnapshotLoop(ctx context.Context) {
143143
func FindNewMessage(oldScreen, newScreen string, agentType msgfmt.AgentType) string {
144144
oldLines := strings.Split(oldScreen, "\n")
145145
newLines := strings.Split(newScreen, "\n")
146-
147-
//fmt.Println("\n\n\n\n\n")
148-
//fmt.Println("===================================")
149-
//lines := newLines
150-
//if len(lines) > 10 {
151-
// for _, data := range lines[len(lines)-9:] {
152-
// fmt.Println(data)
153-
// }
154-
//}
155-
//fmt.Println("===================================")
156-
//fmt.Println("\n\n\n\n\n")
157-
158146
oldLinesMap := make(map[string]bool)
159147

160148
// -1 indicates no header

0 commit comments

Comments
 (0)