Skip to content

feat(plugins): share Codex hook defaults - #1137

Merged
phernandez merged 10 commits into
mainfrom
codex/user-level-capture-events
Jul 21, 2026
Merged

feat(plugins): share Codex hook defaults#1137
phernandez merged 10 commits into
mainfrom
codex/user-level-capture-events

Conversation

@phernandez

@phernandez phernandez commented Jul 21, 2026

Copy link
Copy Markdown
Member

Why

Codex lifecycle capture was opt-in and repository-scoped, which made it easy for sessions to run without producing any capture envelopes. Repeating the same defaults in every checkout also made shared Codex configuration awkward and allowed repositories to write into the same checkpoint folder.

What Changed

  • Merge ~/.codex/basic-memory.json with the nearest project .codex/basic-memory.json, with project keys taking precedence.
  • Accumulate user and project redactKeys/redactPaths so project config cannot weaken global privacy rules.
  • Enable Codex lifecycle-event capture by default while preserving an explicit boolean false opt-out and fail-closed malformed settings.
  • Treat any malformed user or project config as a sticky failure for the event, preventing later settings from restoring capture or checkpoint routing without the missing redaction policy.
  • Default checkpoint placement to codex/<repo-dir> using the Git top-level directory name.
  • Keep sessionProfile: "coding" and the confirmed repository identity together in the project file when shared defaults are user-scoped.
  • Update the Codex setup and companion skills to explain the two configuration levels and recommend user-level setup.
  • Extend hook and plugin validation coverage for precedence, opt-out behavior, malformed settings, repository-specific folders, cumulative redaction, and repository-scoped coding profiles.
  • Advance both packaged Codex hook launchers to the tested core implementation commit.

Implementation Details

The hook command owns the merge and default resolution so marketplace hook shims remain logic-free. Defaults are applied before the user and project blocks are merged; an explicit setting at either level wins. Redaction lists are the deliberate exception: valid string entries are deduplicated in user-then-project order and cannot be cleared by an empty project value. If either configured source is malformed, evaluation returns the capture-disabled defaults immediately, so neither envelope capture nor PreCompact checkpoint routing can combine a later route with a missing earlier redaction policy. For user-level setups, repository-scoped coding mode and identity stay together in the project file, while the user file carries only defaults that are safe to share across repositories.

The PEP 723 launchers pin bd5d145d, the implementation commit containing the final hook behavior and tests. The later pin-only commit keeps that revision reachable as an ancestor; release automation will replace it with the release tag.

Testing

Automated

  • uv run pytest tests/test_codex_plugin_package.py tests/cli/test_hook_command.py -q: 109 passed.
  • just fast-check: passed lint, format, and type checks.
  • just package-check: passed all consolidated package validation suites.

Manual

  • Ran uv run basic-memory hook status --harness codex --project-dir /Users/phernandez/dev/basicmachines/basic-memory-cloud with a user-level captureEvents: true setting and no repository capture override: reported capture events: on and capture folder: codex/basic-memory-cloud while retaining the project-specific mapping.

Risks / Follow-ups

  • Existing installations must refresh the plugin after this lands to pick up the new skills and pinned hook launchers.

@phernandez
phernandez force-pushed the codex/user-level-capture-events branch from c7dd400 to 83ee580 Compare July 21, 2026 14:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c7dd400f3f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/codex/README.md Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez force-pushed the codex/user-level-capture-events branch from 83ee580 to 9a7c140 Compare July 21, 2026 14:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a7c14075f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/codex/README.md
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4300433968

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/cli/commands/hook.py
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4a1262ff6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/codex/skills/bm-setup/SKILL.md Outdated
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40e00b2541

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/codex/skills/bm-setup/SKILL.md Outdated
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b3abe607d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/cli/commands/hook.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc4b535e76

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/cli/commands/hook.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: d5ceb60e5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@phernandez
phernandez merged commit 0a52e32 into main Jul 21, 2026
30 checks passed
@phernandez
phernandez deleted the codex/user-level-capture-events branch July 21, 2026 18:41
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