Skip to content

[3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen - #3938

Merged
integry merged 1 commit into
3758-epic-runtime-abstraction-sc0from
3936/gpt-6.2-sol-mcp-connect-on-fly-device-20261130-2317-8mc
Dec 1, 2026
Merged

integry merged 1 commit into
3758-epic-runtime-abstraction-sc0from
3936/gpt-6.2-sol-mcp-connect-on-fly-device-20261130-2317-8mc

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3936

Branch: 3936/gpt-6.2-sol-mcp-connect-on-fly-device-20261130-2317-8mc
Commits: ✅ Changes committed (d75af24)


AI Processing Completed

Execution Details:

Summary:
Fixed #3936. GitHub device sign-in now preserves a validated same-origin return path and performs a full-page navigation back to MCP consent or Connected Apps. Off-origin targets are discarded, and pending MCP requests still expire after 10 minutes.

API and UI regression tests, type checks, and lint passed. Local Chromium testing with simulated GitHub sign-in verified that the browser reached consent, the client received and exchanged an authorization code, and expired requests showed the existing error page. A live Fly deployment remains unverified.

Review digest

Risk-tiered paths

  • High risk (2 files)
    • packages/api/auth.ts (+40/−5): auth-looking path
    • propr-ui/src/pages/LoginPage.tsx (+3/−2): auth-looking path
  • Normal risk (2 files)
    • propr-ui/src/api/deviceSignInApi.ts (+6/−2)
    • propr-ui/src/pages/DeviceSignInPanel.tsx (+2/−2)
  • Low risk (3 files)
    • packages/api/test/deviceAuth.test.ts (+46/−0)
    • packages/api/test/deviceAuthHarness.ts (+3/−2)
    • propr-ui/src/pages/LoginPage.deviceSignIn.test.tsx (+28/−0)

Diff size: 7 files changed, +128/−13 lines

View task for the run's logs and conversation.


This PR was created automatically by ProPR after processing issue #3936.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

MCP consent after device sign-in

MCP consent after device sign-in

The browser returns to the pending connection and shows permissions and repositories after device sign-in.

Original unavailable: managed storage is unavailable or the upload has expired.

Fixed #3936. GitHub device sign-in now preserves a validated same-origin return path and performs a full-page navigation back to MCP consent or Connected Apps. Off-origin targets are discarded, and pending MCP requests still expire after 10 minutes.

API and UI regression tests, type checks, and lint passed. Local Chromium testing with simulated GitHub sign-in verified that the browser reached consent, the client received and exchanged an authorization code, and expired requests showed the existing error page. A live Fly deployment remains unverified.

ProPR-Agent: codex/gpt-6.2-sol
@propr-dev propr-dev Bot changed the title 🔨 [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen ✅ [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen Nov 30, 2026

integry commented Dec 1, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev propr-dev Bot changed the title ✅ [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen 🔨 [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen Dec 1, 2026
@propr-dev

propr-dev Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

Ready to merge within the reviewed scope. The change preserves the device sign-in return target through session creation and uses full-page navigation to reach server-rendered MCP pages. The implementation is appropriately scoped.

✅ Validated return targets — Server validation enforces the frontend origin, rejects normalized protocol-relative paths, and clears previously stored targets when a new target is invalid.

✅ Session continuity — The target survives Passport session regeneration, is consumed on completion, and is returned only after the session save succeeds.

✅ Focused regression coverage — Added tests cover target preservation, consumption, off-origin rejection, and the UI navigation callback. Existing MCP expiration checks remain unchanged.

This assessment is based on static review of the supplied code; no commands or tests were run. Current-head checks report 15 passed and no failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Automate the complete MCP journey

Consider adding an integration regression that starts with an unauthenticated MCP consent request, completes device sign-in, and follows the returned target to consent. Include an expired pending request. The added tests verify the API and UI handoff separately; testing their composition would preserve the reported manual verification as repeatable coverage. This is optional because the supplied control flow supports both outcomes.

Score

The implementation addresses the objective with focused changes, defensive validation, and relevant regression tests. No merge blockers were identified, and current-head checks are passing.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 19s
  • Tokens: 48,576 (48,202 in / 374 out)
  • Cost: $0.39

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen ✅❾ [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen Dec 1, 2026
@integry

integry commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Own review: the device-mode redirect is validated against FRONTEND_URL's origin, with //host normalisation guarded. It's saved before /login and read before the session clears it (keepSessionInfo keeps it across req.login). The login page does a full-page load (window.location.href), as the server-rendered /mcp/consent needs. Live check on Fly is pending the RC rebuild: the device leg needs a human.

@integry
integry merged commit 306a39f into 3758-epic-runtime-abstraction-sc0 Dec 1, 2026
59 checks passed
@propr-dev propr-dev Bot changed the title ✅❾ [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen [3936 by GPT-6.2 Sol] MCP connect on Fly (device sign-in): sign-in drops redirect_to, user lands on dashboard instead of the consent screen Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant