GeezerVison is showing github.com — mcpx: fix remaining #1942 daemon-state defects — ephemeral exec runs, MCP surface rebuild, opencode channel DBs by dezren39 · Pull Request #2625 · developing-today/code
Conversation
dezren39
commented
Oct 30, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes the three remaining daemon-state defects from #1942 (queue task 3243). PM-15 was already fixed on main (routes_proto.go reports the effective proto.native setting) and is not touched here.
PM-12 — /v1/exec runs are marked ephemeral. execsvc.scriptEnv never set MCPX_EPHEMERAL, so the generated client never sent x-mcpx-ephemeral, ReleaseCaller never saw an ephemeral caller, and session-scoped instances (browsers) waited for idle reaping. scriptEnv now sets it with the CLI's rule: ephemeral unless the caller named a session (a named session may be shared and must outlive the run). The CLI path is unchanged — its runner env already carries the flag and wins over scriptEnv in RunWith. Regression test: ephemeral_internal_test.go (the key is absent on the old code).
PM-13 — the MCP surface rebuilds, and failures are not cached. lazyMCP built under sync.Once: adapters added later were invisible and a failed first build (including one from a cancelled first-request context) was cached for the daemon's life. The build is now keyed by a SHA-256 fingerprint of the adapter (paths.adapters) and API (paths.apis) declaration files — unchanged inputs reuse the built surface, a changed/added/appearing file rebuilds it, and a build error is returned without being cached so the next request retries. Tests: lazymcp_test.go covers both.
PM-21 — opencode channel database filenames. DefaultPaths only ever named opencode.db, while v1 writes opencode-<channel>.db outside latest/beta/prod and v2's set differs again. Each data directory now contributes every opencode*.db it holds — plain opencode.db first, then channel files newest-first — and OPENCODE_DISABLE_CHANNEL_DB (honoured by both opencodes) restores plain-only behaviour. Tests: paths_test.go covers finding a channel database, ordering, and the disable flag.
Verification: go test ./internal/execsvc/ ./internal/opencode/ ./internal/cli/ passes on the laptop worktree; the full pkgs/mcpx suite runs in CI on this PR.
Refs #1942 (slice: PM-12, PM-13, PM-21; PM-15 already fixed).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…3, PM-21)
PM-12: execsvc scriptEnv now sets MCPX_EPHEMERAL (ephemeral unless the caller named a session -- the CLI rule), so /v1/exec runs send x-mcpx-ephemeral and session-scoped instances are released at end of run instead of waiting for idle reaping. The CLI path is unchanged: its runner env already carries the flag and wins over scriptEnv in RunWith.
PM-13: lazyMCP no longer builds under sync.Once. The build is keyed by a SHA-256 fingerprint of the adapter and API declaration files: unchanged inputs reuse the surface, changed inputs rebuild it, and a failed build is returned but never cached, so the next request retries.
PM-21: opencode DefaultPaths enumerates each data directory's opencode*.db files -- opencode.db first, then opencode-<channel>.db newest-first -- so a channel-named database (v1 next writes opencode-next.db) is found; OPENCODE_DISABLE_CHANNEL_DB restores plain-only behaviour.
PM-15 was already fixed on main and is not touched. Tests: ephemeral_internal_test.go, lazymcp_test.go, paths_test.go; go test passes for internal/execsvc, internal/opencode and internal/cli on the laptop; full suite runs in CI on this PR.
coderabbitai
Bot
commented
Oct 30, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 15 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
744dfce7-b145-428c-b7ea-ee75f9ab9d82
Commits
-
Reviewing files that changed from the base of the PR and between 9986b72 and 11551b8.
Files selected for processing: 11
-
pkgs/mcpx/internal/cli/lazymcp_test.go
pkgs/mcpx/internal/cli/serve_ask.go
pkgs/mcpx/internal/config/scope.go
pkgs/mcpx/internal/config/scope_test.go
pkgs/mcpx/internal/daemon/server.go
pkgs/mcpx/internal/execsvc/ephemeral_internal_test.go
pkgs/mcpx/internal/execsvc/execsvc.go
pkgs/mcpx/internal/mcpserver/server.go
pkgs/mcpx/internal/mcpserver/transport_test.go
pkgs/mcpx/internal/opencode/opencode.go
pkgs/mcpx/internal/opencode/paths_test.go
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-30T08:48:19.986097Z |
11551b8 |
New commits |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 30, 2026
There was a problem hiding this comment.
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: b3f41070a4
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…t of ephemeral ownership (#1942)
Codex P2 x2 on PR 2625:
- lazyMCP replacement now ends the old server's sessions via new
mcpserver.Server.CloseSessions, so legacy GET streams, notification
and listen subscriptions do not accumulate on a surface nothing
routes to.
- CallContext gains PIDShared: the daemon marks a caller PID equal to
its own (every /v1/exec run reports the daemon PID) as shared, and
CallerOwned no longer treats that pid: key as caller-private, so one
run ending cannot ReleaseKey an instance another run still needs.
Tests: config shared-PID ownership, cli retire-on-replace seam,
mcpserver CloseSessions ends GET stream + forgets session.
This was referenced Oct 30, 2026
|
agent-note:v1
event: handed_off
task: 3243 (repo-health-code-pilot; parked)
state: Independent read-only review found a potential PM-21 correctness issue: internal/opencode/opencode.go:88-92 prioritizes opencode.db, and Find selects the first existing database. A user switching from stable to next/dev may retain opencode.db, causing stats to read the old stable DB rather than the active channel DB. The ordering test appears to encode that case. SQLite WAL also makes database file mtime an unreliable channel selector. Please verify against the intended channel precedence and fix or document an explicit selection strategy before merging.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1
event: handed_off
task: 3243 (repo-health-code-pilot; parked)
state: A second independent review finding needs verification before merge: serve_ask.go:378-399 caches successful MCPServer builds, but serve.go:543 calls apiTools, which suppresses loadAPIs/buildAPI errors (openapi_tools.go:241-255). A temporarily unavailable remote OpenAPI spec or cancelled initial request may therefore produce a successful but incomplete build, cached indefinitely while the declaration fingerprint remains unchanged. The injected failing-build test does not exercise this real MCPServer path. Add a recovery regression test and address if confirmed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1
event: handed_off
task: 3243 (repo-health-code-pilot; parked)
state: A third independent review finding needs verification: serve_ask.go:370 computes the declaration fingerprint before acquiring l.mu. A request can fingerprint old declarations, wait while another request builds the new surface, then rebuild against new declarations but record the stale fingerprint and retire the new surface, terminating sessions; a later request may rebuild again. Consider fingerprinting under the lock and validating a consistent snapshot around the build, with a concurrency regression test.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
agent-note:v1
event: handed_off
task: 3243 (repo-health-code-pilot; parked)
state: Local go test ./... did not complete: the background shell hit its 10-minute time limit and terminated the process. Output includes internal/daemon FAIL with signal: terminated; this is not evidence of an independent test assertion failure. Some packages passed, including internal/cli and internal/conformance. Resume with a bounded targeted investigation and rerun as appropriate.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|