feat(codex): add native Lumen plugin package - #184
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe repository now distributes Lumen through a native Codex marketplace plugin. It adds plugin metadata, MCP configuration, skills, cross-platform launchers, writable binary storage, index health handling, installation checks, release validation, and updated documentation. ChangesCodex plugin distribution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Codex
participant LumenLauncher
participant PluginData
participant GitHubReleases
participant LumenBinary
Codex->>LumenLauncher: invoke MCP command
LumenLauncher->>PluginData: search for executable
LumenLauncher->>GitHubReleases: download versioned or latest asset
GitHubReleases-->>PluginData: return platform binary
LumenLauncher->>LumenBinary: execute with forwarded arguments
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
28491a4 to
5a59bbe
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@scripts/test_run.sh`:
- Around line 151-154: Update resolved_version_from_plugin_manifest so ver is
declared separately before assigning the command-substitution result. Keep the
existing version extraction and v prefix unchanged, ensuring the assignment’s
exit status is preserved.
🪄 Autofix
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 Plus
Run ID: 7daeed30-b401-49ee-954f-37dc3e8665ce
📒 Files selected for processing (21)
.agents/plugins/marketplace.json.codex/INSTALL.md.github/workflows/ci.yml.gitignoreAGENTS.mdCLAUDE.mdREADME.mdinternal/release/metadata_test.goplugins/lumen/.codex-plugin/plugin.jsonplugins/lumen/.mcp.jsonplugins/lumen/mcp.jsonplugins/lumen/plugin.jsonplugins/lumen/scripts/runplugins/lumen/scripts/run.cmdplugins/lumen/skills/doctor/SKILL.mdplugins/lumen/skills/reindex/SKILL.mdrelease-please-config.jsonscripts/runscripts/run.cmdscripts/test_run.shscripts/test_run_windows.ps1
Addresses ShellCheck SC2155 flagged in review: `local ver="$(...)"` masks the command substitution's exit status. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The static workaround removes libpthread.dll.a, which is absent on the current windows-latest image and makes setup-mingw fail before the build step runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/ci.yml:
- Around line 69-70: Add explicit read-only token permissions to both CI jobs:
set contents: read under semantic_e2e at .github/workflows/ci.yml lines 69-70
and under build at lines 141-148. No other job permissions need changing.
In @.github/workflows/release-please.yml:
- Around line 63-65: Update the actions/checkout step in the release workflow to
set persist-credentials to false alongside the existing ref configuration,
ensuring subsequent canary steps cannot access persisted GitHub token
credentials.
In `@cmd/hook_test.go`:
- Around line 387-394: Ensure the test store created in this setup is closed on
every exit path by immediately deferring s.Close() after store.New succeeds,
before calling SetMeta. Update the setup around store.New and SetMeta; preserve
the existing fatal error handling and avoid relying on a later explicit close.
In `@internal/embedder/failover.go`:
- Around line 236-244: Update the Embed request flow so the caller context is
passed through findNextHealthy to probeHealth, replacing probeHealth’s
context.Background() timeout base with that propagated context while retaining
the healthCheckTimeout deadline.
🪄 Autofix
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 Plus
Run ID: b5f9a609-42b9-4e4c-9bc3-75c162ffe3a3
📒 Files selected for processing (21)
.github/workflows/ci.yml.github/workflows/release-please.ymlcmd/hook.gocmd/hook_test.gocmd/stdio.gocmd/stdio_test.gointernal/embedder/failover.gointernal/embedder/failover_test.gointernal/embedder/health.gointernal/index/index.gointernal/index/index_test.gointernal/release/artifact_smoke_test.gointernal/store/store.gopackage.jsonplugins/lumen/scripts/run.cmdplugins/lumen/skills/reindex/SKILL.mdscripts/run.cmdscripts/test_agent_installations.shscripts/test_run.shscripts/testdata/mcp_smoke_client/main.goscripts/verify_opencode_package.mjs
🚧 Files skipped from review as they are similar to previous changes (4)
- plugins/lumen/skills/reindex/SKILL.md
- plugins/lumen/scripts/run.cmd
- scripts/run.cmd
- scripts/test_run.sh
| semantic_e2e: | ||
| name: Semantic E2E |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Set explicit read-only permissions for CI jobs.
Both jobs use repository-default token permissions. The semantic E2E job installs and executes external CLI packages. The build job executes dependency and test code. A repository setting can grant these jobs write scopes.
.github/workflows/ci.yml#L69-L70: addpermissions: contents: readtosemantic_e2e..github/workflows/ci.yml#L141-L148: addpermissions: contents: readtobuild.
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 69-139: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
📍 Affects 1 file
.github/workflows/ci.yml#L69-L70(this comment).github/workflows/ci.yml#L141-L148
🤖 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 @.github/workflows/ci.yml around lines 69 - 70, Add explicit read-only token
permissions to both CI jobs: set contents: read under semantic_e2e at
.github/workflows/ci.yml lines 69-70 and under build at lines 141-148. No other
job permissions need changing.
Source: Linters/SAST tools
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ needs.release-please.outputs.tag_name }} |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Disable persisted checkout credentials.
The canary executes repository code and a downloaded artifact after this checkout. actions/checkout persists the GitHub token in local Git configuration by default. Set persist-credentials: false because later steps do not need Git authentication.
Proposed fix
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}
+ persist-credentials: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.release-please.outputs.tag_name }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.release-please.outputs.tag_name }} | |
| persist-credentials: false |
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 63-65: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 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 @.github/workflows/release-please.yml around lines 63 - 65, Update the
actions/checkout step in the release workflow to set persist-credentials to
false alongside the existing ref configuration, ensuring subsequent canary steps
cannot access persisted GitHub token credentials.
Source: Linters/SAST tools
| s, err := store.New(dbPath, cfg.ServerDims(0)) | ||
| if err != nil { | ||
| t.Fatalf("store.New: %v", err) | ||
| } | ||
| if err := s.SetMeta(store.MetaLastIndexError, "embed batch: no models loaded"); err != nil { | ||
| t.Fatalf("SetMeta: %v", err) | ||
| } | ||
| _ = s.Close() |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Close the test store on every exit path.
If s.SetMeta fails, Line 392 calls t.Fatalf before Line 394 closes s. This can retain database handles and file locks. Put this setup in a small closure and defer s.Close() immediately after store.New. As per coding guidelines, "Always defer cleanup for database, file, and other resource handles."
Proposed fix
- s, err := store.New(dbPath, cfg.ServerDims(0))
- if err != nil {
- t.Fatalf("store.New: %v", err)
- }
- if err := s.SetMeta(store.MetaLastIndexError, "embed batch: no models loaded"); err != nil {
- t.Fatalf("SetMeta: %v", err)
- }
- _ = s.Close()
+ func() {
+ s, err := store.New(dbPath, cfg.ServerDims(0))
+ if err != nil {
+ t.Fatalf("store.New: %v", err)
+ }
+ defer func() { _ = s.Close() }()
+
+ if err := s.SetMeta(store.MetaLastIndexError, "embed batch: no models loaded"); err != nil {
+ t.Fatalf("SetMeta: %v", err)
+ }
+ }()📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| s, err := store.New(dbPath, cfg.ServerDims(0)) | |
| if err != nil { | |
| t.Fatalf("store.New: %v", err) | |
| } | |
| if err := s.SetMeta(store.MetaLastIndexError, "embed batch: no models loaded"); err != nil { | |
| t.Fatalf("SetMeta: %v", err) | |
| } | |
| _ = s.Close() | |
| func() { | |
| s, err := store.New(dbPath, cfg.ServerDims(0)) | |
| if err != nil { | |
| t.Fatalf("store.New: %v", err) | |
| } | |
| defer func() { _ = s.Close() }() | |
| if err := s.SetMeta(store.MetaLastIndexError, "embed batch: no models loaded"); err != nil { | |
| t.Fatalf("SetMeta: %v", err) | |
| } | |
| }() |
🤖 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 `@cmd/hook_test.go` around lines 387 - 394, Ensure the test store created in
this setup is closed on every exit path by immediately deferring s.Close() after
store.New succeeds, before calling SetMeta. Update the setup around store.New
and SetMeta; preserve the existing fatal error handling and avoid relying on a
later explicit close.
Source: Coding guidelines
| func (f *FailoverEmbedder) probeHealth(i int) bool { | ||
| servers := f.cfg.Servers() | ||
| if i >= len(servers) { | ||
| return false | ||
| } | ||
| srv := servers[i] | ||
| endpoint := srv.Host + "/" | ||
| if srv.Backend == "lmstudio" { | ||
| endpoint = srv.Host + "/v1/models" | ||
| } | ||
| client := &http.Client{Timeout: healthCheckTimeout} | ||
| resp, err := client.Get(endpoint) | ||
| if err != nil { | ||
| ctx, cancel := context.WithTimeout(context.Background(), healthCheckTimeout) | ||
| defer cancel() | ||
| if err := ProbeServer(ctx, srv); err != nil { |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline internal/embedder/failover.go --items all
rg -n -C 4 --type=go '\bprobeHealth\s*\(' internal/embedderRepository: ory/lumen
Length of output: 3141
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed -n '100,255p' internal/embedder/failover.go | cat -n
echo '--- ProbeServer definitions/usages ---'
rg -n -C 3 --type=go '\bProbeServer\s*\(' internalRepository: ory/lumen
Length of output: 6982
Thread the embed request context into health probes.
Embed(ctx, ...) eventually calls findNextHealthy(active), but probeHealth(i) creates its timeout from context.Background() before calling ProbeServer. If the embedder request is canceled, this probe can still run for healthCheckTimeout; pass the caller context through findNextHealthy/probeHealth and derive the health-check timeout from it.
🤖 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 `@internal/embedder/failover.go` around lines 236 - 244, Update the Embed
request flow so the caller context is passed through findNextHealthy to
probeHealth, replacing probeHealth’s context.Background() timeout base with that
propagated context while retaining the healthCheckTimeout deadline.
Source: Coding guidelines
Adds an isolated native Codex/Agent Plugins package with local marketplace metadata, MCP manifests, copied skills, and cross-platform launchers.
Updates launchers to honor
PLUGIN_ROOTand store downloaded binaries in writablePLUGIN_DATA, with release metadata parity and platform tests. Refreshes Codex installation and migration docs, and adds a Linux Codex plugin install smoke test to CI.Tests:
make test;bash scripts/test_run.sh;make lint.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests