Repository navigation
fix(web-ui): create a terminal session for GitHub PR authentication - #3958
Conversation
The GitHub CLI authentication action opened a terminal through the IDE-control quick action, which carries no session identity. The panel could therefore neither create the login terminal in the workspace that owns it nor keep it when the canvas path belonged to another workspace. Create the terminal through the shared manual terminal session service, resolve the owner workspace root and connection once before any await, re-check that owner before the PTY is presented, and open the returned session through the shared shell target with that owner scope. A missing, changed, or device-switched owner now reports the existing retryable error instead of silently retargeting the terminal.
|
Unsigned Windows x64 verification build (artifact-only; not code-signed, not released)
Status: manual Windows verification pending; this PR stays Draft/WIP and nothing was published. |
|
Manual verification is complete, so this PR is now ready for review. The user validated the GitHub PR authentication terminal flow on Windows with the installer built from this branch ( That confirmation covers the Windows desktop path only. Real SSH workspace, Peer Device Mode, Remote Control, and Detached Dispatch remain unexercised, and the automated test evidence above is unchanged. |
|
@bobleer Could you please review this fix when you have a chance? The reporter has verified the Windows build ( I could not assign a reviewer through the repository API with the current permissions, so I am requesting the review here instead. Scenarios beyond the Windows desktop path, such as a real SSH workspace, Peer Device Mode, Remote Control, and Detached Dispatch, remain unexercised. |
- Open the login terminal on the OpenBitFun host so GitHub CLI login shares credentials with the PR backend for SSH workspaces. - Validate the captured workspace root and SSH connection before creating the terminal. Keep older Desktop peers on the explicit host terminal path. Refs: openBitFun#3958
- Open the login terminal on the OpenBitFun host so GitHub CLI login shares credentials with the PR backend for SSH workspaces. - Validate the captured workspace root and SSH connection before creating the terminal. Keep older Desktop peers on the explicit host terminal path. Refs: #3958
Ready for review. The Windows installer path has been validated by the user; see Manual verification below.
Reported reproduction
In a GitHub-backed workspace whose
ghCLI session is missing, the review platform panel shows its authentication gate. Opening that dialog and choosing Open terminal copiedgh auth login --hostname github.com, but the login terminal was not reliably created in the workspace that owns the panel.Root cause
handleOpenGithubAuthTerminalopened the terminal through the IDE-control quick action (quickActions.openTerminal(undefined, workspacePath)). That entry point carries no terminal session identity and no workspace/connection scope, so the panel could not:review-platformpanel can carry a fallback path belonging to another workspace), orFix scope
Only
src/web-ui/src/app/components/panels/review-platform/:createManualTerminalSessionservice and open the returned session through the sharedopenShellSessionTargetservice.openAuthFailederror stays visible instead of silently retargeting the terminal.Tests
Focused automated verification on the rebased tree (
origin/main=f86f80a4f2e33b5e6489bdd90607a6ff37b62786):node scripts/run-vitest.mjs run --maxWorkers=2 ...-- 4 files, 47 tests passed:ReviewPlatformPanel.test.tsx(35),ReviewPlatformPanel.trust.test.tsx(4),TerminalActionBridge.test.tsx(4),createManualTerminalSession.test.ts(4).tsc --noEmitforsrc/web-ui: clean.eslinton the changed files: 0 errors (the test file matches the repository's existing ignore pattern).git diff --check origin/main..HEAD: clean; the diff is exactly the two files above.Not run locally:
pnpm run check:web(nopnpmon this machine's PATH). An independent theme color audit only reported the pre-existing stale generatedsrc/shared/miniapp-chrome/generated/theme.css, which is not part of this diff.Testing level: lightly tested (automated), plus a manual Windows pass
AI-assisted change. The automated evidence is unchanged: the new tests use simulated owner workspace records, device-surface switches and request lifecycles, so they do not establish real desktop UI rendering or live terminal behavior.
Manual verification
Confirmed by the user on Windows: the installer built from this branch (
ff01e2874615220729f04da1c784d6d21cec11cf, version1.0.11-beta.3958) fixes the GitHub PR authentication terminal flow, with no problems found.That confirmation covers the Windows desktop path only. Still not exercised: real SSH workspace, Peer Device Mode, Remote Control, and Detached Dispatch.