classifier config path ignores profile, PI_CONFIG_DIR, and XDG
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- tooling
调研方向
Start in index.ts at classifierConfigPath() and review PR #8 for the host lockfile resolver pattern. Inspect the referenced pi-utils directory and profile-resolution behavior, including the existing environment-variable override and related tests. Done means profile, PI_CONFIG_DIR, and XDG resolution no longer share one classifier file, while OMP_BASH_CLASSIFIER_CONFIG and the test suite continue to work.
由索引模型根据 Issue 内容生成。
描述
classifierConfigPath() hand-builds ~/.omp/omp-bash-classifier.json, so the plugin's own config is invisible under a profile, PI_CONFIG_DIR, or XDG.
index.ts:290:
return process.env.OMP_BASH_CLASSIFIER_CONFIG ?? path.join(os.homedir(), ".omp", "omp-bash-classifier.json");
Three env inputs move where the host would put that file: OMP_PROFILE/PI_PROFILE gives ~/.omp/profiles/<name>/, PI_CONFIG_DIR replaces the .omp segment, and on darwin and linux XDG_DATA_HOME applies when $XDG_DATA_HOME/omp exists. getConfigDirName() is process.env.PI_CONFIG_DIR || CONFIG_DIR_NAME (pi-utils src/dirs.ts), and the profile root sits under getProfileConfigRoot.
What that costs: run under --profile work and /classifier enabled false writes to a path resolved the same wrong way, so at least it round-trips. The break is that every profile shares one config file. Turn the classifier off in your work profile and it goes off everywhere, with no indication that happened.
PR #8 hit the identical bug for the host lockfile and fixed it by calling the host resolver:
import { getPluginsLockfile } from "@oh-my-pi/pi-utils";
That import is safe where import { settings } is not, which the header comment at the top of index.ts warns about. settings is a host-initialized singleton and a plugin-local copy throws. The dirs resolver derives from process.env at module load, and the host has populated it before a plugin binds.
There is no getBashClassifierConfig() to call, so this one needs the path composed from the resolver rather than a single function: something like path.join(dirs-resolved config root, "omp-bash-classifier.json"). Worth checking whether the file belongs beside the agent dir or under the config root before picking.
Keep OMP_BASH_CLASSIFIER_CONFIG as-is. The test suite depends on it to stay off the real file.
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 1
- 平均合并
- 3 小时 21 分钟
- 30 天内合并 PR
- 49
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
STRML/omp-classifier 的其他 Issue
-
Decide whether a coordinator may lift a headless worker's refusal (the trust boundary #68 defers)未关闭enhancement ready-for-human
难度 5/5 一周以上 新手友好度 25/100
STRML/omp-classifier#142 ·
维护者通常 1 天内回复
-
enhancement ready-for-human
难度 4/5 3-5 天 新手友好度 45/100
STRML/omp-classifier#116 · 9 条评论 ·
维护者通常 1 天内回复
-
enhancement ready-for-human
难度 5/5 一周以上 新手友好度 35/100
STRML/omp-classifier#13 · 6 条评论 ·
维护者通常 1 天内回复
查看 STRML/omp-classifier 的全部 Issue
相似的 Issue
-
area: aria/combobox gemini-triaged
难度 2/5 1-3 小时 新手友好度 78/100
angular/components#33973 ·
维护者通常 1 天内回复
-
bug priority: P2
难度 1/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
[bug] status, list and push crash with an uncaught NotInitializedError stack trace when teamai is not initialized可能已有人在做 @jay23606 今天认领。 未关闭bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 84/100
Tencent/teamai-cli#1227 ·
维护者通常 1 天内回复
-
[Tool]: Yap未关闭
难度 1/5 1-3 小时 新手友好度 62/100
withkarann/aifoxx#417 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
sindresorhus/eslint-plugin-unicorn#3921 ·
维护者通常 1 天内回复