Skip to content

fix(ReactExperienceAgentHook): update react experience limit#31

Merged
canfuu merged 1 commit intomainfrom
feature/update_default_react_agent_limit
Mar 2, 2026
Merged

fix(ReactExperienceAgentHook): update react experience limit#31
canfuu merged 1 commit intomainfrom
feature/update_default_react_agent_limit

Conversation

@canfuu
Copy link
Collaborator

@canfuu canfuu commented Mar 2, 2026

update react experience limit from 3 to 30

Copilot AI review requested due to automatic review settings March 2, 2026 11:06
Copy link
Collaborator

@AQing-527 AQing-527 left a comment

Choose a reason for hiding this comment

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

LGTM

@canfuu canfuu merged commit 62f3d6d into main Mar 2, 2026
3 checks passed
@canfuu canfuu deleted the feature/update_default_react_agent_limit branch March 2, 2026 11:08
Copy link

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

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 ExperienceQuery limit cap from 3 to 30 (still bounded by properties.maxItemsPerQuery).

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

Comment on lines 97 to 99
ExperienceQuery query = new ExperienceQuery(ExperienceType.REACT);
query.setLimit(Math.min(properties.getMaxItemsPerQuery(), 3));
query.setLimit(Math.min(properties.getMaxItemsPerQuery(), 30));
// 关键修复:设置查询文本,用于向量搜索
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

3 participants