Skip to content

fix(plugin): wire Codex env and release binaries - #222

Merged
thebtf merged 4 commits into
mainfrom
codex/fix-codex-plugin-env
Jun 3, 2026
Merged

fix(plugin): wire Codex env and release binaries#222
thebtf merged 4 commits into
mainfrom
codex/fix-codex-plugin-env

Conversation

@thebtf

@thebtf thebtf commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a native Codex plugin manifest and validator-compatible MCP entrypoint
  • support Codex PLUGIN_ROOT/PLUGIN_DATA env plus Claude userConfig compatibility envs in the shared wrapper
  • fix cmd/engram release version injection and make marketplace sync run after Release Binary succeeds

Verification

  • python C:\Users\btf\.codex\skills\.system\plugin-creator\scripts\validate_plugin.py plugin/engram
  • node --check plugin/engram/scripts/run-engram.js
  • node --check plugin/engram/scripts/ensure-binary.js
  • go build ./...
  • go vet ./...
  • go test ./...
  • go test -tags=critical ./tests/critical/...
  • local Release Binary matrix cross-build for linux-amd64, darwin-arm64, windows-amd64.exe with v6.4.4 version smoke

Release notes

Patch release target: v6.4.4. Do not tag until CI is green and the release branch is merged to main.

Summary by CodeRabbit

  • New Features

    • Добавлена поддержка отдельного Codex‑плагина с собственным манифестом и конфигурацией; добавлен локальный клиент‑бинар и механика генерации двух плагин‑пакетов.
  • Bug Fixes

    • Валидация версии Linux‑бинарника перед публикацией; включён Codex‑манифест в релизные архивы.
    • Улучшена обработка окружения и токенов — быстрый фейл при отсутствии учётных данных и более надёжное разрешение переменных.
  • Documentation

    • Обновлены инструкции настройки и диагностики для Claude Code и Codex.
  • Chores

    • Расширены CI/CD‑триггеры: синхронизация Marketplace запускается после успешного релиза бинарника; версия теперь экспортируется в сборки.

Add a native Codex plugin manifest, make the shared MCP wrapper accept Codex env and Claude userConfig compatibility values, and fail fast on missing workstation credentials.

Fix release binary version injection for cmd/engram and make marketplace sync run after successful Release Binary so plugin installs only advance after downloadable assets exist.

Verification: validate_plugin.py plugin/engram; node --check plugin wrappers; go build ./...; go vet ./...; go test ./...; go test -tags=critical ./tests/critical/...; local release-binary matrix cross-build.
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72c1d84d-072a-4e8c-a1ec-7ba6a1586191

📥 Commits

Reviewing files that changed from the base of the PR and between 40eacf8 and 36bc8b7.

📒 Files selected for processing (1)
  • Makefile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile

Walkthrough

PR вводит версию 6.4.4 с нативной поддержкой Codex-плагина наряду с Claude-плагином, переводит Daemon на var и инжектит версию в сборку, добавляет проверку собранного бинарника, перерабатывает runtime-скрипты плагина и обновляет документацию и release-автоматику.

Changes

Release v6.4.4 with Codex Plugin Support

Layer / File(s) Summary
Version infrastructure and build tooling
internal/version/version.go, cmd/engram/main.go, internal/handlers/engramcore/tools.go, Makefile, Dockerfile, .github/workflows/release-binary.yml
Переключение Daemon с const на var, обновление версии на v6.4.4, инъекция версии через LDFLAGS в инструменты сборки и добавление проверки --version собранного бинарника в release workflow для Linux.
Codex plugin artifacts and release packaging
plugin/engram/.codex-plugin/plugin.json, plugin/engram/.claude-plugin/plugin.json, plugin/engram/.mcp.json, .goreleaser.yaml
Добавление конфигурации Codex-плагина (версия 6.4.4), обновление Claude manifest, изменение MCP запуска на inline node -e и расширение GoReleaser архивов для включения .codex-plugin/*.
Plugin runtime startup and validation scripts
plugin/engram/scripts/ensure-binary.js, plugin/engram/scripts/run-engram.js, plugin/engram/hooks/lib.js, plugin/engram/hooks/session-start.js
Ревизия логики запуска: выбор plugin.json в .codex-plugin / .claude-plugin, функция firstExistingPath, вызов ensure-binary.js при отсутствии бинарника, строгая валидация ENGRAM_URL/ENGRAM_TOKEN с fail-fast, смена источника bearer-токена на ENGRAM_TOKEN.
User documentation updates
plugin/engram/commands/setup.md, plugin/engram/commands/doctor.md
Добавлен раздел Codex setup, явные инструкции по обновлению ~/.codex/config.toml и ~/.claude/settings.json, обновлённые диагностические подсказки и перезапуск агентов.
Build scripts and release automation
scripts/generate-plugin-config.sh, .github/workflows/sync-marketplace.yml, CHANGELOG.md
generate-plugin-config.sh теперь формирует .claude-plugin и .codex-plugin и проверяет совпадение версий manifest-ов; sync-marketplace workflow расширен триггерами (workflow_run, workflow_dispatch) и условием выполнения; обновлён CHANGELOG с релиз-заметками v6.4.4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • thebtf/engram#217: изменения, связанные с плагинными hook-ами и отправкой webhook/адаптивной памяти, могут затрагивать поведение плагина и runtime-интеграции.

Poem

🐰 Свежий релиз — Codex рядом с Claude,
Скрипты проверят версию, бинарник не обманет.
Токен и URL найдены — запуск без бед,
Marketplace синхронит, пакеты в комплект.
v6.4.4 шагает в свет — лови момент, привет!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding Codex plugin environment wiring and fixing release binaries.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-codex-plugin-env

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces native support for Desktop Codex alongside Claude Code by adding a Codex plugin manifest, updating build and packaging configurations, and refactoring the Node.js wrapper scripts to handle Codex-specific environment variables and paths. Feedback suggests failing fast in the SessionStart hook if ENGRAM_TOKEN is missing to prevent unnecessary network requests that would result in authentication failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread plugin/engram/hooks/session-start.js Outdated
Comment on lines 138 to 140
if (!process.env.ENGRAM_URL) {
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet environment variables to connect to your Engram server:\n export ENGRAM_URL=http://your-server:37777/mcp\n export ENGRAM_AUTH_ADMIN_TOKEN=your-token\nThen restart Claude Code.\n</engram-setup>';
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet ENGRAM_URL and ENGRAM_TOKEN to connect to your Engram server.\nClaude Code: run /engram:setup or edit ~/.claude/settings.json env.\nCodex: edit ~/.codex/config.toml [shell_environment_policy.set].\nNever put ENGRAM_AUTH_ADMIN_TOKEN on a workstation.\n</engram-setup>';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since the v6 token model strictly requires ENGRAM_TOKEN when ENGRAM_URL is configured, we should also fail fast in the SessionStart hook if ENGRAM_TOKEN is missing. Otherwise, the hook will attempt a live network request to the server, fail with a 401/403 authentication error, and print a warning to stderr before falling back to a stale or empty cache. Adding a check for process.env.ENGRAM_TOKEN here prevents unnecessary network requests and provides immediate, actionable feedback.

Suggested change
if (!process.env.ENGRAM_URL) {
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet environment variables to connect to your Engram server:\n export ENGRAM_URL=http://your-server:37777/mcp\n export ENGRAM_AUTH_ADMIN_TOKEN=your-token\nThen restart Claude Code.\n</engram-setup>';
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet ENGRAM_URL and ENGRAM_TOKEN to connect to your Engram server.\nClaude Code: run /engram:setup or edit ~/.claude/settings.json env.\nCodex: edit ~/.codex/config.toml [shell_environment_policy.set].\nNever put ENGRAM_AUTH_ADMIN_TOKEN on a workstation.\n</engram-setup>';
}
if (!process.env.ENGRAM_URL || !process.env.ENGRAM_TOKEN) {
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet ENGRAM_URL and ENGRAM_TOKEN to connect to your Engram server.\nClaude Code: run /engram:setup or edit ~/.claude/settings.json env.\nCodex: edit ~/.codex/config.toml [shell_environment_policy.set].\nNever put ENGRAM_AUTH_ADMIN_TOKEN on a workstation.\n</engram-setup>';
}

@coderabbitai coderabbitai 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.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sync-marketplace.yml:
- Around line 24-27: The workflow uses floating tags for the checkout action
(uses: actions/checkout@v4) in two places (e.g., the step named "Checkout
engram"); replace both occurrences with the exact commit SHA for the
actions/checkout repository (uses: actions/checkout@<full_commit_sha>) so the
action is pinned to a specific commit, preserving the existing with: ref: ...
input and keeping both checkout steps updated to the same pinned SHA.

In `@CHANGELOG.md`:
- Around line 10-32: Add a new reference link for the released section by adding
a "[6.4.4]:" footnote entry at the bottom of CHANGELOG.md that points to the
tag/range for v6.4.4, and update the existing "[Unreleased]:" reference to use
the new range "v6.4.4...HEAD" so the two link labels [6.4.4] and [Unreleased]
resolve correctly; edit the reference block at the end of the file where link
labels are defined to insert the [6.4.4] entry and adjust [Unreleased]
accordingly.

In `@Makefile`:
- Around line 4-5: Add a Makefile target that builds the MCP client binary at
./cmd/engram (e.g., target name "engram" or "client") using the existing LDFLAGS
so VERSION and internal/version.Daemon are embedded, and make the top-level
build target depend on that new target; specifically, create a rule that runs go
build -o bin/engram $(LDFLAGS) ./cmd/engram and add that target as a dependency
of the existing build target so make build also compiles and validates the
cmd/engram entry point.

In `@plugin/engram/hooks/session-start.js`:
- Around line 137-139: The guard in handleSessionStart currently only checks
process.env.ENGRAM_URL and shows the setup banner, but the logic should also
check process.env.ENGRAM_TOKEN so you don't proceed to network calls without
Authorization; update the guard in async function handleSessionStart to verify
both ENGRAM_URL and ENGRAM_TOKEN (e.g., if either is missing) and return the
same engram-setup banner instructing to set ENGRAM_URL and ENGRAM_TOKEN,
ensuring subsequent code that performs the network request will only run when
both env vars are present.

In `@plugin/engram/scripts/run-engram.js`:
- Around line 23-38: The wrapper only checks fs.existsSync(binaryPath) before
skipping ensure-binary.js; change run-engram.js to also verify the binary
version and invoke ensure-binary.js when the installed binary version is older
than the manifest-required version: obtain the required version from the plugin
manifest (or equivalent variable in this module), run the existing binary with a
safe version probe (e.g., spawnSync(binaryPath, ['--version'] or read sidecar
metadata) and parse the output, compare semver (or simple string) to the
required version, and if missing or lower, run the ensureBinary path exactly as
currently implemented (same env/stdio) so the binary is replaced/updated; keep
the existing fallback to only run ensure-binary.js when either missing or
version mismatched, and preserve the same variables: binaryPath, ensureBinary,
pluginRoot, pluginData.

In `@scripts/generate-plugin-config.sh`:
- Around line 19-25: Before copying, read and compare the "version" field from
plugin/engram/.claude-plugin/plugin.json and
plugin/engram/.codex-plugin/plugin.json and fail fast if they differ: extract
plugin.json.version from both source files (e.g., via jq or another JSON
parser), if values are unequal print a clear error including both versions and
exit non-zero, otherwise continue to run the existing cp commands that write to
$CLAUDE_OUTPUT_DIR/plugin.json and $CODEX_OUTPUT_DIR/plugin.json; ensure the
check runs before any cp and references the source files and the variables
CLAUDE_OUTPUT_DIR and CODEX_OUTPUT_DIR so the script refuses to proceed on
mismatch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8fe24c59-6a69-42fa-84c2-8bd842c80e59

📥 Commits

Reviewing files that changed from the base of the PR and between 37242f1 and 90b0879.

📒 Files selected for processing (19)
  • .github/workflows/release-binary.yml
  • .github/workflows/sync-marketplace.yml
  • .goreleaser.yaml
  • CHANGELOG.md
  • Dockerfile
  • Makefile
  • cmd/engram/main.go
  • internal/handlers/engramcore/tools.go
  • internal/version/version.go
  • plugin/engram/.claude-plugin/plugin.json
  • plugin/engram/.codex-plugin/plugin.json
  • plugin/engram/.mcp.json
  • plugin/engram/commands/doctor.md
  • plugin/engram/commands/setup.md
  • plugin/engram/hooks/lib.js
  • plugin/engram/hooks/session-start.js
  • plugin/engram/scripts/ensure-binary.js
  • plugin/engram/scripts/run-engram.js
  • scripts/generate-plugin-config.sh

Comment thread .github/workflows/sync-marketplace.yml
Comment thread CHANGELOG.md
Comment thread Makefile
Comment thread plugin/engram/hooks/session-start.js
Comment thread plugin/engram/scripts/run-engram.js Outdated
Comment thread scripts/generate-plugin-config.sh Outdated

@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: 352f93ae41

ℹ️ 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 plugin/engram/hooks/session-start.js Outdated
Comment on lines +138 to +139
if (!isConfiguredEnvValue(process.env.ENGRAM_URL) || !isConfiguredEnvValue(process.env.ENGRAM_TOKEN)) {
return '<engram-setup>\nEngram plugin is installed but not configured.\nSet ENGRAM_URL and ENGRAM_TOKEN to connect to your Engram server.\nClaude Code: run /engram:setup or edit ~/.claude/settings.json env.\nCodex: edit ~/.codex/config.toml [shell_environment_policy.set].\nNever put ENGRAM_AUTH_ADMIN_TOKEN on a workstation.\n</engram-setup>';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve session-start for Claude userConfig installs

When Claude users configure the plugin through the /config UI/userConfig path, this commit now maps those values to ENGRAM_CLAUDE_USERCONFIG_URL and ENGRAM_CLAUDE_USERCONFIG_TOKEN for the MCP wrapper (.mcp.json and run-engram.js both consume those fallbacks), but the SessionStart hook still gates on only ENGRAM_URL and ENGRAM_TOKEN. In that configuration the MCP daemon can authenticate successfully while the hook always returns <engram-setup> and skips fetching/injecting static memories, rules, and issues; normalize the same fallback envs before this check or otherwise keep the documented userConfig path working for hooks too.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (3)
plugin/engram/hooks/session-start.js (1)

222-232: ⚡ Quick win

Дублирование isConfiguredEnvValue в двух файлах.

Функция isConfiguredEnvValue идентична по логике с isConfiguredValue в run-engram.js. Рассмотрите вынос в hooks/lib.js для единого источника истины и упрощения сопровождения.

♻️ Предлагаемый рефакторинг

В hooks/lib.js добавьте:

function isConfiguredEnvValue(value) {
  if (typeof value !== 'string') {
    return false;
  }
  const trimmed = value.trim();
  if (trimmed === '') {
    return false;
  }
  return !/^\$\{[^}]+\}$/.test(trimmed);
}

module.exports = {
  // ... existing exports
  isConfiguredEnvValue,
};

Затем используйте lib.isConfiguredEnvValue в обоих скриптах.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugin/engram/hooks/session-start.js` around lines 222 - 232, The function
isConfiguredEnvValue is duplicated; extract it into hooks/lib.js as a single
exported helper (export named isConfiguredEnvValue) and then remove the local
copies in session-start.js and run-engram.js, replacing their usages with calls
to lib.isConfiguredEnvValue (or the import alias you use when requiring
hooks/lib.js); ensure the exported name matches the callers and update
require/import statements in both files to import the helper from hooks/lib.js.
plugin/engram/scripts/run-engram.js (1)

98-117: 💤 Low value

Рассмотрите расширение фильтрации плейсхолдеров.

Регулярное выражение /^\$\{[^}]+\}$/ отклоняет только строки, состоящие целиком из одного плейсхолдера ${...}. Значения вроде https://${HOST} или ${A}${B} пройдут проверку и вызовут сбой позже при сетевом вызове.

Если такие частичные плейсхолдеры возможны в конфигурации (например, пользователь скопировал шаблон из документации), стоит проверять наличие ${ в любом месте строки.

♻️ Возможное исправление
 function isConfiguredValue(value) {
   if (typeof value !== "string") {
     return false;
   }
   const trimmed = value.trim();
   if (!trimmed) {
     return false;
   }
-  return !/^\$\{[^}]+\}$/.test(trimmed);
+  // Reject any value containing unsubstituted ${...} placeholders
+  return !/\$\{[^}]+\}/.test(trimmed);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugin/engram/scripts/run-engram.js` around lines 98 - 117, The
isConfiguredValue function currently only rejects strings that are exactly a
single placeholder via /^\$\{[^}]+\}$/, allowing partial templates like
"https://${HOST}" or "${A}${B}" to slip through; update isConfiguredValue (used
by configuredEnvValue) to also return false if the trimmed value contains the
sequence "${" anywhere (e.g., if (trimmed.includes("${")) return false;) so any
partial/embedded placeholders are treated as unconfigured and filtered out
before being returned by configuredEnvValue.
scripts/generate-plugin-config.sh (1)

12-25: 💤 Low value

Предыдущая проблема устранена; опционально — добавить валидацию непустой версии.

Добавление функции read_manifest_version и fail-fast проверки на строках 22-25 полностью решает проблему, поднятую в предыдущем review: теперь скрипт отказывается продолжать работу, если версии в .claude-plugin/plugin.json и .codex-plugin/plugin.json расходятся, что предотвращает ситуацию, когда Claude и Codex тянут разные релизы.

Опциональное улучшение: сейчас read_manifest_version возвращает пустую строку, если поле version отсутствует в JSON (строка 16). Если обе manifest-файла будут иметь пропущенное поле версии, проверка "$CLAUDE_VERSION" != "$CODEX_VERSION" пропустит это (обе пустые строки равны). Хотя это маловероятный edge case (manifest'ы закоммичены и проверены), добавление валидации [ -z "$CLAUDE_VERSION" ] перед сравнением сделало бы скрипт более защищённым.

♻️ Опциональное улучшение: проверка непустой версии
 CLAUDE_VERSION="$(read_manifest_version "$CLAUDE_MANIFEST")"
 CODEX_VERSION="$(read_manifest_version "$CODEX_MANIFEST")"
 
+if [ -z "$CLAUDE_VERSION" ] || [ -z "$CODEX_VERSION" ]; then
+  echo "Plugin manifest version is empty: CLAUDE=$CLAUDE_VERSION, CODEX=$CODEX_VERSION" >&2
+  exit 1
+fi
+
 if [ "$CLAUDE_VERSION" != "$CODEX_VERSION" ]; then
   echo "Plugin manifest version mismatch: $CLAUDE_MANIFEST=$CLAUDE_VERSION, $CODEX_MANIFEST=$CODEX_VERSION" >&2
   exit 1
 fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-plugin-config.sh` around lines 12 - 25, Add a pre-check for
empty manifest versions before the existing comparison: after obtaining
CLAUDE_VERSION and CODEX_VERSION (from read_manifest_version), test if either is
empty (e.g., [ -z "$CLAUDE_VERSION" ] || [ -z "$CODEX_VERSION" ]) and exit
non‑zero with a clear error via stderr that names the manifest(s) missing a
version; then proceed to the existing inequality check between CLAUDE_VERSION
and CODEX_VERSION. This uses the existing symbols read_manifest_version,
CLAUDE_VERSION and CODEX_VERSION to locate where to insert the validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 65: The global export CGO_ENABLED=1 causes the engram target to produce a
CGO-dependent binary locally; change the engram make target to explicitly build
with CGO_DISABLED by setting CGO_ENABLED=0 for that target's build command
(e.g., prefix the go build invocation for cmd/engram with CGO_ENABLED=0 and
preserve existing LDFLAGS), or alternatively remove the global export and set
CGO_ENABLED only for tests—ensure the make target named "engram" (and the
dependency chain from "build") forces CGO_ENABLED=0 so local artifacts match the
CI release workflow.

---

Nitpick comments:
In `@plugin/engram/hooks/session-start.js`:
- Around line 222-232: The function isConfiguredEnvValue is duplicated; extract
it into hooks/lib.js as a single exported helper (export named
isConfiguredEnvValue) and then remove the local copies in session-start.js and
run-engram.js, replacing their usages with calls to lib.isConfiguredEnvValue (or
the import alias you use when requiring hooks/lib.js); ensure the exported name
matches the callers and update require/import statements in both files to import
the helper from hooks/lib.js.

In `@plugin/engram/scripts/run-engram.js`:
- Around line 98-117: The isConfiguredValue function currently only rejects
strings that are exactly a single placeholder via /^\$\{[^}]+\}$/, allowing
partial templates like "https://${HOST}" or "${A}${B}" to slip through; update
isConfiguredValue (used by configuredEnvValue) to also return false if the
trimmed value contains the sequence "${" anywhere (e.g., if
(trimmed.includes("${")) return false;) so any partial/embedded placeholders are
treated as unconfigured and filtered out before being returned by
configuredEnvValue.

In `@scripts/generate-plugin-config.sh`:
- Around line 12-25: Add a pre-check for empty manifest versions before the
existing comparison: after obtaining CLAUDE_VERSION and CODEX_VERSION (from
read_manifest_version), test if either is empty (e.g., [ -z "$CLAUDE_VERSION" ]
|| [ -z "$CODEX_VERSION" ]) and exit non‑zero with a clear error via stderr that
names the manifest(s) missing a version; then proceed to the existing inequality
check between CLAUDE_VERSION and CODEX_VERSION. This uses the existing symbols
read_manifest_version, CLAUDE_VERSION and CODEX_VERSION to locate where to
insert the validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1842409f-7595-4eb0-8e98-3208b75c3118

📥 Commits

Reviewing files that changed from the base of the PR and between 90b0879 and 352f93a.

📒 Files selected for processing (6)
  • .github/workflows/sync-marketplace.yml
  • CHANGELOG.md
  • Makefile
  • plugin/engram/hooks/session-start.js
  • plugin/engram/scripts/run-engram.js
  • scripts/generate-plugin-config.sh
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/sync-marketplace.yml

Comment thread Makefile

@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: 40eacf8916

ℹ️ 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".

function buildRequestHeaders(includeJsonBody = false) {
const headers = {};
const token = process.env.ENGRAM_AUTH_ADMIN_TOKEN;
const token = process.env.ENGRAM_TOKEN;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize userConfig token before hook posts

When Claude installs use the /config userConfig path, this commit places the credentials in ENGRAM_CLAUDE_USERCONFIG_* and only session-start/run-engram normalize them back to ENGRAM_TOKEN; other hooks such as user-prompt.js and stop.js call lib.requestPost directly. In that configuration this header builder sees no token, so those hook POSTs go out unauthenticated and the server rejects segment/correction/session-end events even though the MCP daemon and session-start fetch work. Centralize the same fallback normalization in lib (or call it from every hook) before building the Authorization header.

Useful? React with 👍 / 👎.

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