agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

fix: propagate Reactor context to chunk event hooks in ReActAgent

Open chcodex opened this issue 5 months ago • 2 comments

Three bare .subscribe() calls in ReActAgent (fireReasoningChunk, fireActingChunk, fireSummaryChunk) created new subscription chains without the parent Reactor context, causing ReasoningChunkEvent, ActingChunkEvent, and SummaryChunkEvent to have an empty ContextView in downstream hooks.

Fix each with Flux.deferContextual + contextWrite to capture and propagate the parent context, matching the existing pattern used by executeToolCalls at line 2389-2391.

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.12, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

[Please describe the background, purpose, changes made, and how to test this PR]

Checklist

Please check the following items before code is ready to be reviewed.

  • [ ] Code has been formatted with mvn spotless:apply
  • [ ] All tests are passing (mvn test)
  • [ ] Javadoc comments are complete and follow project conventions
  • [ ] Related documentation has been updated (e.g. links, examples, etc.)
  • [ ] Code is ready for review

chcodex avatar Jun 15 '26 06:06 chcodex

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 15 '26 06:06 CLAassistant

Codecov Report

:x: Patch coverage is 76.56250% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/src/main/java/io/agentscope/core/ReActAgent.java 72.91% 8 Missing and 5 partials :warning:
...ntscope/core/skill/util/SkillFileSystemHelper.java 87.50% 2 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Jun 15 '26 07:06 codecov[bot]

@AlbumenJ Hi, I saw that this PR has not been merged. Is there any problem?

chcodex avatar Jun 18 '26 02:06 chcodex

正在拆分 PR,将用 bugfix/reactor-context 和 feat/skill-basedir 两个干净的 PR 替代

chcodex avatar Jun 18 '26 04:06 chcodex