fix(ipc): retry initialize() on transient failures#112
Merged
yishuiliunian merged 1 commit intomainfrom Apr 16, 2026
Merged
Conversation
AgentClient::initialize() now retries up to 5 times with exponential backoff when the agent process is slow to start. Fixes flaky cluster e2e tests on CI where the process isn't ready to handle JSON-RPC when initialize is called immediately after spawn.
yishuiliunian
added a commit
that referenced
this pull request
Apr 16, 2026
#112) Two features: 1. `.mcp.json` config file support — industry-standard camelCase format (`mcpServers`) in `.loopal/` and plugin directories. Stdio type is implicit (no `type` field needed). Within a layer, `.mcp.json` overrides `settings.json` same-name servers. 2. MCP sub-page action menu — Enter on a selected server opens a Disconnect/Reconnect menu instead of directly reconnecting. Full disconnect pipeline: TUI → ControlCommand::McpDisconnect → Runtime → McpManager::disconnect_connection → ToolRegistry cleanup.
yishuiliunian
added a commit
that referenced
this pull request
Apr 16, 2026
#112) (#115) Two features: 1. `.mcp.json` config file support — industry-standard camelCase format (`mcpServers`) in `.loopal/` and plugin directories. Stdio type is implicit (no `type` field needed). Within a layer, `.mcp.json` overrides `settings.json` same-name servers. 2. MCP sub-page action menu — Enter on a selected server opens a Disconnect/Reconnect menu instead of directly reconnecting. Full disconnect pipeline: TUI → ControlCommand::McpDisconnect → Runtime → McpManager::disconnect_connection → ToolRegistry cleanup.
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
AgentClient::initialize()now retries up to 5 times with 2s timeout per attempt and exponential backoff (100ms, 200ms, 300ms, 400ms)cluster_boots_two_hubs_with_agentsandcluster_cross_hub_message_deliverye2e tests that fail on Ubuntu CIRoot cause
AgentProcess::spawn_with_env()returns immediately after creating the OS process, but the agent server may not be ready to handle JSON-RPC requests yet. On resource-constrained CI runners,initialize()sends the request before the server loop starts, causing the response oneshot channel to be dropped when the reader loop exits.Changes
crates/loopal-agent-client/src/client.rs—initialize()method: add timeout + retry loop with exponential backoff. All callers benefit automatically.Test plan
loopal-meta-hub_e2eon Ubuntu)