Skip to content

Bug: Autopilot tool approval still can cause duplicate approval errors #6006

@GabrielBianconi

Description

@GabrielBianconi
CleanShot.2026-01-30.at.11.59.34.mp4

In our API logs:

Database error: error returned from database: duplicate key value violates unique constraint "idx_unique_tool_call_authorization"
{"timestamp":"2026-01-30T17:02:20.099643Z","level":"ERROR","fields":{"message":"Database error: error returned from database: duplicate key value violates unique constraint \"idx_unique_tool_call_authorization\""},"target":"api::error","span":{"method":"POST","request_id":"019c0fdb-0dbb-7002-a082-bfd1b62b16cd","uri":"/v1/sessions/019c0fb4-5405-77b2-b6f9-b4601d723e79/events","version":"HTTP/1.1","x_amzn_trace_id":"Root=1-697ce41c-1cef672b047904c249d83341","name":"request"},"spans":[{"http.request.method":"POST","http.route":"/v1/sessions/{id}/events","network.protocol.version":"1.1","otel.kind":"Server","otel.name":"POST /v1/sessions/{id}/events","server.address":"api.autopilot.staging.tensorzero.com","span.type":"web","trace_id":"Root=1-697ce41c-1cef672b047904c249d83341","url.path":"/v1/sessions/019c0fb4-5405-77b2-b6f9-b4601d723e79/events","url.scheme":"","user_agent.original":"","name":"HTTP request"},{"method":"POST","request_id":"019c0fdb-0dbb-7002-a082-bfd1b62b16cd","uri":"/v1/sessions/019c0fb4-5405-77b2-b6f9-b4601d723e79/events","version":"HTTP/1.1","x_amzn_trace_id":"Root=1-697ce41c-1cef672b047904c249d83341","name":"request"}]}

Staging: http://localhost:5173/autopilot/sessions/019c0fb4-5405-77b2-b6f9-b4601d723e79

To reproduce, ask for e.g. 20 inferences and spam approvals. It doesn't always happen, but does happen every few dozen approvals.

Metadata

Metadata

Assignees

Labels

priority-highThe team is prioritizing this issue and will tackle it very soon.typescriptThis issue involves Typescript.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions