Skip to content

fix(werewolf): update vote message metadata structure#625

Merged
AlbumenJ merged 1 commit intoagentscope-ai:mainfrom
LearningGp:werewolf-fix
Jan 22, 2026
Merged

fix(werewolf): update vote message metadata structure#625
AlbumenJ merged 1 commit intoagentscope-ai:mainfrom
LearningGp:werewolf-fix

Conversation

@LearningGp
Copy link
Contributor

AgentScope-Java Version

1.0.8

Description

fix(werewolf): update vote message metadata structure

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

Change-Id: Ide4d61f04c034f90b891f3f003819af7065e448e
@LearningGp LearningGp requested review from a team and Copilot January 22, 2026 02:16
@gemini-code-assist
Copy link

Summary of Changes

Hello @LearningGp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the internal metadata structure of vote messages within the AgentScope Werewolf game example. The primary goal is to standardize the storage of structured output, specifically for player votes, by encapsulating relevant details like the target player and reason under a dedicated STRUCTURED_OUTPUT key. This change enhances data consistency and prepares the system for more robust parsing and handling of structured information in messages.

Highlights

  • Metadata Structure Update: The metadata structure for vote messages in the Werewolf game example has been updated to nest the 'targetPlayer' and 'reason' fields under a new MessageMetadataKeys.STRUCTURED_OUTPUT key.
  • Consistency Improvement: This change is applied consistently across both the werewolf killing phase and the general voting phase, standardizing how structured vote information is stored.
  • New Import: The MessageMetadataKeys class has been imported to facilitate the new metadata structure.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the metadata structure for vote messages in the Werewolf game example. By wrapping the vote data within MessageMetadataKeys.STRUCTURED_OUTPUT, it aligns the manual message creation for human players with the framework's standard for structured data, fixing a bug where getStructuredData would fail.

I've added a couple of suggestions to further improve maintainability by using the VoteModel class directly when constructing the vote message metadata. This would enhance type safety and consistency with how AI-generated votes are handled. These are non-blocking suggestions for future improvement.

Copy link
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 the human vote message metadata in the HITL Werewolf example to use the standardized structured-output metadata key, aligning it with the core structured data APIs and fixing how human votes are parsed and counted.

Changes:

  • Import MessageMetadataKeys into WerewolfWebGame.
  • Wrap human vote metadata for werewolf night voting under MessageMetadataKeys.STRUCTURED_OUTPUT as a nested map containing targetPlayer and reason.
  • Apply the same structured-output metadata pattern to human votes in the daytime voting phase.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AlbumenJ AlbumenJ merged commit e0d415a into agentscope-ai:main Jan 22, 2026
10 of 11 checks passed
Alexxigang pushed a commit to Alexxigang/agentscope-java that referenced this pull request Jan 25, 2026
)

## AgentScope-Java Version

1.0.8

## Description

fix(werewolf): update vote message metadata structure
## Checklist

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

- [x]  Code has been formatted with `mvn spotless:apply`
- [x]  All tests are passing (`mvn test`)
- [x]  Javadoc comments are complete and follow project conventions
- [x] Related documentation has been updated (e.g. links, examples,
etc.)
- [x]  Code is ready for review
@LearningGp LearningGp deleted the werewolf-fix branch January 28, 2026 05:51
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