Skip to content

refactor(hook): change PreCallEvent related comments from read-only to modifiable, aligning with PreReasoningEvent#1155

Open
jujn wants to merge 2 commits intoagentscope-ai:mainfrom
jujn:refactor_PreCallEvent
Open

refactor(hook): change PreCallEvent related comments from read-only to modifiable, aligning with PreReasoningEvent#1155
jujn wants to merge 2 commits intoagentscope-ai:mainfrom
jujn:refactor_PreCallEvent

Conversation

@jujn
Copy link
Copy Markdown
Contributor

@jujn jujn commented Apr 7, 2026

Description

This PR updates PreCallEvent to be modifiable (revising the previous read-only comments), and aligns its inputMessages handling with PreReasoningEvent.

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

…o modifiable, aligning with PreReasoningEvent
@jujn jujn requested review from a team and Copilot April 7, 2026 13:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates hook documentation and behavior so PreCallEvent is treated as a modifiable hook event (similar to PreReasoningEvent), allowing hooks to alter the input message list before the agent processes it.

Changes:

  • Mark PreCallEvent as modifiable and document getInputMessages/setInputMessages.
  • Copy inputMessages on PreCallEvent construction and enforce non-null inputs.
  • Update Hook Javadoc to list PreCallEvent among modifiable events (and remove it from notification-only events).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
agentscope-core/src/main/java/io/agentscope/core/hook/PreCallEvent.java Makes PreCallEvent input messages modifiable and aligns list handling with other modifiable events.
agentscope-core/src/main/java/io/agentscope/core/hook/Hook.java Updates hook documentation to categorize PreCallEvent as a modifiable event.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants