fix: execution slug collision under back-to-back requests
Live testing hit `entities_slug_key` violations: exec slugs used an 8-char prefix of a UUIDv7, whose leading bytes encode a millisecond timestamp — two executions created seconds apart can share a prefix. Use the full UUID (guaranteed unique) for the exec entity's slug/name in request_execution, the new `run` tool, and the REST RequestExecution handler — all three had the same pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1103,7 +1103,10 @@ func (s *Server) RequestExecution(ctx context.Context, req gen.RequestExecutionR
|
||||
|
||||
q := sqlcgen.New(tx)
|
||||
|
||||
execSlug := "exec:" + id.String()[:8]
|
||||
// Full UUID, not a truncated prefix — an 8-char prefix of a UUIDv7
|
||||
// collides for real under back-to-back requests since the leading bytes
|
||||
// encode a millisecond timestamp (observed live via the MCP run tool).
|
||||
execSlug := "exec:" + id.String()
|
||||
if _, err := q.InsertEntity(ctx, sqlcgen.InsertEntityParams{
|
||||
ID: id,
|
||||
Slug: execSlug,
|
||||
|
||||
Reference in New Issue
Block a user