microskills: a command wrapped in bash -lc or zsh -lc is not observed
维护者通常 1 天内回复
评估
调研方向
从 tokeneconomizer/microskills/observe.py 中的 unwrap 和 _WRAP_RE 开始,然后追踪 classify_command 如何调用它。loopguard/turn 中的 _pieces 和 _SHELLS 已经按路径和脚本处理 shell 名称,请参照其做法。运行 issue 中的离线复现。当 bash -lc 'pytest -q'、/bin/zsh -lc 'pytest -q' 和 /bin/bash -lc 'pytest -q' 都返回 [('run_tests', 'pytest')] 时即完成。
由索引模型根据 Issue 内容生成。
描述
unwrap in tokeneconomizer/microskills/observe.py strips a shell wrapper only when it is spelled /bin/bash -lc or /bin/sh -c (_WRAP_RE). Codex runs each shell call as [<user's shell>, "-lc", <script>] (Shell::derive_exec_args in codex-rs), so the shell comes by name or by path, and is /bin/zsh for a user on macOS's default shell. A rollout's argv such as ["bash", "-lc", "pytest -q"] is joined to bash -lc 'pytest -q' (trace.codex._command_text). The observer reads any of these as a command named bash or zsh, so the session shows it no test run, no interpreter run and no package tool, and teaches it nothing. The loop guard already reads all of them by their script (loopguard.turn._pieces, _SHELLS).
Reproduction (offline):
from tokeneconomizer.microskills.observe import classify_command
for cmd in ["/bin/bash -lc 'pytest -q'", "bash -lc 'pytest -q'", "/bin/zsh -lc 'pytest -q'"]:
print(cmd, "->", [(o.intent, o.form) for o in classify_command(cmd)])
Expected: [('run_tests', 'pytest')] for all three
Actual: [('run_tests', 'pytest')] for the first, [] for bash -lc and /bin/zsh -lc
Upstream main: 747b8016538c13da7ba9d455b89e5e6595bf5294
Python 3.13.18, Linux
- 主要语言
- Python
- 星标
- 7.4k
- 派生
- 500
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 123
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/TokenEconomizer 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/TokenEconomizer#360 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
microskills: bundle exec and pnpm exec are recorded as bundle run and pnpm run可能已有人在做 @Shizoqua 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/TokenEconomizer#344 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
README: state the minimum Python version next to the test instructions可能已有人在做 @rahul05ranjan 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
microsoft/TokenEconomizer#328 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
loopguard: a PHPUnit or CTest run is judged without its summary, so a failing run can end a turn green可能已有人在做 @Shizoqua 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
microsoft/TokenEconomizer#353 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
trace: the usage a Pi tool reports on its own result is left out of the session's usage可能已有人在做 @Shizoqua 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
microsoft/TokenEconomizer#352 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 microsoft/TokenEconomizer 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
reasons-gate
难度 2/5 1-3 小时 新手友好度 65/100
benthomasson/reasons-service#190 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
ui
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 3 天内回复