Skip to content

Conversation

@kangfenmao
Copy link
Collaborator

Summary

  • Fixed continuous conversation failures for the gemini-2.5-flash-image (Nano Banana) model by setting its context length to 1
  • Added isGeminiGenerateImageModel utility function to identify Nano Banana models
  • This ensures the model only receives the most recent message, preventing context-related errors

Changes

  • Added new utility function isGeminiGenerateImageModel in image.ts
  • Modified ConversationService.prepareMessages to override contextCount to 1 for gemini-2.5-flash-image models in ConversationService.ts
  • Removed the previous +2 offset from the final takeRight call to align with the new contextCount handling

Test Plan

  • Test continuous conversations with gemini-2.5-flash-image model
  • Verify that conversations no longer fail after the first message
  • Confirm that other models are not affected by this change
  • Run yarn build:check to ensure no lint/type errors

… model

Set context count to 1 for gemini-2.5-flash-image (Nano Banana) model to fix continuous conversation failures. This ensures the model only receives the most recent message, preventing context-related errors.

Changes:
- Add isGeminiGenerateImageModel utility to identify Nano Banana models
- Override contextCount to 1 when using gemini-2.5-flash-image
- Remove the previous +2 offset from contextCount calculation
@DeJeune
Copy link
Collaborator

DeJeune commented Nov 18, 2025

Note

This issue/comment/review was translated by Claude.

Now that it's set to 1, is there still a way to edit the image generated in the previous assistant message?


Original Content

设置成1了,还有办法编辑上一条助手消息生成的图片吗?

@kangfenmao
Copy link
Collaborator Author

kangfenmao commented Nov 18, 2025

Note

This issue/comment/review was translated by Claude.

You can't edit it anymore, each time there's only one current submitted message, no more context.


Original Content

不能编辑了,每次只有当前提交的一条消息,没有上下文了

@DeJeune
Copy link
Collaborator

DeJeune commented Nov 18, 2025

Note

This issue/comment/review was translated by Claude.

You can modify it in src/renderer/src/aiCore/prepareParams/messageConverter.ts


Original Content

src/renderer/src/aiCore/prepareParams/messageConverter.ts 可以在这里修改

@kangfenmao kangfenmao closed this Dec 8, 2025
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