MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / IdempotencyGuardForTest

Method IdempotencyGuardForTest

internal/agent/export_test.go:37–39  ·  view source on GitHub ↗

IdempotencyGuardForTest exposes API.idempotencyGuard so tests in the external agent_test package can verify the side-effect-committed caching policy end-to-end (the standard handlers don't have a natural way to reach the "5xx after side effect" branch in a unit test).

(w http.ResponseWriter, r *http.Request, userID string, bodyBytes []byte)

Source from the content-addressed store, hash-verified

35// natural way to reach the "5xx after side effect" branch in a unit
36// test).
37func (a *API) IdempotencyGuardForTest(w http.ResponseWriter, r *http.Request, userID string, bodyBytes []byte) (replayed bool, out http.ResponseWriter, finalize func()) {
38 return a.idempotencyGuard(w, r, userID, bodyBytes)
39}
40
41// MarkSideEffectCommittedForTest exposes markSideEffectCommitted so
42// the external test harness can flip the cache-on-error flag from

Calls 1

idempotencyGuardMethod · 0.95

Tested by

no test coverage detected