Skip to content

clens-010-import-codex-autodiscover: clens import codex with no path: auto-discover ~/.codex/sessions/ - #19

Merged
silouone merged 1 commit into
mainfrom
adw/clens-010-import-codex-autodiscover
Jul 23, 2026
Merged

silouone merged 1 commit into
mainfrom
adw/clens-010-import-codex-autodiscover

Conversation

@silouone

Copy link
Copy Markdown
Owner

clens-010-import-codex-autodiscover

Ticket: tickets/clens-010-import-codex-autodiscover.md

All gates green: lint ✅, typecheck ✅, test ✅ (1885 pass in CLI, 320 in web, 0 fail).

Summary

Hardened test coverage for clens import codex's no-arg auto-discover feature (clens-010). The build stage already covered the four "done looks like" cases well (CODEX_HOME set, HOME fallback, absent/empty default dir, explicit-path regression, help text). I found one genuine gap: the implementation's docstring claims tests can hermetically override "both branches" of HOME || USERPROFILE, but only HOME was ever exercised.

Added (packages/cli/test/import-command.test.ts):

  • falls back to $USERPROFILE/.codex/sessions when neither CODEX_HOME nor HOME is set — closes the untested USERPROFILE fallback branch.
  • an empty-string CODEX_HOME is treated as unset and falls back to HOME — pins the || truthiness check (empty env var, a realistic shell/CI condition).

I initially also added a third test (all three env vars unset → root /.codex/sessions), but caught via advisor review that it broke hermeticity (depends on real filesystem-root state with no env seam to redirect it) and added no coverage beyond what the other tests already provide — dropped it.

No implementation defects found; packages/cli/src/commands/import.ts and cli.ts are unchanged from the build stage. Left in the working tree per instructions, no git operations performed.

Gates

  • lint — pass

  • typecheck — pass

  • test — pass

  • Gate suite ran in: 18185ms

  • Repair rounds used: 0

  • Total duration: 993715ms

  • Run id: clens-010-import-codex-autodiscover-1784802254898

Captured sessions

  • 67c5b76f-5d65-45a9-8d50-3ad9bb4a3dd7 — /Users/silouane/adw-factory/runs/clens-010-import-codex-autodiscover-1784802254898/.clens/sessions/67c5b76f-5d65-45a9-8d50-3ad9bb4a3dd7.jsonl
  • 3f9f99ff-2dfa-4b26-bf1f-ecb0bc574adb — /Users/silouane/adw-factory/runs/clens-010-import-codex-autodiscover-1784802254898/.clens/sessions/3f9f99ff-2dfa-4b26-bf1f-ecb0bc574adb.jsonl
  • d91b46ef-0d1f-4bf7-b2a6-ea2f031befa8 — /Users/silouane/adw-factory/runs/clens-010-import-codex-autodiscover-1784802254898/.clens/sessions/d91b46ef-0d1f-4bf7-b2a6-ea2f031befa8.jsonl

Opened by adw-factory. A human reviews and merges — the factory never merges,
approves, or closes its own pull requests.

@silouone
silouone merged commit b5435da into main Jul 23, 2026
1 check passed
@silouone
silouone deleted the adw/clens-010-import-codex-autodiscover branch July 23, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant