From a681b8239323136010fdeffa2676dede820cc589 Mon Sep 17 00:00:00 2001 From: Daniil Gusev Date: Fri, 20 Nov 2026 13:41:20 +0100 Subject: [PATCH 1/2] test(api): expect the call's tokens in a redacted tool result Redaction keeps what a tool call cost in tokens, because tool usage counts it. The two retention tests still expected only the call ID and the redacted mark. --- acceleration/internal/api/tool_output_retention_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acceleration/internal/api/tool_output_retention_test.go b/acceleration/internal/api/tool_output_retention_test.go index adab5efae..1026074c8 100644 --- a/acceleration/internal/api/tool_output_retention_test.go +++ b/acceleration/internal/api/tool_output_retention_test.go @@ -33,7 +33,7 @@ func (s *ToolOutputRetentionSuite) TestAnAppPolicyOfNoneRecordsNoneOfAToolsOutpu result := s.ranTheTool(config.Id, map[string]any{"output": "it ships tomorrow"}) s.Empty(value(result.Text)) - s.Equal(map[string]any{"call_id": result.callID, "redacted": true}, value(result.Payload)) + s.Equal(map[string]any{"call_id": result.callID, "redacted": true, "tokens": float64(12)}, value(result.Payload)) } func (s *ToolOutputRetentionSuite) TestAGroupThatKeepsNoneRecordsNoneOfItsToolsOutput() { @@ -43,7 +43,7 @@ func (s *ToolOutputRetentionSuite) TestAGroupThatKeepsNoneRecordsNoneOfItsToolsO result := s.ranTheTool(config.Id, map[string]any{"output": "it ships tomorrow"}) s.Empty(value(result.Text)) - s.Equal(map[string]any{"call_id": result.callID, "redacted": true}, value(result.Payload)) + s.Equal(map[string]any{"call_id": result.callID, "redacted": true, "tokens": float64(12)}, value(result.Payload)) } func (s *ToolOutputRetentionSuite) TestASessionDeclaringAToolNoGroupNamesIsRefused() { From c57373cb021478c438d489584953cb1efacd5d63 Mon Sep 17 00:00:00 2001 From: Daniil Gusev Date: Fri, 20 Nov 2026 13:41:20 +0100 Subject: [PATCH 2/2] test(api): match the connector delete as bun writes it The store now deletes a connector's OAuth clients with a bun builder, which quotes the table name. The test looked for the statement without quotes in the waiting queries, so it never found the delete. --- acceleration/internal/api/connectors_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceleration/internal/api/connectors_test.go b/acceleration/internal/api/connectors_test.go index f95ea8b44..1d7cb4f02 100644 --- a/acceleration/internal/api/connectors_test.go +++ b/acceleration/internal/api/connectors_test.go @@ -717,7 +717,7 @@ func (s *ConnectorsSuite) duringADeleteOf(id string, call func() (int, string)) deleted := make(chan int, 1) go func() { deleted <- s.serverClient.do(http.MethodDelete, "/v1/agents/connectors/"+id, nil, nil) }() // The two seconds and the ten milliseconds are assertTheWaitEnded's (internal/store/credentials_test.go). - s.Require().Eventually(func() bool { return s.waitingFor("DELETE FROM connector_oauth_clients", id) == 1 }, + s.Require().Eventually(func() bool { return s.waitingFor(`DELETE FROM "connector_oauth_clients"`, id) == 1 }, 2*time.Second, 10*time.Millisecond, "the delete waits at its DELETE") type answer struct { status int