Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

classifier config path ignores profile, PI_CONFIG_DIR, and XDG

Closed
#9 2 comments 0 reactions 0 assignees View on GitHub

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

bug ready-for-agent

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from STRML/omp-classifier

All issues in STRML/omp-classifier

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.