Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/handlers/env_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (h *EnvPolicyHandler) Put(c *fiber.Ctx) error {
"role": role,
"allowed_roles": []string{middleware.RoleOwner},
"agent_action": newAgentActionOwnerRequired(role),
"request_id": middleware.GetRequestID(c),
})
}

Expand Down
9 changes: 4 additions & 5 deletions internal/handlers/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ func (h *OnboardingHandler) ClaimPreview(c *fiber.Ctx) error {
if err != nil {
var notFound *models.ErrOnboardingNotFound
if errors.As(err, &notFound) {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
"ok": false,
"error": "invalid_token",
"msg": "Token not recognized",
})
// Canonical envelope: respondError adds request_id and uses the
// standard "message" key (this branch previously emitted a bespoke
// "msg" field with no request_id — agents couldn't correlate it).
return respondError(c, fiber.StatusBadRequest, "invalid_token", "Token not recognized")
}
slog.Error("onboarding.claim_preview.db_error", "error", err, "request_id", requestID)
return respondError(c, fiber.StatusServiceUnavailable, "lookup_failed", "Failed to verify token")
Expand Down
1 change: 1 addition & 0 deletions internal/handlers/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ func respondPauseUpgradeRequired(c *fiber.Ctx, currentTier string) error {
"message": "Pausing resources requires the Pro plan or higher. Your team is on the " + currentTier + " plan.",
"upgrade_url": "https://instanode.dev/pricing",
"agent_action": AgentActionPauseRequiresPro,
"request_id": middleware.GetRequestID(c),
})
return ErrResponseWritten
}
Expand Down
Loading