Skip to content

fix(server): Claude text generation no longer loads settings from the checkout - #8

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1793137339-claude-text-gen-setting-sources
Draft

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1793137339-claude-text-gen-setting-sources

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Problem

Review guides run claude -p with the pull request worktree as cwd. Claude then loads that checkout's .claude/settings.json and CLAUDE.md, which the pull request author controls. A fork PR can set apiKeyHelper (Claude runs it as a shell command) or env entries such as GIT_EXTERNAL_DIFF, and get code running on the reviewer's machine when they generate a guide.

Change

runClaudeJson now passes --setting-sources user, so Claude reads only the user's own settings and skips project and local settings and the project CLAUDE.md. The flag applies to every Claude text generation call. None of them should depend on the repo's Claude config.

Scope and approval

Small security fix to one argument list. It does not change user-level Claude settings, CLAUDE_CONFIG_DIR handling, or the investigation tool allow list.

Verification

Reproduced with Claude Code 2.1.312 against a local HTTP server standing in for the API (ANTHROPIC_BASE_URL). The test project had a .claude/settings.json with env.ANTHROPIC_CUSTOM_HEADERS, an apiKeyHelper that touches a marker file, and a CLAUDE.md with a marker string. I ran the exact argument list from runClaudeJson.

project env header sent CLAUDE.md in request apiKeyHelper ran
Before yes yes yes, marker file created
--setting-sources user no no no

Claude ignored the project permissions.allow entry in both runs because the workspace was untrusted. env and apiKeyHelper still applied before the fix.

The ClaudeTextGeneration.test.ts argument assertion now includes --setting-sources user. It fails without the fix and passes with it. vp run check:changed passes.

Devin (Claude), Devin harness.

Link to Devin session: https://app.devin.ai/sessions/0e0964340bdc489a8a244be513977299
Open in Devin Desktop: https://app.devin.ai/desktop/session/0e0964340bdc489a8a244be513977299?variant=devin

… checkout

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 2fe5a2e.

This comment will update automatically after the next completed run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 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