fix(harness): pass through per-session interrupt overloads to delegate#1685
fix(harness): pass through per-session interrupt overloads to delegate#1685cluski wants to merge 2 commits into
Conversation
HarnessAgent only delegated the legacy no-arg interrupt() and interrupt(Msg) methods to the underlying ReActAgent. The new per-session overloads added in 2.0.0-RC2 (accepting RuntimeContext or userId+sessionId pairs) were not exposed, making it impossible to interrupt a specific session when a single HarnessAgent instance serves multiple concurrent sessions. Add four passthrough methods: - interrupt(RuntimeContext) - interrupt(RuntimeContext, Msg) - interrupt(String userId, String sessionId) - interrupt(String userId, String sessionId, Msg)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This is a clean, well-scoped fix that adds four per-session interrupt passthrough methods to HarnessAgent, delegating to the corresponding ReActAgent overloads introduced in 2.0.0-RC2. The implementation follows the established delegate-passthrough pattern already used throughout the class. Javadocs are complete and consistent. The test suite covers all four new overloads, including a valuable session-isolation test that verifies interrupting one session does not affect another — directly validating the core fix described in the PR. No issues found.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This is a clean, well-scoped fix that adds four per-session interrupt passthrough methods to HarnessAgent, delegating to the corresponding ReActAgent overloads introduced in 2.0.0-RC2. The implementation follows the established delegate-passthrough pattern already used throughout the class. Javadocs are complete and consistent. The test suite covers all four new overloads, including a valuable session-isolation test that verifies interrupting one session does not affect another — directly validating the core fix described in the PR. No issues found.
Fixes #1683
Summary
HarnessAgentonly delegated the legacy no-arginterrupt()andinterrupt(Msg)methods to the underlyingReActAgent. The new per-session overloads added in 2.0.0-RC2 (acceptingRuntimeContextoruserId+sessionIdpairs) were not exposed, making it impossible to interrupt a specific session when a singleHarnessAgentinstance serves multiple concurrent sessions.Changes
Add four passthrough methods to
HarnessAgentthat delegate to the correspondingReActAgentoverloads:interrupt(RuntimeContext ctx)interrupt(RuntimeContext ctx, Msg msg)interrupt(String userId, String sessionId)interrupt(String userId, String sessionId, Msg msg)These are not on the
Agentinterface, so they are added as public methods onHarnessAgentdirectly (same pattern as other delegate passthrough methods in the class).How to Test
mvn compile -pl agentscope-harness -ammvn test -pl agentscope-harness -amHarnessAgentserving multiple sessions concurrently, callagent.interrupt(userId, sessionId)to interrupt a specific session without affecting others.Checklist
mvn spotless:applymvn test)