Skip to content

fix(sessions): name the connection a blocked launch is waiting on - #227

Merged
artempartos merged 1 commit into
developfrom
fix/name-blocked-mcp-server
Sep 9, 2026
Merged

artempartos merged 1 commit into
developfrom
fix/name-blocked-mcp-server

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

What happened

Production, 2026-09-09. Nine "Verify the story on real staging" steps in project 27 were refused before they ever launched, over three and a half hours:

13:58 → 17:21   9 × Verify   cancelled, started_at empty, error_message empty
17:25–17:26     GET /oauth/mcp/51/connect → mcp.sentry.dev/oauth/authorize → /oauth/callback
17:26 → 17:28   6 × Verify   ready, all started

The cause was one project-shared Sentry OAuth grant that had expired. Nothing on the board said so. The only record was on the admission:

Connect required for 1 OAuth MCP server(s) before launching

Which server? The message did not say, and the step is wired to three (Playwright, Railway MCP, Sentry).

Why the message was anonymous

The interactive path is fine: Api::V1::TerminalSessionsController#create renders the whole connections list and SessionNewForm draws a "Connect Sentry" button per entry. A workflow step has no browser — SessionLaunchRelay stores e.message on the admission and nothing else, and SessionAdmissionService.cancel! leaves the session's own error_message blank. So for every non-interactive launch, that one sentence was the entire account of the refusal, and it named a count instead of a server.

What changed

  • Oauth::PreflightError names them: Connect required before launching: Sentry, …: Sentry, Railway MCP, and …: MCP server #51 when an entry carries no name.
  • The three raise sites in SessionService that built a credential_error entry without name: now carry it — those are the "credential broke on refresh" paths, exactly the ones that fire without a browser.
  • SessionLaunchRelay records the refusal on the session as well as the admission, so a step refused at the gate stops being a bare cancelled with nothing to act on.

Tests

  • test/services/oauth/preflight_error_test.rb (new): one server, several servers, and the unnamed fallback.
  • session_launch_relay_test.rb: a refused launch leaves Connect required before launching: Sentry on both the session and the admission — the production shape.
  • session_service_test.rb: the refresh-failure raise site asserts the named message.
  • SessionNewForm.test.tsx fixture updated to the new string; the per-server Connect CTA is unchanged.

rubocop clean on the touched files; the affected backend suites and SessionNewForm pass locally. Full suite is CI's call.

🤖 Generated with Claude Code

A launch refused by the OAuth preflight said "Connect required for 1
OAuth MCP server(s) before launching" and stopped there. The browser is
fine — it gets the whole `connections` list and renders a Connect button
per server — but a workflow step has no browser: the relay stores only
this message on the admission, and the session itself was left a bare
`cancelled` with an empty error.

Production, 2026-09-09: nine "Verify the story on real staging" steps
were refused over three and a half hours because one project-shared
Sentry grant had expired. Nothing on the board said so, and nothing
named Sentry.

The message now names the servers, the three raise sites that dropped
the name carry it, and the refusal is recorded on the session so the run
shows why it never started.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 21ab1e7 into develop Sep 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant