Skip to content

Commit 401fbea

Browse files
authored
Merge pull request #1384 from dgageot/empty-line-transfer
Add some space before transfer task call
2 parents ec37024 + e4b9f68 commit 401fbea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/tui/components/messages/messages.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/docker/cagent/pkg/runtime"
1616
"github.com/docker/cagent/pkg/session"
1717
"github.com/docker/cagent/pkg/tools"
18+
"github.com/docker/cagent/pkg/tools/builtin"
1819
"github.com/docker/cagent/pkg/tui/components/message"
1920
"github.com/docker/cagent/pkg/tui/components/scrollbar"
2021
"github.com/docker/cagent/pkg/tui/components/tool"
@@ -676,6 +677,12 @@ func (m *model) needsSeparator(index int) bool {
676677
}
677678
currentIsToolCall := m.messages[index].Type == types.MessageTypeToolCall
678679
nextIsToolCall := m.messages[index+1].Type == types.MessageTypeToolCall
680+
681+
// Always add a separator before transfer_task, even between consecutive tool calls
682+
if nextIsToolCall && m.messages[index+1].ToolCall.Function.Name == builtin.ToolNameTransferTask {
683+
return true
684+
}
685+
679686
return !currentIsToolCall || !nextIsToolCall
680687
}
681688

0 commit comments

Comments
 (0)