Skip to content

fix(codex): preserve ATC registry context in bundled MCP config - #5

Merged
mateodelnorte merged 2 commits into
mainfrom
fix/harmony-1991-mcp-context
Sep 30, 2026
Merged

mateodelnorte merged 2 commits into
mainfrom
fix/harmony-1991-mcp-context

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The bundled 0.1.1 plugin already forwards session activity settings, but drops ATC_ROOT and ATC_CONFIG at the Codex MCP launch boundary. With a custom registry, the activity sink can target a different registry from the shim. This also updates the bundled cache version alongside the standalone package's missing-forwarding repair.

Forward the six SESSION_ACTIVITY_* settings plus ATC_ROOT and ATC_CONFIG by name, without baking in a session ID or forwarding unrelated credentials. Both maintained plugin payloads now declare version 0.1.2, giving the corrected launch configuration a distinct cache version. Document the required plugin update and new Codex/MCP process; installing the ATC or GitKB binary alone does not refresh a cached plugin.

Validation:

  • make release-check passes.
  • New contract and real Codex startup tests fail on the original main payloads for missing forwarding.
  • make test-integration CODEX_TEST_BINARY=... passes with both the native provider and npm @openai/codex@0.159.2 launcher. It installs the actual package in a temporary Codex home, initializes MCP through app-server, and verifies two successive session contexts plus a launch without session context.
  • Tests preserve custom registry settings and quoted/Unicode paths, exclude credential and generic-identity canaries, and never start a thread/model turn or execute an activity sink. CI runs the same real-startup regression on Linux with a pinned Codex version.
  • The standalone and bundled plugin payloads match byte-for-byte.

Tracks [[tasks/harmony-1991]]; follow-up to the merged ATC registry repair and GitKB Core export changes. The current live session still needs a supported plugin upgrade/restart and a real MCP mutation plus overlay/resume verification. Existing missing activity is not backfilled.

Summary by CodeRabbit

  • Features

    • GitKB now receives the parent session’s activity context and configured ATC settings when launched through the supported Codex shim. Normal behavior is unchanged when no parent context is available.
    • Sensitive credentials and unrelated session identifiers are not forwarded.
  • Documentation

    • Added guidance on updating the plugin and restarting or resuming Codex to apply the new configuration.
  • Tests

    • Added checks for MCP launch configuration and startup behavior, including context forwarding and exclusion of sensitive values.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 6 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 54 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 2d76b425-dbe3-477c-851f-f675bde102c4

📥 Commits

Reviewing files that changed from the base of the PR and between 6d46b61 and 7a91c41.

📒 Files selected for processing (2)
  • tests/mcp-contract.py
  • tests/mcp-startup.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: c58b0eee-444f-4fce-8768-4b4a851e4195

📥 Commits

Reviewing files that changed from the base of the PR and between 73a4c04 and 6d46b61.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • Makefile
  • README.md
  • plugins/gitkb/.codex-plugin/plugin.json
  • plugins/gitkb/.mcp.json
  • plugins/gitkb/README.md
  • tests/mcp-contract.py
  • tests/mcp-startup.py

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.


Walkthrough

The GitKB plugin forwards additional ATC environment-variable names to its MCP process. Contract and startup tests check the packaged configuration and the child process environment. Make targets and CI run these checks.

Changes

GitKB MCP context and launch validation

Layer / File(s) Summary
MCP environment contract
plugins/gitkb/.mcp.json, plugins/gitkb/.codex-plugin/plugin.json, plugins/gitkb/README.md, tests/mcp-contract.py
The MCP configuration adds ATC_ROOT and ATC_CONFIG, and the plugin version changes to 0.1.2. The plugin README documents inherited context. Contract tests check the server configuration, forwarded variable names, and manifest version.
Isolated MCP startup test
tests/mcp-startup.py
The test installs the plugin in a temporary Codex home and checks captured environment values for two synthetic sessions and a launch without session context. It excludes credential and session-identifier canaries.
Test commands and CI
Makefile, .github/workflows/ci.yml, README.md
The Makefile adds contract and integration test commands. CI installs Codex 0.159.2 and runs the startup test. The README describes the checks and how to run them.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant StartupTest
  participant CodexAppServer
  participant GitKBPlugin
  participant FakeGitKB
  StartupTest->>CodexAppServer: launch app-server with isolated environment
  CodexAppServer->>GitKBPlugin: start installed MCP plugin
  GitKBPlugin->>FakeGitKB: launch git-kb mcp with inherited environment
  FakeGitKB->>StartupTest: return captured environment values
Loading

Suggested reviewers: gonzih

Merge Risk: ⚪ Minimal · up to 6d46b

The change forwards the intended ATC context and documents the required plugin update and process restart. No concrete merge-blocking issue remains; merge after normal checks pass.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (6 skipped: 6 … 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 and concisely describes the main change: preserving ATC registry context in the bundled MCP configuration.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (6 skipped: 6 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks the startup trail,
With session keys in tidy mail.
The plugin hops through Codex’s door,
Its child reports the vars it bore.
Three launches pass; no secrets stray.
The rabbit thumps: tests greet the day.

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

@coderabbitai
coderabbitai Bot requested a review from Gonzih September 30, 2026 14:30
@mateodelnorte

Copy link
Copy Markdown
Contributor Author

Addressed the docstring coverage warning in the follow-up test commit. All seven test/helper functions now have docstrings (verified via Python AST). Release checks and the actual Codex MCP startup regression still pass locally. There were no inline review threads to resolve.

@mateodelnorte
mateodelnorte merged commit 7e75547 into main Sep 30, 2026
2 checks passed
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