classifier config path ignores profile, PI_CONFIG_DIR, and XDG
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- tooling
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 2h 10m
- Merged PRs (30d)
- 64
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 STRML/omp-classifier
-
Decide whether a coordinator may lift a headless worker's refusal (the trust boundary #68 defers)Openenhancement ready-for-human
Difficulty 5/5 Over a week Newbie friendliness 25/100
STRML/omp-classifier#142 ·
Maintainers usually reply within 1 day
-
enhancement ready-for-human
Difficulty 4/5 3-5 days Newbie friendliness 45/100
STRML/omp-classifier#116 · 7 comments ·
Maintainers usually reply within 1 day
-
enhancement ready-for-human
Difficulty 5/5 Over a week Newbie friendliness 35/100
STRML/omp-classifier#13 · 6 comments ·
Maintainers usually reply within 1 day
All issues in STRML/omp-classifier
Similar issues
-
bug HemiStake
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
hemilabs/ui-monorepo#2413 ·
Maintainers usually reply within 1 day
-
component/ui framework/react kind/bug language/javascript
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meshery/meshery#22216 · 3 comments ·
Maintainers usually reply within 1 day
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
paperclipai/paperclip#14982 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
lingdojo/kana-dojo#31515 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day