MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / TestSendPropagatesProviderError

Function TestSendPropagatesProviderError

internal/agent/agent_test.go:142–151  ·  view source on GitHub ↗

TestSendPropagatesProviderError makes sure a provider failure bubbles out of Send instead of being swallowed. The error itself should be the exact sentinel — no wrapping at this layer.

(t *testing.T)

Source from the content-addressed store, hash-verified

140// out of Send instead of being swallowed. The error itself should be the
141// exact sentinel — no wrapping at this layer.
142func TestSendPropagatesProviderError(t *testing.T) {
143 sentinel := errors.New("provider exploded")
144 p := &provider.MockProvider{Err: sentinel}
145 a := newTestAgent(p)
146
147 _, err := a.Send(context.Background(), "hi")
148 if !errors.Is(err, sentinel) {
149 t.Errorf("err = %v, want %v", err, sentinel)
150 }
151}
152
153// hasToolResult scans messages for a tool_result block matching id.
154func hasToolResult(messages []api.Message, id string) bool {

Callers

nothing calls this directly

Calls 2

newTestAgentFunction · 0.85
SendMethod · 0.65

Tested by

no test coverage detected