Skip to content

fix(python): 账号覆盖文件不被沙箱重建覆盖;storePath 统一沙箱 configs(submodule → jetbrains#7) - #13

Merged
AliceJump merged 3 commits into
mainfrom
fix/multi-account-sandbox-ownership
Sep 25, 2026
Merged

AliceJump merged 3 commits into
mainfrom
fix/multi-account-sandbox-ownership

Conversation

@AliceJump

Copy link
Copy Markdown
Owner

背景

主仓/子仓功能对称审计(2026-09-25)中「多账户」一项的关键读写冲突:子仓 JetBrains 插件接入账号编辑后,编辑写入沙箱 configs/account_scoped_overrides.json,但 run_executor.py 每次启动的 copytree 会把项目侧旧文件整体拷进沙箱覆盖用户编辑。本 PR 修复该冲突并统一 probe 的 storePath 语义。

配套 PR:AliceJump/ok-script-toolkit-jetbrains#7(子仓 Kotlin 侧)。submodule 指针指向其分支 head,合并顺序:先 jetbrains#7,再本 PR。

提交分解

1. fix(python): 账号覆盖文件不再被沙箱重建覆盖;storePath 统一沙箱 configs

  • run_executor.py:copytree 用 ignore 回调排除 account_scoped_overrides.json,改由 copy_account_file_once 仅在沙箱没有该文件时一次性拷入(临时文件 + 硬链接/排他创建发布,防并发覆盖或暴露半写入文件)
  • account_store.py:新增 initialize_sandbox_account_file——账号编辑首次落沙箱前,若沙箱无账号文件则从项目声明的 config_folder(AST 解析 config.py 读取,与 probe 规则一致)初始化
  • probe_task_schemas.py:storePath 一律报沙箱 configs/ 路径(不再用自定义 config_folder 拼接,与执行器沙箱布局对齐);info 默认补 accountCount/overrideAccounts/overriddenTasks,非 dict 数据的可读性判定修正
  • 测试断言同步更新

2. chore(submodule): jetbrains 指向 jb-parity 分支

  • 指向 feat/jb-parity-task-config-accounts(651278d)

验证

  • 主仓 Python 测试 8/9;唯一失败的 test_probe_multi_account_path.py [4b] 段为既有环境敏感问题(os.path.relpath 跨 C:/D: 盘符抛 ValueError,该行来自 2026-09-23 a15310f,本 PR 未触碰;Linux CI 无此问题)
  • test_probe_multi_account_path.py 中与 storePath 语义相关的 [5][6] 段均通过
  • 主仓 CI 不运行 python/tests(vscode job = npm test,jetbrains job = Gradle),不受上述环境问题影响

配套 jetbrains PR #7(多账户编辑)。此前执行器每次启动 copytree 会把
项目侧的 account_scoped_overrides.json 整体拷进沙箱,覆盖掉插件账号
编辑刚写入沙箱的值——编辑被旧文件冲掉。

- run_executor.py:copytree 用 ignore 回调把账号文件排除在外,改由
  copy_account_file_once 仅在沙箱没有该文件时一次性拷入(临时文件 +
  硬链接/排他创建发布,防并发覆盖或暴露半写入文件)
- account_store.py:新增 initialize_sandbox_account_file——账号编辑
  首次落沙箱前,若沙箱无账号文件则从项目声明的 config_folder(AST
  解析 config.py 读取,与 probe 规则一致)初始化;新增 ast/shutil/
  tempfile 导入与 project_dir 绝对化
- probe_task_schemas.py:collect_multi_account 的 storePath 一律报沙箱
  configs/ 路径(不再用自定义 config_folder 拼接,与执行器沙箱布局
  对齐);info 默认补 accountCount/overrideAccounts/overriddenTasks 键,
  非 dict 数据可读性判定修正
- 测试断言同步更新
指向 feat/jb-parity-task-config-accounts(651278d):showInTaskTab
过滤、全局配置编辑、多账户编辑、显式路径校验、CI 打包修复。
合并顺序:先 jetbrains#7,再本 PR。
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 73bd4e78-9d76-4c25-8553-0f61ea9f773f


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.

@AliceJump
AliceJump merged commit 4b80083 into main Sep 25, 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