Skip to content

fix: ChatBase constructor ignores history parameters#783

Closed
jonasstenberg wants to merge 1 commit into
googleapis:mainfrom
jonasstenberg:patch-1
Closed

fix: ChatBase constructor ignores history parameters#783
jonasstenberg wants to merge 1 commit into
googleapis:mainfrom
jonasstenberg:patch-1

Conversation

@jonasstenberg
Copy link
Copy Markdown
Contributor

The ChatBase constructor accepts comprehensiveHistory and curatedHistory parameters but never uses them—both fields are always initialized as empty ArrayList instances regardless of what's passed in.

The Bug

// Before (broken)
ChatBase(List comprehensiveHistory, List curatedHistory) {
  this.comprehensiveHistory = new ArrayList<>();
  this.curatedHistory = new ArrayList<>();
}

The Fix

// After (fixed)
ChatBase(List comprehensiveHistory, List curatedHistory) {
  this.comprehensiveHistory = comprehensiveHistory;
  this.curatedHistory = curatedHistory;
}

Impact

This bug would prevent any functionality that relies on initializing a chat session with existing conversation history from working correctly.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jan 19, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The ChatBase constructor was ignoring its parameters and always initializing comprehensiveHistory and curatedHistory as empty lists.
This prevented any pre-existing conversation history from being used.
copybara-service Bot pushed a commit that referenced this pull request Feb 26, 2026
--
c78d473 by Jonas Stenberg <js@squidler.io>:

fix: initialize comprehensive and curated history in constructor

The ChatBase constructor was ignoring its parameters and always initializing comprehensiveHistory and curatedHistory as empty lists.
This prevented any pre-existing conversation history from being used.

COPYBARA_INTEGRATE_REVIEW=#783 from jonasstenberg:patch-1 c78d473
PiperOrigin-RevId: 875404679
@jaycee-li
Copy link
Copy Markdown
Collaborator

Your PR has been submitted in f74a426, so this one will be closed.

@jaycee-li jaycee-li closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants