MCPcopy Create free account
hub / github.com/coder/agentapi / SimulateChunks

Method SimulateChunks

x/acpio/acp_conversation_test.go:151–160  ·  view source on GitHub ↗

SimulateChunks simulates the agent sending streaming chunks. This triggers the onChunk callback as if the agent was responding.

(chunks ...string)

Source from the content-addressed store, hash-verified

149// SimulateChunks simulates the agent sending streaming chunks.
150// This triggers the onChunk callback as if the agent was responding.
151func (m *mockAgentIO) SimulateChunks(chunks ...string) {
152 m.mu.Lock()
153 fn := m.onChunkFn
154 m.mu.Unlock()
155 for _, chunk := range chunks {
156 if fn != nil {
157 fn(chunk)
158 }
159 }
160}
161
162// GetWritten returns all data written to the agent.
163func (m *mockAgentIO) GetWritten() []byte {

Calls

no outgoing calls

Tested by

no test coverage detected