fix(ReactExperienceAgentHook): update react experience limit#31
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the React experience retrieval behavior in the experience extension so the REACT hook can fetch more candidate experiences per query (increasing the hard cap from 3 to 30), improving recall during the React phase.
Changes:
- Increase the REACT
ExperienceQuerylimit cap from 3 to 30 (still bounded byproperties.maxItemsPerQuery).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ExperienceQuery query = new ExperienceQuery(ExperienceType.REACT); | ||
| query.setLimit(Math.min(properties.getMaxItemsPerQuery(), 3)); | ||
| query.setLimit(Math.min(properties.getMaxItemsPerQuery(), 30)); | ||
| // 关键修复:设置查询文本,用于向量搜索 |
There was a problem hiding this comment.
Raising the REACT query cap from 3 to 30 can significantly increase both (1) the amount of content injected into the conversation (buildReactStrategyContent only truncates per item, not total), and (2) the size of the INFO log line that serializes the full experiences list. Consider adding a total-size guard (e.g., stop appending after a max total chars/tokens) and/or reducing/truncating the INFO logging when higher limits are enabled via config.
update react experience limit from 3 to 30