Skip to content

fix(controlplane): re-register when the instance heartbeat fails - #3731

Merged
juruoO-o merged 2 commits into
agentscope-ai:mainfrom
Lyin-OTTF:fix/gh-3703-external-app-heartbeat
Nov 12, 2026
Merged

juruoO-o merged 2 commits into
agentscope-ai:mainfrom
Lyin-OTTF:fix/gh-3703-external-app-heartbeat

Conversation

@Lyin-OTTF

Copy link
Copy Markdown
Contributor

What

Agentscope Service External 应用在约一分钟后由 ready 变成 unavailable;不启用 gRPC 时,ControlPlane 无法与其消息对话,提示 asdp: instance not connected。

Why

实例心跳健康检查失败后没有重新注册到 ControlPlane,状态停留在失败态,后续请求被拒。

Fix

心跳失败时触发实例重新注册(re-register),恢复其在 ControlPlane 的可用状态,使非 gRPC 通道的消息对话恢复正常。

Fixes #3703

The HTTP self-registration heartbeat only recovered from connection
failures and HTTP 404. A 401 (rotated internal token), 409 (generation
conflict) or 5xx was silently ignored: the local state stayed
"registered", no re-registration happened, and nothing above FINE was
logged. The control plane expires an instance once heartbeats stop
refreshing its last-seen timestamp (45s by default), so the agent flips
from ready to unavailable roughly a minute after startup and, without an
ASDP stream, message delivery answers "asdp: instance not connected".

Every non-2xx heartbeat now takes the documented recovery path: log a
warning with the status and response body, drop the local registration
state and register again, which refreshes both the in-memory registry
entry and the stored instance lease.
@Lyin-OTTF

Copy link
Copy Markdown
Contributor Author

The build (windows-latest) job failed, but it's the same Windows symbolic-link flakiness seen on other PRs in this repo (the tool package's symlink test fails intermittently on the Windows runner, unrelated to this change). Could you re-run that job? The Ubuntu build and the other checks are green.

@jujn jujn added the P1 紧急不重要 label Nov 3, 2026

@juruoO-o juruoO-o left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed non-success heartbeat recovery through the existing registration flow and refreshed generation handling.

No blocking findings in the reviewed diff. This was a static review of source and tests; local Java/Maven tests were not run.

@juruoO-o
juruoO-o merged commit 72b4820 into agentscope-ai:main Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 紧急不重要

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Agentscope Service External application 一分钟左右会由ready变成unavailable

4 participants