[GH-ISSUE #4625] [Bug] OMP path guidance does not distinguish PI_CONFIG_DIR's home-relative base #2406

Closed
opened 2026-10-17 21:04:14 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @coygeek on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4625

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Documentation

Observed behavior

The OMP section of docs/client-configuration.md groups PI_CONFIG_DIR and PI_CODING_AGENT_DIR beside a working-directory-relative parenthetical without explaining their different bases. A reader applying that parenthetical to PI_CONFIG_DIR predicts a different configuration file from the setup preview. The parenthetical can also be read as applying only to PI_CODING_AGENT_DIR, so the supported defect is ambiguous guidance, rather than an unequivocal promise or a demonstrated resolver bug.

With PI_CONFIG_DIR=relative/dir, setup --client omp --skill=false --dry-run --json plans <trial-home>/relative/dir/agent/mcp.json. Adding PI_CODING_AGENT_DIR=relative/dir/agent changes the destination to <work>/relative/dir/agent/mcp.json. Both tested builds produced these results in two fresh home/work pairs each.

Reproduction

Start with a built checkout or the installed npm package root. The following fixture reproduces the tested command arguments and environment isolation; run it with python3 reproduce.py /absolute/path/to/rea-package. node must be on PATH. It creates and removes disposable directories and runs only dry-run setup.

import json
import os
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile

package = Path(sys.argv[1]).resolve()
node = shutil.which("node")
with tempfile.TemporaryDirectory() as temporary:
    root = Path(temporary)
    home, work = root / "home", root / "work"
    home.mkdir()
    work.mkdir()
    base = {"PATH": os.environ["PATH"], "HOME": str(home), "NO_COLOR": "1"}
    for overrides in [
        {"PI_CONFIG_DIR": "relative/dir"},
        {"PI_CONFIG_DIR": "relative/dir", "PI_CODING_AGENT_DIR": "relative/dir/agent"},
    ]:
        result = subprocess.run(
            [node, str(package / "scripts/rea.mjs"), "setup", "--client", "omp",
             "--skill=false", "--dry-run", "--json"],
            cwd=work, env={**base, **overrides}, capture_output=True, text=True, check=True,
        )
        data = json.loads(result.stdout)
        action = next(a for a in data["plannedActions"] if a["id"] == "configure_client:omp")
        target = action["target"]
        for path, name in [(home, "<trial-home>"), (work, "<work>")]:
            target = target.replace(str(path.resolve()), name).replace(str(path), name)
        print(data["status"], target, data["appliedActions"])
        assert not list(home.rglob("mcp.json")) and not list(work.rglob("mcp.json"))

Expected behavior

Explain both bases explicitly: relative PI_CONFIG_DIR is relative to the home directory, while relative PI_CODING_AGENT_DIR is relative to the setup working directory for the default profile. This matches the observed setup plans and native OMP's published path resolver. Changing REA's resolver is not supported by this evidence.

Impact and scope

The observed impact is confusing configuration-path guidance for users choosing a relative PI_CONFIG_DIR. No configuration write, native OMP loading failure, or data loss was observed. Named profiles and other platforms were not exercised.

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: The demonstrated defect is ambiguous wording; both dry-run destinations match native OMP's source rules, and no consequential runtime malfunction was observed.
  • Workaround status: available
  • Workaround basis: Interpret PI_CONFIG_DIR relative to HOME and inspect the dry-run target. The executed PI_CODING_AGENT_DIR control also selected the intended working-directory destination without applying changes.

REA version

Current main at 0c7b6d834af2d044b23196e0e522cc2468327a1e (package version 6.5.0), built with locked dependencies; separately extracted npm rea-agents@6.5.0 with runtime dependencies installed. Both CLI entrypoints returned 6.5.0 from --version.

Runtime and platform

Node.js v24.18.0; npm 11.16.0; Darwin arm64. The source build used the repository's pinned Node/npm toolchain and completed npm run build:cached.

Target and artifact context

Default-profile OMP user MCP configuration. Each child environment contained only PATH, HOME, NO_COLOR, and the override values shown; OMP_PROFILE and PI_PROFILE were absent. No analysis target or external provider was needed.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

  • Expected source: The current OMP guide omits PI_CONFIG_DIR's home-relative base; the same wording exists in the release-tag guide.
  • Failure source: The public CLI dry-run probe above produced the paths below on both tested builds; src/application/SupportedClients.ts:312-328 selects the home-relative root and working-directory-relative agent override.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Each pair produced the following result in both trials per build, with exit 0 and no configuration files created:

PI_CONFIG_DIR=relative/dir:
planned <trial-home>/relative/dir/agent/mcp.json []

Also PI_CODING_AGENT_DIR=relative/dir/agent:
planned <work>/relative/dir/agent/mcp.json []

Typed outcome or recovery expected

The guide should let a reader predict these two distinct paths before running setup. A documentation correction should preserve the observed dry-run destinations and explain which variable uses which base.

Analysis or suspected cause

Source-derived conclusion: REA's resolver matches native OMP; the missing distinction belongs in the documentation. OMP's latest published release, 18.11.3, documents PI_CONFIG_DIR as a config-root dirname under home in its environment-variable reference. Its path helpers join that name to home; the same file resolves the default-profile agent override with path.resolve at lines 342-348 and reads PI_CODING_AGENT_DIR at lines 471-486. The published pi-utils source matches that release file. Native OMP was not executed.

Additional context

Searched open and closed issues and PRs for PI_CONFIG_DIR, PI_CODING_AGENT_DIR, and OMP. The original integration (#1257 and PR #1301), invalid-profile report (#1561), native-client HOME isolation report (#1625), client-path correction (PR #1504), and documentation audit (#2156) cover other behavior and do not document this missing distinction. No duplicate was found in those searches. The last known good documentation revision is unknown.

Originally created by @coygeek on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4625 ### Before submitting - [X] I searched the open and closed issues for a related report. - [X] I removed credentials, tokens, private paths, and sensitive target data. ### Area Documentation ### Observed behavior The OMP section of `docs/client-configuration.md` groups `PI_CONFIG_DIR` and `PI_CODING_AGENT_DIR` beside a working-directory-relative parenthetical without explaining their different bases. A reader applying that parenthetical to `PI_CONFIG_DIR` predicts a different configuration file from the setup preview. The parenthetical can also be read as applying only to `PI_CODING_AGENT_DIR`, so the supported defect is ambiguous guidance, rather than an unequivocal promise or a demonstrated resolver bug. With `PI_CONFIG_DIR=relative/dir`, `setup --client omp --skill=false --dry-run --json` plans `<trial-home>/relative/dir/agent/mcp.json`. Adding `PI_CODING_AGENT_DIR=relative/dir/agent` changes the destination to `<work>/relative/dir/agent/mcp.json`. Both tested builds produced these results in two fresh home/work pairs each. ### Reproduction Start with a built checkout or the installed npm package root. The following fixture reproduces the tested command arguments and environment isolation; run it with `python3 reproduce.py /absolute/path/to/rea-package`. `node` must be on PATH. It creates and removes disposable directories and runs only dry-run setup. ```python import json import os from pathlib import Path import shutil import subprocess import sys import tempfile package = Path(sys.argv[1]).resolve() node = shutil.which("node") with tempfile.TemporaryDirectory() as temporary: root = Path(temporary) home, work = root / "home", root / "work" home.mkdir() work.mkdir() base = {"PATH": os.environ["PATH"], "HOME": str(home), "NO_COLOR": "1"} for overrides in [ {"PI_CONFIG_DIR": "relative/dir"}, {"PI_CONFIG_DIR": "relative/dir", "PI_CODING_AGENT_DIR": "relative/dir/agent"}, ]: result = subprocess.run( [node, str(package / "scripts/rea.mjs"), "setup", "--client", "omp", "--skill=false", "--dry-run", "--json"], cwd=work, env={**base, **overrides}, capture_output=True, text=True, check=True, ) data = json.loads(result.stdout) action = next(a for a in data["plannedActions"] if a["id"] == "configure_client:omp") target = action["target"] for path, name in [(home, "<trial-home>"), (work, "<work>")]: target = target.replace(str(path.resolve()), name).replace(str(path), name) print(data["status"], target, data["appliedActions"]) assert not list(home.rglob("mcp.json")) and not list(work.rglob("mcp.json")) ``` ### Expected behavior Explain both bases explicitly: relative `PI_CONFIG_DIR` is relative to the home directory, while relative `PI_CODING_AGENT_DIR` is relative to the setup working directory for the default profile. This matches the observed setup plans and native OMP's published path resolver. Changing REA's resolver is not supported by this evidence. ### Impact and scope The observed impact is confusing configuration-path guidance for users choosing a relative `PI_CONFIG_DIR`. No configuration write, native OMP loading failure, or data loss was observed. Named profiles and other platforms were not exercised. - Impact level: P3 - Assessment status: supported - Impact basis: The demonstrated defect is ambiguous wording; both dry-run destinations match native OMP's source rules, and no consequential runtime malfunction was observed. - Workaround status: available - Workaround basis: Interpret `PI_CONFIG_DIR` relative to HOME and inspect the dry-run target. The executed `PI_CODING_AGENT_DIR` control also selected the intended working-directory destination without applying changes. ### REA version Current `main` at `0c7b6d834af2d044b23196e0e522cc2468327a1e` (package version 6.5.0), built with locked dependencies; separately extracted npm `rea-agents@6.5.0` with runtime dependencies installed. Both CLI entrypoints returned `6.5.0` from `--version`. ### Runtime and platform Node.js v24.18.0; npm 11.16.0; Darwin arm64. The source build used the repository's pinned Node/npm toolchain and completed `npm run build:cached`. ### Target and artifact context Default-profile OMP user MCP configuration. Each child environment contained only PATH, HOME, NO_COLOR, and the override values shown; `OMP_PROFILE` and `PI_PROFILE` were absent. No analysis target or external provider was needed. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence - Expected source: The [current OMP guide](https://github.com/morluto/rea/blob/0c7b6d834af2d044b23196e0e522cc2468327a1e/docs/client-configuration.md#L264-L273) omits `PI_CONFIG_DIR`'s home-relative base; the same wording exists in the [release-tag guide](https://github.com/morluto/rea/blob/rea-agents-6.5.0/docs/client-configuration.md#L213-L222). - Failure source: The public CLI dry-run probe above produced the paths below on both tested builds; `src/application/SupportedClients.ts:312-328` selects the home-relative root and working-directory-relative agent override. - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete Each pair produced the following result in both trials per build, with exit 0 and no configuration files created: ```text PI_CONFIG_DIR=relative/dir: planned <trial-home>/relative/dir/agent/mcp.json [] Also PI_CODING_AGENT_DIR=relative/dir/agent: planned <work>/relative/dir/agent/mcp.json [] ``` ### Typed outcome or recovery expected The guide should let a reader predict these two distinct paths before running setup. A documentation correction should preserve the observed dry-run destinations and explain which variable uses which base. ### Analysis or suspected cause Source-derived conclusion: REA's resolver matches native OMP; the missing distinction belongs in the documentation. OMP's latest published release, 18.11.3, documents `PI_CONFIG_DIR` as a config-root dirname under home in its [environment-variable reference](https://github.com/can1357/oh-my-pi/blob/96894a6147d8cc64b7e00ad3a7d7178fd93b9531/docs/environment-variables.md#L550-L555). Its [path helpers](https://github.com/can1357/oh-my-pi/blob/96894a6147d8cc64b7e00ad3a7d7178fd93b9531/packages/utils/src/dirs.ts#L114-L121) join that name to home; the same file resolves the default-profile agent override with `path.resolve` at lines 342-348 and reads `PI_CODING_AGENT_DIR` at lines 471-486. The published `pi-utils` source matches that release file. Native OMP was not executed. ### Additional context Searched open and closed issues and PRs for `PI_CONFIG_DIR`, `PI_CODING_AGENT_DIR`, and OMP. The original integration (#1257 and PR #1301), invalid-profile report (#1561), native-client HOME isolation report (#1625), client-path correction (PR #1504), and documentation audit (#2156) cover other behavior and do not document this missing distinction. No duplicate was found in those searches. The last known good documentation revision is unknown.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

Checked the reported fix on main at d87e73f2db.

The OMP guide now explicitly distinguishes relative PI_CONFIG_DIR as home-relative and default-profile PI_CODING_AGENT_DIR as setup-working-directory-relative; it also explains named profiles ignore the latter. This is the requested documentation correction, preserving resolver behavior. The resolver still joins the configuration root to context.home and resolves the agent override against cwd.

Implementation: client-configuration.md, SupportedClients.ts.

The relevant regression checks in ompClientConfiguration.test.ts passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.

<!-- gh-comment-id:6380699233 --> @coygeek commented on GitHub (Oct 24, 2026): Checked the reported fix on `main` at d87e73f2db50be72d33a4b3c7199af35518b441c. The OMP guide now explicitly distinguishes relative PI_CONFIG_DIR as home-relative and default-profile PI_CODING_AGENT_DIR as setup-working-directory-relative; it also explains named profiles ignore the latter. This is the requested documentation correction, preserving resolver behavior. The resolver still joins the configuration root to context.home and resolves the agent override against cwd. Implementation: [client-configuration.md](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/docs/client-configuration.md#L389), [SupportedClients.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/application/SupportedClients.ts#L312). The relevant regression checks in [ompClientConfiguration.test.ts](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/tests/boundary/filesystem/ompClientConfiguration.test.ts) passed in the focused test run on this revision. This closure is based on the current source and those checks; provider fixtures do not establish a real-engine run. Closing as completed on main.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2406
No description provided.