Skip to content

sync: port upstream CLAUDE_CONFIG_DIR for Claude instances (#4017) - #160

Merged
aaditagrawal merged 3 commits into
mainfrom
sync/20260717-claude-config
Jul 17, 2026
Merged

sync: port upstream CLAUDE_CONFIG_DIR for Claude instances (#4017)#160
aaditagrawal merged 3 commits into
mainfrom
sync/20260717-claude-config

Conversation

@aaditagrawal

@aaditagrawal aaditagrawal commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What changed

  • Ports upstream #4017: use CLAUDE_CONFIG_DIR instead of overriding HOME when isolating Claude instance config, so macOS keychain OAuth still works.
  • Preserves fork: multi-provider Claude adapter / settings surface (homePath key retained).

Validation

  • Focused ClaudeHome / ClaudeAdapter / ClaudeTextGeneration / ProviderRegistry (CLAUDE_CONFIG_DIR) tests passed in port worktree
  • Tip stack: vp check and vp run typecheck passed

Stack: 1 of 6; base main.

Summary by CodeRabbit

  • Bug Fixes

    • Claude now uses its dedicated configuration directory without overriding the system HOME environment variable, improving compatibility with macOS keychain access.
    • Updated Claude status checks and text-generation flows to consistently use the configured configuration directory.
  • Documentation

    • Clarified the settings label and description for Claude’s configuration directory.

@aaditagrawal

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aaditagrawal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1cf19bfc-1757-44df-a58f-1db3182cdf7f

📥 Commits

Reviewing files that changed from the base of the PR and between ca317a0 and ea93c8f.

📒 Files selected for processing (6)
  • apps/server/src/provider/Drivers/ClaudeHome.test.ts
  • apps/server/src/provider/Drivers/ClaudeHome.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.test.ts
  • apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts
  • apps/server/src/provider/Layers/ProviderRegistry.test.ts
  • apps/server/src/textGeneration/ClaudeTextGeneration.test.ts
📝 Walkthrough

Walkthrough

Changes

Claude configuration directory

Layer / File(s) Summary
Claude environment mapping
apps/server/src/provider/Drivers/ClaudeHome.ts, apps/server/src/provider/Drivers/ClaudeHome.test.ts
Claude environments set CLAUDE_CONFIG_DIR instead of overriding HOME, with updated resolution assertions.
Provider integration assertions
apps/server/src/provider/Layers/ClaudeAdapter.test.ts, apps/server/src/provider/Layers/ProviderRegistry.test.ts
Provider adapter and status probe tests validate the configured directory through CLAUDE_CONFIG_DIR.
Text generation harness and settings metadata
apps/server/src/textGeneration/ClaudeTextGeneration.test.ts, packages/contracts/src/settings.ts
The fake Claude harness and ClaudeSettings.homePath metadata now use CLAUDE_CONFIG_DIR terminology and validation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: switching Claude instances to CLAUDE_CONFIG_DIR instead of HOME.
Description check ✅ Passed The description covers what changed and validation, and it includes the key rationale, with only optional template sections omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/20260717-claude-config

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.

@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: ca317a0d40

ℹ️ 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 apps/server/src/provider/Drivers/ClaudeHome.ts Outdated
Comment thread apps/server/src/provider/Drivers/ClaudeHome.ts Outdated
aaditagrawal added 2 commits July 17, 2026 16:05
…IG_DIR

Persisted homePath values historically meant a HOME override (Claude used
$HOME/.claude). Map those to CLAUDE_CONFIG_DIR via resolveClaudeConfigDir,
and key continuation/cache by the effective config directory including the
default ~/.claude.

@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: ea93c8fbfb

ℹ️ 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 on lines +26 to +30
if (path.basename(resolvedHomePath) === ".claude") {
return resolvedHomePath;
}
// Legacy HOME override layout: config lived under `$HOME/.claude`.
return path.join(resolvedHomePath, ".claude");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Honor arbitrary CLAUDE_CONFIG_DIR paths

When a user follows the newly relabeled CLAUDE_CONFIG_DIR path setting in packages/contracts/src/settings.ts and enters a valid custom directory such as ~/.claude-work, this basename heuristic silently exports ~/.claude-work/.claude instead of the requested path. Claude then loads a different, typically empty configuration and can appear logged out or lose access to that instance's settings. Legacy HOME values need an explicit migration/version distinction rather than treating every path not literally named .claude as a legacy home.

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). and removed size:S 10-29 effective changed lines (test files excluded in mixed PRs). labels Jul 17, 2026

aaditagrawal commented Jul 17, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jul 17, 10:56 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 17, 10:56 AM UTC: @aaditagrawal merged this pull request with Graphite.

@aaditagrawal
aaditagrawal merged commit 3ebb14f into main Jul 17, 2026
12 checks passed
aaditagrawal added a commit that referenced this pull request Jul 17, 2026
…ngdotgg#4079) (#161)

## What changed

- Ports upstream `pingdotgg#4079`: attach live thread event buffer before snapshot/catch-up reads so events published during load are not dropped.
- Preserves fork: full-range `afterSequence` HTTP catch-up replay and per-thread filters already present on fork `ws.ts`.

## Validation

- New server test for snapshot buffering passed in port worktree
- Tip stack: `vp check` and `vp run typecheck` passed

Stack: 2 of 6; depends on #160.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant