Summary
Retrying an API-driven integration setup pipeline (e.g. Claude Agent) after a validation failure returns a generic 500 Internal Error instead of a clean validation message, because the pipeline's step index has already advanced past the retryable step.
Steps to reproduce
POST /api/0/organizations/{org}/pipeline/integration_pipeline/ with an invalid API key for the Claude Agent (claude_code) integration → correctly returns 400 with "Invalid Anthropic API key. Please check your credentials." or via web UI navigate to Settings -> Integrations -> Claude Agent -> Add Agent, intentionally enter invalid API key
- Retry the same request (same pipeline session, different key) → returns 500 with
{"detail": "Internal Error", "errorId": "..."} instead of a validation error. Or in web UI click "Continue" one more time (not "Start over")
Diagnosis
api_advance() increments step_index before api_finish_pipeline() runs.
api_finish_pipeline() returns a PipelineStepResult.error(...) on a validation failure but does not roll back step_index.
- On retry within the same session, the pipeline resolves
api_steps[step_index], which is now out of range for providers with a single API step (e.g. Claude Agent's get_pipeline_api_steps() returns only [ClaudeCodeApiKeyApiStep()]), producing an unhandled exception and generic 500.
Reproduced against org sentry-sn0 with errorId a833faf7eb9f4c81821613e43e14c676.
Impact
Low severity — reloading the integration setup page before retrying avoids the bug — but the resulting 500/Internal Error is confusing for customers troubleshooting a bad API key.
via Igor M.
--
View Junior Session [Sentry]
Summary
Retrying an API-driven integration setup pipeline (e.g. Claude Agent) after a validation failure returns a generic 500 Internal Error instead of a clean validation message, because the pipeline's step index has already advanced past the retryable step.
Steps to reproduce
POST /api/0/organizations/{org}/pipeline/integration_pipeline/with an invalid API key for the Claude Agent (claude_code) integration → correctly returns 400 with"Invalid Anthropic API key. Please check your credentials."or via web UI navigate to Settings -> Integrations -> Claude Agent -> Add Agent, intentionally enter invalid API key{"detail": "Internal Error", "errorId": "..."}instead of a validation error. Or in web UI click "Continue" one more time (not "Start over")Diagnosis
api_advance()incrementsstep_indexbeforeapi_finish_pipeline()runs.api_finish_pipeline()returns aPipelineStepResult.error(...)on a validation failure but does not roll backstep_index.api_steps[step_index], which is now out of range for providers with a single API step (e.g. Claude Agent'sget_pipeline_api_steps()returns only[ClaudeCodeApiKeyApiStep()]), producing an unhandled exception and generic 500.Reproduced against org
sentry-sn0with errorIda833faf7eb9f4c81821613e43e14c676.Impact
Low severity — reloading the integration setup page before retrying avoids the bug — but the resulting 500/Internal Error is confusing for customers troubleshooting a bad API key.
via Igor M.
--
View Junior Session [Sentry]