perf(pi): 缓存超限包结果并回收会话临时目录 - #3524
Conversation
Signed-off-by: lizzjin <lizzjin37@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 091b2cdda7
ℹ️ 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".
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/pi-package-store.ts | 新增确定性超限负缓存和启动计时,但安装身份无法感知 package.json 之外的深层内容修复。 |
| packages/maker-core/src/agents/pi/index.ts | 新增本地 config-home owner marker、保守回收、清理重试及 Pi 启动阶段计时,未确认阻塞性缺陷。 |
| apps/desktop/src/main/process-monitor/agent-scan.ts | 新增无缓存的全系统进程快照及 Cindy 管理 Pi 进程识别,用于遗留目录回收决策。 |
| apps/desktop/src/main/maker-host/pi-host.ts | 将主进程的 fresh process scan 注入 Pi 本地遗留 config-home 回收判定。 |
| packages/maker-core/src/agents/pi/pi-subagent-runs.ts | 导出既有进程实例启动时间与存活检查,供 config-home owner 判定复用。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[列出 Pi 包] --> B[计算安装身份]
B --> C{命中持久化超限缓存?}
C -->|是| D[跳过遍历并禁用包]
C -->|否| E[检查与快照]
E -->|确定性超限| F[持久化 inspection-limit]
E -->|成功| G[加载受管资源]
F --> D
Prompt To Fix All With AI
### Issue 1
apps/desktop/src/main/maker-host/pi-package-store.ts:401-437
**负缓存身份失效不完整**
当本地包因深层 skills、prompts 或 extensions 的条目数或元数据字节数超限后,仅修改或删除这些深层文件不会改变由根目录 stat 和 `package.json` 构成的 `installationIdentity`。后续会话会继续复用 `inspection-limit` 并跳过遍历,导致已经缩小或修复的包仍持续被禁用,直至执行包 mutation 或修改 `package.json`。
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "perf(pi): cache package limits and recla..." | Re-trigger Greptile
Signed-off-by: lizzjin <lizzjin37@gmail.com>
Signed-off-by: lizzjin <lizzjin37@gmail.com>
|
补充本轮 review 修复与验证(commit
新增回归覆盖:
最新提交前验证:
maker-core 指标补充:未修改 system prompt、prompt 拼接顺序、tool / MCP schema、translator、模型路由、usage 计量或逐 token event loop;影响限于新会话启动资源装配与结构化 timing。未执行真实 |
|
@lizzjin 👋 这个 PR 还有 3 条 review conversation 没 resolve(apps/desktop/src/main/maker-host/pi-package-store.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab5b6ac39d
ℹ️ 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".
|
这条 PR 被维护者确认门拦住,需要维护者在 PR 上 Approve 后才能继续合并流程。 当前在拦的是 插件基座: 请维护者在讨论 issue 里看范围后,直接在本 PR Approve;若要改,请 Request Changes。作者这边先不用反复请求 review——球不在你手里。 讨论 issue:#3527 |
Signed-off-by: lizzjin <lizzjin37@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40e62cba61
ℹ️ 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".
Signed-off-by: lizzjin <lizzjin37@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b65a38b3ef
ℹ️ 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".
|
@lizzjin 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/pi/index.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
Signed-off-by: lizzjin <lizzjin37@gmail.com>
Signed-off-by: lizzjin <lizzjin37@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@lizzjin 👋 这个 PR 目前与 请在本地 merge 最新的 |
Preserve native Pi package loading alongside advisory limit caching and bounded config-home cleanup. Align subagent bridge staging with the internal-extensions directory. Signed-off-by: lizzjin <lizzjin37@gmail.com>
|
@MagicLizi 已解决与 main 的冲突并更新 PR(e852df855),本地测试已通过。 |
|
@lizzjin 👋 这个 PR 目前与 请在本地 merge 最新的 |
Signed-off-by: lizzjin <lizzjin37@gmail.com>
|
@MagicLizi 已合入当前最新 main(3b3d0cfa)并解决冲突,PR head 已更新为 2d30f10。GitHub 已重算为 MERGEABLE;本地 related-unit、Desktop/Mobile typecheck 与 DCO 均通过。 |
Signed-off-by: lizzjin <lizzjin37@gmail.com>
Signed-off-by: lizzjin <lizzjin37@gmail.com>
|
@lizzjin 👋 这个 PR 目前与 请在本地 merge 最新的 |
这次改了什么
摘要
缓存 Pi 包检查与可选快照的确定性超限结果,减少新会话重复遍历、复制和指纹计算;为本地会话临时目录增加进程实例身份及有界后台回收,并补充脱敏启动阶段耗时日志。
本轮合入主干
ac1435b88,解决与 #3614 的四个文件冲突。保留主干的 Pi 原生包权威语义:已安装且未显式停用的包继续由 Pi 原生加载,Cindy 分析结果仅作为提示,不得因超限、未知格式或分析失败阻断原生包。普通启动只请求带关联 ID 的分析元数据,不恢复每会话包快照复制。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
internal-extensions,修复沿用旧extensions路径导致的 ENOENT;原有只读工具面和权限门保持不变。UI 变化
不涉及:相对最新主干仅修改 Desktop main、maker-core 和测试,不改变界面、交互或 UI 文案。
怎么验证的
自动验证
pnpm --filter desktop exec vitest run src/main/maker-host/__tests__/pi-package-store-security.test.ts:160 passed,3 项按现有条件跳过。pnpm --filter @cindy/maker-core exec vitest run定向执行pi-startsession-cleanup、pi-provider-routing、pi-subagent-runs:272 passed,3 项按现有条件跳过。latest.json的 SHA256 校验并安装固定运行时,修正路径后上述 4 项已全部通过;未跳过或弱化失败断言。pnpm --filter <包名> run --if-present typecheck:desktop、mobile、@cindy/anthropic-compat-proxy、@cindy/anthropic-responses-bridge、@cindy/responses-chat-bridge 共 5 个实际脚本通过;其余 8 个受影响包无 typecheck 脚本,记为不适用。git diff --cached --check ac1435b88通过;真实 PR 提交范围 DCO 检查通过,新合并提交使用git commit -s。pnpm test:unit:related:自动选择 full,27 个工作区全部通过;test runner 437 passed、8 skipped,另 6 个工作区按仓库清单无可收集单测记为不适用。未另外重复执行pnpm test:unit。当前快照与 5 项实际 typecheck 的验证凭据一致。手工验证
本轮在 Windows x64 验证。核对四个冲突文件和完整 PR diff,确认保留主干原生包发现、显式停用、失败清理和运行期失效流程,以及本 PR 的缓存失效、跨进程共享、回收预算和脱敏日志。
未执行的验证
npm:context-mode冷启动 benchmark。风险
风险分类
影响与回滚
.cindy插件产品实现、数据库 schema、模型路由、prompt 内容或远程协议。提交前检查