[Feature] 外部进程执行轨迹按 Git 标准补齐:构建和插件任务、进程运行器、引擎宿主、远程 SSH、Agent CLI
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, rust, swift, typescript
- Domain
- backend, devtools, observability
Research direction
Start with rust/lithe-core/src/git/command_trace.rs, the logging catalog, and the listed process entry points in the Rust Core, macOS, and Agent host. Read logging.md section 7 and the related work in #1714; then trace how each execution point reports outcomes and carries its op. Done means every listed execution point emits one correctly redacted terminal event with the required source level, op correlation, tests, and updated logging documentation.
Written by the indexing model from the issue text.
Description
Problem to solve / 要解决的问题
日志规范(.agents/skills/develop-lithe/references/logging.md 第七节)要求每个外部进程在执行点记录一条终态,并写明“将来为其他外部进程增加轨迹时,沿用同一模型”。目前只有 Git 做到了(#1714):vcs.git.command.finished / .traced / .failed 记录脱敏后的 argv、退出码、stderr 末尾 8 行、按来源分级,并和 app.action.performed、app.core.request.* 用同一个 op 串起来。
其他外部命令在日志窗口里要么完全看不到,要么只有启动或失败记录。构建失败、插件任务卡住、远程连不上时,日志回答不了“实际执行了什么命令、以什么状态结束”,只能翻运行控制台或靠猜。
在 preview(4c696215f)上逐个核对的执行点:
| 执行点 | 跑什么 | 现在记录什么 | 缺什么 |
|---|---|---|---|
MacStreamingProcess(macos/Sources/Lithe/Platform/MacOS/Process/) |
插件运行和构建任务(Maven、Gradle 等,经 MacLanguageExecutionHost)、MacBuildCommandRunner 的构建命令、调试性能采样(MacDebugPerformanceSampler、MacTestJVMPerformance) |
只有 I/O 失败 RunProcessIoFailed |
终态、argv、退出码、stderr、来源、op |
MacRawProcessSession |
宿主启动的调试适配器(MacPluginDebugAdapterTransport) |
只有 I/O 失败 | 同上 |
MacProcessRunner |
构建工具解析、运行时和工具链发现、ditto 解压、稳定版回滚、Agent 账号登录、工具链元数据 |
run.process.execution:可执行文件路径、退出码、结果、耗时、op |
argv、stderr、来源分级 |
引擎宿主 rust/lithe-core/src/lsp/interface/process.rs |
LSP、VCS 后端、插件后端、调试适配器 | *.process.started(id、runtime_version)、限流的 stderr、会话失败、关闭超时 |
脱敏 argv;统一的退出终态(退出码、耗时) |
远程探测 rust/lithe-core/src/remote/mod.rs、会话启动 remote/sessions.rs |
ssh 连接探测和远程会话 |
只有外层的 Core 请求轨迹 | ssh argv、退出码、stderr |
lithe-agent-host(cli_update、codex_history、environment、install、lib、mcp_probe、subscription) |
Agent CLI 版本探测、安装和更新、MCP 探测、订阅查询 | 只有失败,经 failure_log |
成功终态、argv、退出码、stderr |
rust/lithe-git-host/src/configuration.rs |
git --version 探测 |
无 | 一条终态 |
Proposed solution / 建议方案
按 Git 的模型补齐,逻辑放在 Rust Core,宿主只上报执行事实:
- Core 通用进程轨迹。 把
rust/lithe-core/src/git/command_trace.rs里的 argv 脱敏、stderr 末尾截取、结果分类和来源分级提成通用模块。Git 继续用vcs.git.command.*和exit_is_answer。在 catalog 里为其他进程新增事件(例如run.process.finished/.traced/.failed)。不同工具的敏感参数(如 ssh 的-i身份文件、-o里的凭据)在同一个格式化函数里加规则,不在别处格式化 argv。 - macOS 构建和插件任务。
MacStreamingProcess、MacRawProcessSession结束时把 argv、退出码、耗时、stderr 末尾原文和 op 交给 Core 的进程轨迹入口,由 Core 脱敏、分级、记录。Swift 不格式化 argv。 MacProcessRunner。 并入第 1 步的事件,补齐 argv、stderr 和来源。在同一次改动里删除run.process.execution,避免同一个进程记两条。- 引擎宿主。
*.process.started补脱敏 argv,并在进程退出时记一条终态。 - 远程 SSH 和 git-host 探测。 探测和会话启动在执行点记录终态。
lithe-agent-host。 记录成功终态和 argv,已有的failure_log失败记录并进同一条终态,不重复。
完成标准:
- 上表每个执行点在执行处只记录一条终态。在日志窗口里按 op 能从
app.action.performed经app.core.request.*找到对应的进程终态。 - 级别和 Git 一致:用户来源成功为 INFO,其余成功或取消为 DEBUG,失败为 WARN。运行时发现、版本探测这类后台调用不因 INFO 刷屏。
- stdout、stdin、进程环境和终端输入永远不记录。有测试证明令牌、密码、用户目录路径、ssh 身份文件不会出现在日志里。
logging.md7.4 从“Git 进程”改写成“外部进程”,列出新事件和各执行点。scripts/logging/verify-log-usage.mjs和对应测试通过。
Target platform / 目标平台
macOS
Area / 模块
Other / 其他
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
Alternatives considered / 已考虑的替代方案
- 只靠 Core 请求轨迹:它只有方法、来源、路径和结果,看不到实际执行的命令、退出码和 stderr。
- 只靠运行控制台:只覆盖用户看得见的运行和构建任务,不覆盖后台探测、引擎宿主和 Agent CLI,也不和 op 关联。
- 每个调用方各自记日志:会出现多套 argv 格式化和脱敏规则,违反“argv 只经过一个集中的脱敏函数”。
Additional context / 补充信息
- 不在本 Issue 范围内:Monaco 编辑器、
lithe-remote服务端进程、Windows 迁移到 v2,这些在 #1680 跟踪。Windows 迁移后可以直接复用第 1 步的 Core 模块。 - 终端 shell(
MacTerminalTransport)不加进程轨迹:交互输入和历史不能进日志。 - 测试里启动的进程不算缺口。
- 相关的另一个缺口:catalog 里的
rate字段目前只是元数据,写入器没有执行限流。新增的进程事件如果声明了rate,需要先解决这一点,建议另开 Issue。 - 粗估工作量:Core 通用模块加 macOS(第 1 到 4 步)约 8 到 12 人日;加上远程 SSH 和
lithe-agent-host约 13 到 20 人日。 - 相关:#1714(Git、Core 请求和用户操作的执行轨迹)、#1680(日志 v2 未覆盖的来源)。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 11h 41m
- Merged PRs (30d)
- 416
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
review: medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
1lck/Lithe-IDEA#1670 ·
Maintainers usually reply within 1 day
-
area:editor bug P0 platform:macos review: low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
1lck/Lithe-IDEA#1118 · 2 comments ·
Maintainers usually reply within 1 day
-
area:extensions bug P2 platform:macos review: high
Difficulty 4/5 3-5 days Newbie friendliness 35/100
1lck/Lithe-IDEA#1781 ·
Maintainers usually reply within 1 day
-
area:other bug P2 platform:windows review: high
Difficulty 4/5 3-5 days Newbie friendliness 48/100
1lck/Lithe-IDEA#1780 ·
Maintainers usually reply within 1 day
-
enhancement issue-form:feature review: low
Difficulty 5/5 Over a week Newbie friendliness 40/100
1lck/Lithe-IDEA#1779 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
documentation easy good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
ranxianglei/billion-context#5893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/monaco-editor#5575 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100