Skip to content

Git read hygiene and PR polling: optional locks, untracked cap, GHE hosts, settled cadence, longpaths (#1520, #1523) - #1548

Merged
currentbits merged 9 commits into
mainfrom
coder/1520-1523-git-read-hygiene-pr-polling-0edb0e
Oct 11, 2026
Merged

currentbits merged 9 commits into
mainfrom
coder/1520-1523-git-read-hygiene-pr-polling-0edb0e

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #1520. Closes #1523. One commit per item.

#1520

  • fe6df9b: a single gitEnv(args) (electron/worktrees-git.js) now builds the env for every local git spawn (gitOut, gitTry, gitTryAsync, gitExecThrowAsync, services-git.js gitOutAsync). Read-only subcommands get GIT_OPTIONAL_LOCKS=0, so background status and diff calls no longer take index.lock while the agent is committing. Writes are unchanged.
  • 75fbb8d: the Changes scan counts lines for at most 500 untracked files, skipping any over 1 MB. The rest report 0 lines, like binary numstat.

#1523

  • 203f17b: on win32, gitEnv appends core.longpaths=true through GIT_CONFIG_COUNT/KEY/VALUE, after any entries that are already set.
  • da502a5: settled threads are polled for PR state every 10 min instead of on every pass, because merged-worktree reclaim rides this poll.
  • 78c4a02: isGitHubRemote accepts any host in gh's hosts.yml or GH_HOST (GitHub Enterprise). ssh Host aliases are resolved once with ssh -G and cached. That call uses execFile, so no shell, rejects names starting with -, and reads only the local config. The async callers await isGitHubRemoteAsync. slugFromRemoteUrl now accepts [user@]alias:owner/repo.

Tests: worktrees-git, worktrees, diff-scopes and pr-refresh. Full electron suite: 4350 pass, 0 fail (clean env).

Part of the #1532 gap pass.

🤖 Generated with Claude Code

Willem and others added 5 commits October 9, 2026 13:17
Background status/diff refreshed the index and took index.lock, which
could fail the agent's own commit. One gitEnv builder now feeds every
local git spawn (gitOut, gitTry, gitOutAsync, gitTryAsync,
services-git gitOutAsync) and sets the var only for read subcommands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Changes scan read every untracked file synchronously on the main
process just to count lines. A build dir with no ignore rule stalled the
UI. Past the cap, files still list but report 0 lines, like binaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gitEnv appends GIT_CONFIG_KEY/VALUE_<n> after any GIT_CONFIG_COUNT the
user already set, so every local git spawn handles long Windows paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settled threads were polled every 5 min like active ones. Skipping them
outright would strand merged-worktree reclaim, so they now poll at the
first pass at least 10 min after the last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isGitHubRemote only matched github.com. It now accepts any host gh is
logged into (hosts.yml keys, GH_HOST) and resolves ~/.ssh/config aliases
once via an async, cached `ssh -G`. PR callers await
isGitHubRemoteAsync so an alias is resolved before the first check;
sync callers read the cache. gh already picks the host from the repo's
remotes, so its calls need no --hostname. slugFromRemoteUrl now parses
alias:owner/repo too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T12:49:03.051053Z 78c4a02 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…1523)

The sync isGitHubRemote returns false for an ssh alias until its ssh -G
lookup lands, so the first Planboard call on such a remote reported
"not a GitHub repo". Every caller here is already async.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78c4a024e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/worktrees-pr.js
Comment on lines +142 to +143
const real = resolveSshHost(r.host);
return typeof real === "string" && hosts.has(real);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Await SSH alias resolution in issue workflows

When a repository origin uses a previously unseen SSH alias such as work-gh:owner/repo, resolveSshHost() returns a pending Promise and this synchronous path therefore returns false. Several asynchronous issue/Planboard operations still call isGitHubRemote() directly (electron/issues.js, including fetch, edit, reopen, complete, comment, and create), so the user's first operation is rejected as “not a GitHub repo”; it only begins working nondeterministically after the background ssh -G callback populates the cache. Those callers should await isGitHubRemoteAsync() just like the PR callers changed in this commit.

Useful? React with 👍 / 👎.

Willem and others added 3 commits October 9, 2026 16:13
#1550 moved PR/issue ops to the GitHub API behind isGitHubPrRemote.
Keep that at every call site and feed it the gh-host/ssh-alias aware
isGitHubRemoteAsync (#1523), so GHE works through the API or gh. Planboard
(issues.js) and revertPr.js also use the async check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…giene-pr-polling-0edb0e

# Conflicts:
#	electron/crewIntegration.js
#	electron/issues.js
#	electron/worktrees-pr.js
#	electron/worktrees.js
@currentbits
currentbits merged commit 9247443 into main Oct 11, 2026
6 checks passed
currentbits pushed a commit that referenced this pull request Oct 11, 2026
Keep gitlabOrigin next to isGitHubRemoteAsync so checkout still
resolves SSH-aliased GitHub hosts after the #1548 remote helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
currentbits pushed a commit that referenced this pull request Oct 19, 2026
Keep gitlabOrigin next to isGitHubRemoteAsync so checkout still
resolves SSH-aliased GitHub hosts after the #1548 remote helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
currentbits pushed a commit that referenced this pull request Oct 19, 2026
#1550 moved PR/issue ops to the GitHub API behind isGitHubPrRemote.
Keep that at every call site and feed it the gh-host/ssh-alias aware
isGitHubRemoteAsync (#1523), so GHE works through the API or gh. Planboard
(issues.js) and revertPr.js also use the async check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant