Repository navigation
fix(codex): preserve heartbeat cadence across aliased homes #7230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ def codex_homes(env: Mapping[str, str] | None = None, user_home: Path | None = N | |
| ``LOOPX_CODEX_HOMES`` (``os.pathsep``-separated) is used verbatim when set. | ||
| Otherwise ``CODEX_HOME``, ``~/.codex`` and sibling ``~/.codex-*`` homes are | ||
| searched, because Codex App installs can each keep their own home. | ||
| Preserve distinct path names: callers also use them as profile aliases. | ||
| Relative entries use the process working directory when their store is read. | ||
| """ | ||
|
|
||
|
|
@@ -328,7 +329,14 @@ def _installed_automation_intervals( | |
|
|
||
| intervals: dict[tuple[str, str, str], int] = {} | ||
| ambiguous: set[tuple[str, str, str]] = set() | ||
| identities: set[Path] = set() | ||
| for home in codex_homes() if homes is None else homes: | ||
| # Discovery retains logical profile names; read each physical store only | ||
| # once here so an alias cannot masquerade as a second installed heartbeat. | ||
| identity = home.resolve() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] Contain home-resolution failures per source. After real discovery returns a valid alias, retargeting it to a loop before this read raises |
||
| if identity in identities: | ||
| continue | ||
| identities.add(identity) | ||
| for path in sorted((home / "automations").glob("*/automation.toml")): | ||
| try: | ||
| item = tomllib.loads(path.read_text(encoding="utf-8")) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Deduplicate actual filesystem identity. On a case-insensitive filesystem, configured
.CODEXand default.codexcan besamefile()with the same device/inode while their resolvedPathvalues differ. I reproduced both ordinary discovery and explicithomescounting one manifest twice and returning no cadence. This is a remaining original defect, not an introduced baseline regression. Keep logical profiles intact and deduplicate filesystem identity only in this reader; add a real case-alias regression.