volcano-sh / volcano-sh/agentcube

Invoke request fails with 'Connection refused' for complex agent

Open
#64 3 comments 0 reactions 1 assignee View on GitHub

@hzxuzhonghu is already working on this.

Since Apr 7, 2026.

Dominant language
Go
Stars
167
Forks
88
Avg merge
44m
Merged PRs (30d)
1

Description

When an agent is built using frameworks like LangChain, its startup time can be relatively slow due to initialization overhead (e.g., loading models, setting up tools, etc.). Currently, the system assumes the agent is ready to receive requests as soon as its pod enters the Running state. However, the agent process may not have fully started listening on its port by that time.

As a result, the router immediately forwards incoming invoke requests to the pod, but the agent service isn’t ready yet—leading to "Connection refused" errors.

router log

2025/12/08 12:05:03 AgentRuntime invoke request: namespace=default, name=math-agent, path=/
2025/12/08 12:05:05 The selected entrypoint for session-id ce069388-7be2-44a0-9fb8-e651f400700b to sandbox is http://192.168.25.129:8080
2025/12/08 12:05:05 Start to proxy for session-id db2ee3c3-ff12-44f4-9077-9a1b4961d567 for AgentRuntime
2025/12/08 12:05:05 Forwarding request to: http://192.168.25.129:8080/
2025/12/08 12:05:05 Proxy error: dial tcp 192.168.25.129:8080: connect: connection refused

agent log

Starting Math Agent on port 8080 at 2025-12-08 12:05:06
Health check: http://localhost:8080/health
Agent endpoint: http://localhost:8080/
Math Agent is running on port 8080

Timing analysis shows that the router starts forwarding requests approximately 1 second before the agent begins listening

Proposed Fix:
Add a proper readiness probe (e.g., HTTP or TCP) that verifies the agent endpoint is responsive before marking the pod as ready. Alternatively, implement a startup delay or health check mechanism aligned with the agent's actual readiness.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.