Skip to content

【维护】office __pycache__ 18 个 .pyc 入库:untrack 已跟踪文件 + 堵住再生源 #173

Description

@CavinHuang

位置

  • apps/sidecar/src/services/agent-runtime/tools/office/scripts/__pycache__/*.pyc(13 个)+ validators/__pycache__/*.pyc(5 个)
  • 再生源:apps/sidecar/src/services/agent-runtime/tools/office/office-tool-executor.ts:117-136(runPython spawn python3 候选,不带 -B、env 不含 PYTHONDONTWRITEBYTECODE)
  • .gitignore:31 已有 __pycache__ 规则(:3 已有 dist)——文件是加规则前入库的

问题

.gitignore 并不缺规则,缺的是 untrack(git rm -r --cached)。且只 untrack 不堵源头:runPython 每次 import validators 即在源码树再生 .pyc(虽被 ignore,但污染工作区/IDE 索引)。

修复建议

git rm -r --cached apps/sidecar/**/__pycache__;runCommand 对 python 调用默认注入 PYTHONDONTWRITEBYTECODE: "1"(或候选统一加 -B)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions