Skip to content

fix(hub-ws): skip no-op reconfigure to prevent agent recreate loop - #642

Open
cunzhiwang wants to merge 1 commit into
alibaba:mainfrom
cunzhiwang:fix/hub-ws-reconfigure-loop-
Open

fix(hub-ws): skip no-op reconfigure to prevent agent recreate loop#642
cunzhiwang wants to merge 1 commit into
alibaba:mainfrom
cunzhiwang:fix/hub-ws-reconfigure-loop-

Conversation

@cunzhiwang

@cunzhiwang cunzhiwang commented Jul 30, 2026

Copy link
Copy Markdown

When MCP passes env vars (LLM_BASE_URL / LLM_API_KEY / LLM_MODEL_NAME) on every execute_task call, onExecute unconditionally invoked configure(...) with the same values. Each call created a new config object, retriggering the useEffect that disposes and recreates the agent, racing with the in-flight execute() and causing an infinite retry loop from the MCP client side.

onExecute now only calls configure when incomingConfig actually differs from the current config (shallow diff over incoming keys). Non-MCP paths (settings UI) are unaffected.

Closes #639

What

Brief description of changes.

Closes #(issue)

Type

  • Breaking change
  • Bug fix
  • Feature / Improvement
  • Refactor / Chores
  • Documentation / Website / Demo / Testing

Testing

  • npm run ci passes
  • Tested in modern browsers
  • Types/doc added

Requirements / 要求

  • I have read and follow the Code of Conduct and Contributing Guide . / 我已阅读并遵守行为准则。
  • This PR is NOT generated by a bot or AI agent acting autonomously. I have authored or meaningfully reviewed every change. / 此 PR 不是由 bot 或 AI 自主生成的,我已亲自编写或充分审查了每一处变更。

When MCP passes env vars (LLM_BASE_URL / LLM_API_KEY / LLM_MODEL_NAME)
on every execute_task call, onExecute unconditionally invoked
configure(...) with the same values. Each call created a new config
object, retriggering the useEffect that disposes and recreates the
agent, racing with the in-flight execute() and causing an infinite
retry loop from the MCP client side.

onExecute now only calls configure when incomingConfig actually
differs from the current config (shallow diff over incoming keys).
Non-MCP paths (settings UI) are unaffected.

Closes alibaba#639
@CLAassistant

CLAassistant commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The method of invoking plugins via MCP is unavailable

2 participants