Skip to content

Fix GitLab auth diagnostic waking WSL#7967

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/wsl-7536-gitlab-wakes-wsl
Jul 9, 2026
Merged

Fix GitLab auth diagnostic waking WSL#7967
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/wsl-7536-gitlab-wakes-wsl

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the global GitLab auth diagnostic on the Windows host
  • prevent a missing host glab from waking the default WSL distro
  • preserve the existing default-WSL fallback for GitLab operations that use normal runner behavior

Root cause and reproduction

On Windows, diagnoseAuth() runs cwd-less glab auth status. When host glab returns ENOENT, the shared runner automatically resolves the default WSL distro and retries through wsl.exe, even when the workspace and agent runtimes are Windows and GitLab is unused.

The regression harness simulates that exact subprocess sequence: Windows host glab missing, Ubuntu configured as the default distro, and the global auth command invoked. Before the fix it recorded a second wsl.exe call running glab auth status. It now asserts that the host-only diagnostic stops after the single host attempt. A separate existing test continues to cover default-WSL fallback for ordinary cwd-less GitLab API operations.

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/main/git/runner-wsl-gh-fallback.test.ts src/main/gitlab/client-mr.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/main/gitlab/client-mr.test.ts src/main/gitlab/gl-utils.test.ts
  • pnpm typecheck:node
  • pnpm exec oxlint src/main/git/runner.ts src/main/git/runner-wsl-gh-fallback.test.ts src/main/gitlab/client.ts src/main/gitlab/client-mr.test.ts
  • pnpm check:max-lines-ratchet
  • git diff --check

Closes #7536

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5b692da7-a0d8-48b0-bac5-4ebcf53639dd

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0febc and 05db504.

📒 Files selected for processing (4)
  • src/main/git/runner-wsl-gh-fallback.test.ts
  • src/main/git/runner.ts
  • src/main/gitlab/client-mr.test.ts
  • src/main/gitlab/client.ts

📝 Walkthrough

Walkthrough

Adds an allowDefaultWslFallback option to glabExecFileAsync in the git runner, allowing callers to disable the Windows default WSL distro fallback that normally occurs when the host glab command is missing. Updates diagnoseAuth in the GitLab client to invoke glabExecFileAsync(['auth', 'status'], { allowDefaultWslFallback: false }), preventing that diagnostic call from triggering WSL fallback. Corresponding test files are updated: a new test verifies the fallback is skipped on ENOENT with the option disabled, and an existing test asserts the option is passed to the mocked call.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, root cause, and validation, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, especially Screenshots/No visual change, AI Review Report, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the GitLab auth diagnostic and the WSL wakeup issue, matching the main change.
Linked Issues check ✅ Passed The change disables default WSL fallback only for diagnoseAuth, which matches the issue's goal while preserving normal GitLab fallback behavior.
Out of Scope Changes check ✅ Passed Changes are limited to the runner option, the GitLab auth call, and matching tests, with no unrelated scope visible.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H Jinwoo-H merged commit e537953 into main Jul 9, 2026
2 checks passed
@Jinwoo-H Jinwoo-H deleted the Jinwoo-H/wsl-7536-gitlab-wakes-wsl branch July 9, 2026 22:06
Jinwoo-H added a commit that referenced this pull request Jul 10, 2026
Clean auto-merge, no conflicts (109 files, +7490 from main). Brought in:
- Codex WSL runtime status hooks (#7969); WSL/SSH agent path resolution past
  shell aliases (#7867); WSL source-control path separators (#7966); WSL
  GitLab-auth wake fix (#7967); WSL Codex usage RPC refresh (#7567/#7658)
- Improve workspace cleanup list (#7053) + background removal
- mobile: per-host connection log + Tailscale wedge recovery (#7984/#7980),
  wake slept agents on mobile worktree open (#7906)
- Harden layout validation, watcher lifecycle, connection robustness (#7924)
- Disable experimental worktree card style by default (#7977)

Perf-branch structure preserved (clean auto-merge). typecheck 0 errors; lint 0
errors. CI is the release gate (local runs skipped per env lag).

Co-authored-by: Orca <help@stably.ai>
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.

[Bug]: GitLab auth diagnostic starts WSL Ubuntu on Windows even when GitLab is unused

1 participant