Skip to content

fix: agent 不再继承操作者的 Claude Code 配置; 关闭 agent stdin - #17

Merged
2233admin merged 2 commits into
mainfrom
fix/isolate-agent-settings
Oct 26, 2026
Merged

2233admin merged 2 commits into
mainfrom
fix/isolate-agent-settings

Conversation

@2233admin

@2233admin 2233admin commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

问题

被拉起的 claude -p 会继承操作者的个人 Claude Code 配置:用户级 hook 和全局 CLAUDE.md。实测它能背出我的工单规则和 Stop hook;hook 可能拖慢甚至卡住无人值守的 agent。

改动

  • claude 启动参数加 --setting-sources project,local:用户级设置不再生效,项目级和本地设置照常生效。FSC_CLAUDE_USER_SETTINGS=1 可恢复旧行为。分析器和执行器共用同一个函数。
  • agent 的 stdin 改为 ignore:stdin 开着但没数据时,claude -p 会先等约 3 秒才启动。
  • 新增 2 个测试:默认带隔离参数、环境变量可以关闭。

实测

  • 同一个简单提示:默认 22 秒,agent 能复述全局规则;隔离后 9 秒,且不知道这些规则。
  • 真实端到端(两任务仓库):执行阶段 20 到 27 秒,之前是 77 秒;两个任务均 tier 1 合并;agent 日志里没有工单或 hook 相关内容。

更正(此前版本的说法是错的)

这个 PR 最初暗示“之前 16 分钟的运行可能由用户级 hook 造成”。不是。 隔离后的那次运行总耗时仍是 15 分 28 秒,但文件时间戳显示分析 20 秒、执行 27 秒,其余约 14 分钟进程在空等。真正的原因是另一个缺陷(agent 超时定时器从不清除,成功的运行要等 15 分钟超时才退出),已在后续 PR 修复。本 PR 的隔离改动仍然有价值(agent 不再背操作者的规则、更快启动),但它不是那 15 分钟的原因。

验证

  • tsc --noEmit 退出码 0;bun test(packages/core)184 通过 / 45 跳过 / 0 失败

🤖 Generated with Claude Code

https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53

…ose agent stdin

claude -p now runs with --setting-sources project,local (user-level hooks and the user's
global CLAUDE.md no longer apply inside agents; FSC_CLAUDE_USER_SETTINGS=1 opts back in) and
with stdin ignored (an open silent stdin made claude wait ~3 s before starting).
Measured: trivial prompt 22 s -> 9 s; 2-task exec phase 77 s -> 20 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T18:43:38.537948Z c239dd1 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.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 959ad8b5-915d-4b7f-831c-ab7d7e8959ae
Commits

Reviewing files that changed from the base of the PR and between fb75e47 and 0db2765.

Files selected for processing: 5
  • docs/reports/e2e-smoke-2026-10-25.md
  • packages/core/src/analyzerNative.ts
  • packages/core/src/execution/local.ts
  • packages/core/src/execution/types.ts
  • packages/core/test/execution/mapping.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53
@2233admin
2233admin merged commit 06fbae7 into main Oct 26, 2026
3 checks passed
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