Conversation
…Bridge - Refactored session cache to use a more detailed SessionCacheEntry interface. - Introduced mergeCachedParentId method to handle parent ID updates more robustly. - Improved session handling logic to ensure parent ID verification and caching are more reliable.
…Lint setup - Replace global Antigravity MCP registration with CodeNomad-local, per- instance config (~/.codenomad/instances/<instanceId>/config.json). - Add atomic writes using unique temp file names to avoid concurrent process contention. - Add startup cleanup to prune stale instances (PID liveness + /health). - Stop persisting MCP auth token to disk; token is required at runtime but no longer written to the instance config file. - Introduce minimal ESLint v9 flat config for UI and electron-app packages, tuned low-churn (warnings only) to avoid forcing refactors. - Add dev-docs PRDs documenting the multi-instance strategies considered. Refs: dev-docs/mcp-ask-user-multi-instance/01_PRD.md and 02_PRD.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR improves multi-instance safety and MCP server registration reliability. It introduces per-instance, CodeNomad-local MCP config files (removing dependency on Antigravity's global config), adds atomic writes and stale instance cleanup, enhances the session cache structure in
InstanceEventBridge, and adds a minimal ESLint baseline tuned to avoid forcing broad refactors. Additionally, this PR includes a routine package version bump across all packages.🐛 Issues Resolved
This PR addresses the following critical bugs:
📦 Release Contents
1. 🔐 Per-Instance MCP Registration (CodeNomad-Local Config)
Resolves: Issue #24: ask_user answered from main session consumes premium
Root Cause: Multiple IPC listeners being attached per instance caused questions from subagents to be routed to the wrong instance queue, leading to duplicate questions and incorrect answer routing that consumed premium requests.
Key Changes:
~/.gemini/antigravity/mcp_config.json) with per-instance config under~/.codenomad/instances/<instanceId>/config.json./healthprobe.ask-userentry if present, without creating the file if it doesn't exist.randomUUIDimport for generating unique instance identifiers.cleanupLegacyAntigravityRegistration()andcleanupStaleInstances()during startup.mcpInstanceIdto track the current instance and pass it to registration functions.How This Fixes Issue #24:
Commits:
feat(mcp): implement per-instance MCP registration and add minimal ESLint setup2. ⚡ Session Cache Structure & Management in InstanceEventBridge
Resolves: Issue #23: Subagent launches consume 1 premium request each
Root Cause: Event ordering race condition where
message.updatedevents arrived beforesession.updatedevents, causing the UI to track subagent messages as main session messages (consuming premium quota).Key Changes:
InstanceEventBridgefor better consistency and performance.SessionCacheEntryinterface withparentID,parentIdKnown, andverifiedproperties.mergeCachedParentId()to intelligently merge cached parent IDs with incoming data.handleInstanceEvent()to properly process session updates with more accurate parent ID tracking.session.updatedevents are processed synchronously beforemessage.updatedevents to guarantee proper parent ID hydration.How This Fixes Issue #23:
parentIDfrom the source of truthCommits:
feat: enhance session cache structure and management in InstanceEventBridge3. 🧩 Minimal ESLint Baseline
Key Changes:
npm run lintandnpm run lint:fixscripts.@eslint/js,eslint,eslint-plugin-solid,globals,typescript, andtypescript-eslintas dev dependencies.Commits:
feat(mcp): implement per-instance MCP registration and add minimal ESLint setup4. 📚 Documentation
Key Changes:
dev-docs/mcp-ask-user-multi-instance/documenting:01_PRD.md: Multi-instance MCP registration with namespaced servers (complex approach not implemented).02_PRD.md: Simpler CodeNomad-local per-instance config (the approach implemented).Commits:
feat(mcp): implement per-instance MCP registration and add minimal ESLint setup5. 📦 Package Version Bump
Key Changes:
0.9.2-patch.4across all packages:@neuralnomads/codenomad-electron-app)@neuralnomads/codenomad)@codenomad/ui)@opencode-ai/pluginfrom1.1.51to1.1.53in opencode-config package.Commits:
chore: bump package versions to 0.9.2-patch.4 across all packages📋 Checklist
~/.codenomad/instances/<instanceId>/config.json/healthprobe)ask-userentry is removed if presentnpm run build)npm run build:binaries)🧪 Testing & Verification
Issue #23: Subagent Premium Consumption Fix
Test Case:
Verification:
parentIDfor subagent sessionsmessage.updatedevents respectsession.parentIdfilter in usage trackingmessage.updatedandsession.updatedeventsIssue #24: ask_user Premium Consumption Fix
Test Case:
ask_userto ask a questionVerification: