mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
Refactor AntigravityExecutor to improve part filtering logic
This commit is contained in:
@@ -36,8 +36,12 @@ export class AntigravityExecutor extends BaseExecutor {
|
||||
if (c.parts?.some(p => p.functionResponse)) {
|
||||
role = "user";
|
||||
}
|
||||
// Strip thought parts (no valid signature → provider rejects)
|
||||
const parts = c.parts?.filter(p => !p.thought && !p.thoughtSignature);
|
||||
// Strip thought-only parts, keep thoughtSignature on functionCall parts (Gemini 3+ requires it)
|
||||
const parts = c.parts?.filter(p => {
|
||||
if (p.thought && !p.functionCall) return false;
|
||||
if (p.thoughtSignature && !p.functionCall && !p.text) return false;
|
||||
return true;
|
||||
});
|
||||
if (role !== c.role || parts?.length !== c.parts?.length) {
|
||||
return { ...c, role, parts };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user