Skip to content

Commit 5942962

Browse files
Merge branch 'master' into fix/buildlogcache-size-cap-2026-06-04
2 parents 3356cca + 6cef45b commit 5942962

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

internal/handlers/env_policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ func (h *EnvPolicyHandler) Put(c *fiber.Ctx) error {
100100
"role": role,
101101
"allowed_roles": []string{middleware.RoleOwner},
102102
"agent_action": newAgentActionOwnerRequired(role),
103+
"request_id": middleware.GetRequestID(c),
103104
})
104105
}
105106

internal/handlers/onboarding.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ func (h *OnboardingHandler) ClaimPreview(c *fiber.Ctx) error {
9696
if err != nil {
9797
var notFound *models.ErrOnboardingNotFound
9898
if errors.As(err, &notFound) {
99-
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
100-
"ok": false,
101-
"error": "invalid_token",
102-
"msg": "Token not recognized",
103-
})
99+
// Canonical envelope: respondError adds request_id and uses the
100+
// standard "message" key (this branch previously emitted a bespoke
101+
// "msg" field with no request_id — agents couldn't correlate it).
102+
return respondError(c, fiber.StatusBadRequest, "invalid_token", "Token not recognized")
104103
}
105104
slog.Error("onboarding.claim_preview.db_error", "error", err, "request_id", requestID)
106105
return respondError(c, fiber.StatusServiceUnavailable, "lookup_failed", "Failed to verify token")

internal/handlers/resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ func respondPauseUpgradeRequired(c *fiber.Ctx, currentTier string) error {
813813
"message": "Pausing resources requires the Pro plan or higher. Your team is on the " + currentTier + " plan.",
814814
"upgrade_url": "https://instanode.dev/pricing",
815815
"agent_action": AgentActionPauseRequiresPro,
816+
"request_id": middleware.GetRequestID(c),
816817
})
817818
return ErrResponseWritten
818819
}

0 commit comments

Comments
 (0)