ACPConversation tracks conversations with ACP-based agents. Unlike PTY-based Conversation, ACP has blocking writes where the response is complete when Write() returns.
| 27 | // Unlike PTY-based Conversation, ACP has blocking writes where the |
| 28 | // response is complete when Write() returns. |
| 29 | type ACPConversation struct { |
| 30 | mu sync.Mutex |
| 31 | ctx context.Context |
| 32 | cancel context.CancelFunc |
| 33 | agentIO ChunkableAgentIO |
| 34 | messages []st.ConversationMessage |
| 35 | nextID int // monotonically increasing message ID |
| 36 | prompting bool // true while agent is processing |
| 37 | chunkReceived chan struct{} // signals that handleChunk has accumulated a chunk |
| 38 | streamingResponse strings.Builder |
| 39 | logger *slog.Logger |
| 40 | emitter st.Emitter |
| 41 | initialPrompt []st.MessagePart |
| 42 | clock quartz.Clock |
| 43 | } |
| 44 | |
| 45 | // noopEmitter is a no-op implementation of Emitter for when no emitter is provided. |
| 46 | type noopEmitter struct{} |
nothing calls this directly
no outgoing calls
no test coverage detected