Skip to content

refactor(comments): slim verbose comments in main integrations (git/providers) - #9543

Merged
nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-main-integrations
Jul 20, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/slim-comments-main-integrations

Conversation

@nwparker

@nwparker nwparker commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Slim verbose code comments — main — git, source-control, providers & integrations

Part of a codebase-wide sweep to slim over-verbose comments per AGENTS.md → Document the "Why", Briefly. Comments should state the non-obvious why, not narrate the what/how when the code is already clear; multi-line blocks collapse to a single line.

This PR — main — git, source-control, providers & integrations: 40 files changed, 1432 insertions(+), 4473 deletions(-).

What changed

  • Multi-line Why: paragraphs → one-line why-statements.
  • Deleted comments that merely restated the adjacent code.
  • Kept: license headers, directives (eslint-disable, @ts-expect-error, oxlint-disable, …), TODO/FIXME, JSDoc tags, and every genuine non-obvious reason / external reference (issue numbers, platform quirks, race & ordering constraints).
  • useEffect / regex / bitwise / concurrency: kept a ≤1-line summary where it aids reading.
  • JSX {/* … */} comment text shortened; comments inside template-literal strings left untouched.

Safety

Every file in this PR is comments-only — enforced deterministically by stripping all comments (incl. JSX {/* */}) from both origin/main and the change and confirming the remaining code tokens are identical. pnpm typecheck ✅ · oxlint ✅ (no new findings vs main).

Part of a set of 6 area PRs from one sweep.

🤖 Generated with Claude Code

Made with Orca 🐋

…roviders/…)

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: main — git, source-control, providers & integrations. 40 files changed, 1432 insertions(+), 4473 deletions(-).

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request primarily revises explanatory comments across browser, account, hook, Git, hosted-review, speech, and SSH modules. Functional changes include safer agent-browser argument construction, improved tab/session lifecycle errors, OpenCode dangling-symlink handling, Codex hook/trust reconciliation updates, exported Git remote-count parsing, improved tracked-upstream retry coordination, and related test assertion updates.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing required template sections, including Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections and include the required review, security, testing, and platform-compatibility details.
Docstring Coverage ⚠️ Warning Docstring coverage is 32.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the changeset: it clearly describes a comments-only refactor across git/providers integrations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b354cc8c-e5fc-412c-9596-7c4fada199ea

📥 Commits

Reviewing files that changed from the base of the PR and between 53aeeb7 and d092428.

📒 Files selected for processing (40)
  • src/main/browser/agent-browser-bridge.ts
  • src/main/browser/browser-cookie-import.ts
  • src/main/browser/browser-guest-ui.ts
  • src/main/browser/browser-manager.ts
  • src/main/browser/browser-session-registry.ts
  • src/main/browser/cdp-bridge.ts
  • src/main/browser/grab-guest-script.ts
  • src/main/claude-accounts/runtime-auth-service.ts
  • src/main/claude/hook-service.ts
  • src/main/cli/cli-installer.ts
  • src/main/codex-accounts/runtime-home-service.ts
  • src/main/codex-accounts/service.ts
  • src/main/codex/config-settings-promotion.ts
  • src/main/codex/config-toml-trust.test.ts
  • src/main/codex/config-toml-trust.ts
  • src/main/codex/hook-service.ts
  • src/main/cursor/hook-service.ts
  • src/main/devin/hook-service.ts
  • src/main/gemini/hook-service.ts
  • src/main/git/repo.test.ts
  • src/main/git/repo.ts
  • src/main/git/runner.ts
  • src/main/git/status.ts
  • src/main/git/worktree.ts
  • src/main/github/client.ts
  • src/main/github/pr-refresh-coordinator.ts
  • src/main/github/project-view.ts
  • src/main/github/rate-limit.ts
  • src/main/github/work-item-details.ts
  • src/main/gitlab/client.ts
  • src/main/opencode/hook-service.test.ts
  • src/main/opencode/hook-service.ts
  • src/main/ports/advertised-url-watcher.ts
  • src/main/source-control/hosted-review-creation.ts
  • src/main/speech/model-manager.ts
  • src/main/ssh/ssh-connection.ts
  • src/main/ssh/ssh-relay-deploy.ts
  • src/main/ssh/ssh-relay-native-deps-install.test.ts
  • src/main/ssh/ssh-relay-session.ts
  • src/main/ssh/ssh-relay-versioned-install.ts

// that runs in the page's own world. Keeping it as a template here lets main
// version it alongside the rest of the grab lifecycle.
// ---------------------------------------------------------------------------
/* eslint-disable max-lines -- the guest overlay runtime is one self-contained JS string injected atomically; splitting it adds a concat build step for no auditability gain. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚖️ Poor tradeoff

Remove the max-lines disable directive.

As per coding guidelines, **/*.{js,jsx,ts,tsx} files must "Never disable ESLint or Oxlint max-lines, including line-specific disables". Please remove these directives and consider splitting the files if they exceed the maximum line limit.

  • src/main/browser/grab-guest-script.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/browser/browser-guest-ui.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/browser/browser-session-registry.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/claude-accounts/runtime-auth-service.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/github/pr-refresh-coordinator.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/github/project-view.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/browser/browser-manager.ts#L1-L1: remove the eslint-disable max-lines comment.
  • src/main/browser/browser-cookie-import.ts#L1-L1: remove the eslint-disable max-lines comment.
📍 Affects 8 files
  • src/main/browser/grab-guest-script.ts#L1-L1 (this comment)
  • src/main/browser/browser-guest-ui.ts#L1-L1
  • src/main/browser/browser-session-registry.ts#L1-L1
  • src/main/claude-accounts/runtime-auth-service.ts#L1-L1
  • src/main/github/pr-refresh-coordinator.ts#L1-L1
  • src/main/github/project-view.ts#L1-L1
  • src/main/browser/browser-manager.ts#L1-L1
  • src/main/browser/browser-cookie-import.ts#L1-L1

Source: Coding guidelines

/* eslint-disable max-lines -- Why: this service intentionally keeps Codex
account lifecycle, path safety, login, and identity parsing in one audited
main-process module so the managed-account boundary stays explicit. */
/* eslint-disable max-lines -- Why: keeps Codex account lifecycle, path safety, login, and identity parsing in one audited main-process module. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Do not disable max-lines.

As per coding guidelines, you must never disable ESLint or Oxlint max-lines, including line-specific disables. Please remove the max-lines directive from these comments.

  • src/main/codex-accounts/service.ts#L1-L1: Remove the eslint-disable max-lines block and keep just the // Why: ... comment.
  • src/main/github/work-item-details.ts#L1-L1: Remove the eslint-disable max-lines block and keep just the // Why: ... comment.
  • src/main/ports/advertised-url-watcher.ts#L1-L1: Remove max-lines (leaving no-control-regex) in the eslint-disable block.
  • src/main/codex-accounts/runtime-home-service.ts#L1-L1: Remove the eslint-disable max-lines block and keep just the // Why: ... comment.
♻️ Proposed fixes

For src/main/codex-accounts/service.ts, src/main/github/work-item-details.ts, and src/main/codex-accounts/runtime-home-service.ts:

-/* eslint-disable max-lines -- Why: ... */
+// Why: ...

For src/main/ports/advertised-url-watcher.ts:

-/* eslint-disable no-control-regex, max-lines -- ... */
+/* eslint-disable no-control-regex -- ... */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* eslint-disable max-lines -- Why: keeps Codex account lifecycle, path safety, login, and identity parsing in one audited main-process module. */
// Why: keeps Codex account lifecycle, path safety, login, and identity parsing in one audited main-process module.
📍 Affects 4 files
  • src/main/codex-accounts/service.ts#L1-L1 (this comment)
  • src/main/github/work-item-details.ts#L1-L1
  • src/main/ports/advertised-url-watcher.ts#L1-L1
  • src/main/codex-accounts/runtime-home-service.ts#L1-L1

Source: Coding guidelines

Comment thread src/main/github/client.ts
@@ -1,5 +1,4 @@
/* eslint-disable max-lines -- Why: co-locating all GitHub client functions keeps the
concurrency acquire/release pattern and error handling consistent across operations. */
/* eslint-disable max-lines -- Why: co-locating all GitHub client functions keeps acquire/release and error handling consistent. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Remove the max-lines disable directive.

As per coding guidelines, never disable ESLint or Oxlint max-lines, including line-specific disables.

🐛 Proposed fix
-/* eslint-disable max-lines -- Why: co-locating all GitHub client functions keeps acquire/release and error handling consistent. */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* eslint-disable max-lines -- Why: co-locating all GitHub client functions keeps acquire/release and error handling consistent. */

Source: Coding guidelines

Comment thread src/main/github/client.ts
Comment on lines +2451 to 2457
// Why: a concurrent snapshot may finish before this branch exists in git; re-probe instead of returning a synthetic null.
const retryInFlight = trackedUpstreamSnapshotInFlight.get(cacheKey)
if (retryInFlight) {
const retryResult = await retryInFlight
return retryResult.upstreamsByBranchName.get(branchName) ?? null
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Prevent bypassing the re-probe if retryInFlight is the same promise.

Depending on the JavaScript engine's microtask scheduling, trackedUpstreamSnapshotInFlight.get(cacheKey) might still return the original inFlight promise if the worker's finally block hasn't executed to clear it yet. If this happens, retryInFlight === inFlight, causing the code to erroneously return null (the synthetic null we want to avoid) instead of falling through to initiate a new probe.

Ensure that the retry promise is strictly a newer one.

🐛 Proposed fix
     // Why: a concurrent snapshot may finish before this branch exists in git; re-probe instead of returning a synthetic null.
     const retryInFlight = trackedUpstreamSnapshotInFlight.get(cacheKey)
-    if (retryInFlight) {
+    if (retryInFlight && retryInFlight !== inFlight) {
       const retryResult = await retryInFlight
       return retryResult.upstreamsByBranchName.get(branchName) ?? null
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Why: a concurrent snapshot may finish before this branch exists in git; re-probe instead of returning a synthetic null.
const retryInFlight = trackedUpstreamSnapshotInFlight.get(cacheKey)
if (retryInFlight) {
const retryResult = await retryInFlight
return retryResult.upstreamsByBranchName.get(branchName) ?? null
}
}
// Why: a concurrent snapshot may finish before this branch exists in git; re-probe instead of returning a synthetic null.
const retryInFlight = trackedUpstreamSnapshotInFlight.get(cacheKey)
if (retryInFlight && retryInFlight !== inFlight) {
const retryResult = await retryInFlight
return retryResult.upstreamsByBranchName.get(branchName) ?? null
}
}

JS plugin source emitted into OpenCode's plugins directory as a single
file; splitting the plugin source across TS modules would obscure the
runtime artifact and scatter tightly coupled string-template logic. */
/* eslint-disable max-lines -- Why: holds an inline JS plugin source emitted as one file; splitting across TS modules would scatter tightly coupled string-template logic. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🔴 Critical | ⚡ Quick win

Remove the max-lines disable directive.

As per coding guidelines, you must never disable ESLint or Oxlint max-lines, including line-specific disables. Please remove this directive and refactor the code (e.g., extracting the inline plugin source or other logic into separate modules) to comply with the line limit.

🐛 Proposed fix
-/* eslint-disable max-lines -- Why: holds an inline JS plugin source emitted as one file; splitting across TS modules would scatter tightly coupled string-template logic. */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* eslint-disable max-lines -- Why: holds an inline JS plugin source emitted as one file; splitting across TS modules would scatter tightly coupled string-template logic. */

Source: Coding guidelines

@@ -1,5 +1,4 @@
/* eslint-disable max-lines -- Why: provider detection, eligibility, and creation
preflight share one boundary so renderer and main-process gating cannot drift. */
/* eslint-disable max-lines -- Why: detection, eligibility, and creation preflight share one boundary so gating can't drift. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Remove max-lines lint disables.

The codebase has a strict policy against disabling the max-lines rule. As per coding guidelines, never disable ESLint or Oxlint max-lines, including line-specific disables. Please refactor the code to stay within the file length limit (e.g., by splitting logic into smaller modules), rather than suppressing the linter rule.

  • src/main/source-control/hosted-review-creation.ts#L1-L1: Remove the eslint-disable max-lines directive and refactor to comply.
  • src/main/gitlab/client.ts#L1-L1: Remove the eslint-disable max-lines directive and refactor to comply.
  • src/main/ssh/ssh-relay-deploy.ts#L2-L2: Remove the eslint-disable max-lines directive and refactor to comply.
  • src/main/git/runner.ts#L1-L1: Remove the eslint-disable max-lines directive and refactor to comply.
📍 Affects 4 files
  • src/main/source-control/hosted-review-creation.ts#L1-L1 (this comment)
  • src/main/gitlab/client.ts#L1-L1
  • src/main/ssh/ssh-relay-deploy.ts#L2-L2
  • src/main/git/runner.ts#L1-L1

Source: Coding guidelines

@nwparker
nwparker merged commit 190de82 into main Jul 20, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/slim-comments-main-integrations branch July 20, 2026 10:18
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…roviders/…) (stablyai#9543)

Collapse multi-line explanatory comment blocks into single-line "why" statements
per AGENTS.md ("Document the Why, Briefly"): drop restatements of the code and
mechanism narration; keep the non-obvious reason, external refs, and directives.

Comments-only — verified no code changed via a Babel/esbuild comment-strip
token-equality gate against origin/main; typecheck and oxlint clean.

Area: main — git, source-control, providers & integrations. 40 files changed, 1432 insertions(+), 4473 deletions(-).

Co-authored-by: Orca <[email protected]>
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