Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ai-help): avoid spawning thread for history if history is disabled #438

Merged
merged 5 commits into from
Mar 27, 2024

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Mar 4, 2024

Extracted from #424.

Related to MP-813.

@caugner caugner requested a review from a team as a code owner March 4, 2024 11:23
@caugner caugner marked this pull request as draft March 4, 2024 11:46
Comment on lines +272 to +274
if !history_enabled {
return Ok(None);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fiji-flo I have second thoughts about early returning if !history_enabled, because that this function not only records the history, but also logs errors (including the stream ended without a finish_reason one).

Copy link
Contributor

Choose a reason for hiding this comment

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

That should happen somewhere else. As in the new code path in the meta data PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. Let's wait for #424 to be merged and move the logic over in this PR afterwards.

@fiji-flo fiji-flo marked this pull request as ready for review March 27, 2024 08:50
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

ready to go

Copy link
Contributor Author

@caugner caugner left a comment

Choose a reason for hiding this comment

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

LGTM, tested locally that AI Help still works as expected with and without history enabled.

@caugner caugner changed the title fix(ai-help): avoid thread if history disabled fix(ai-help): avoid spawning thread for history if history is disabled Mar 27, 2024
@caugner caugner merged commit 706ce23 into main Mar 27, 2024
3 checks passed
@caugner caugner deleted the fix-ai-help-avoid-thread-if-history-disabled branch March 27, 2024 12:00
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