Repository navigation
previous_interaction_id chain re-roots mid-conversation, then rejects a valid function_result #3003
Description
Activity
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
on Sep 22, 2026 Hi @JasonSteving99,
Thank you for providing such a detailed bug report, logs, and the self-contained reproduction script (gemini_reroot_repro.py). I ran the reproduction script across multiple test runs with concurrent multi-turn conversations (8 to 16 parallel chains) targeting gemini-3.8-flash on the Interactions API (POST /v1beta/interactions).In our recent test runs, all conversations completed cleanly without encountering the re-rooting issue.
Could you please re-run your repro script and let us know if you are still able to reproduce the issue..?
Thanks!Hey @Venkaiahbabuneelam this is still happening. I'm not the only one running into this issue, colleagues have run into it as well. I attached a rerun that I ran just now.
Reacted by Maxwell D Collins- added a commit that references this issue
on Oct 2, 2026 Anyone look into this? We had to workaround this by simply not using the interactions API with server managed context history and instead managing it manually on our side.
==============================================================================
Gemini Interactions API -- conversation re-root breaks previous_interaction_idgoogle-genai : 2.28.0
python : 3.13.7
model : gemini-3.8-flash
started (UTC): 2026-10-08T06:18:24ZAn interaction id is v1_: field 1 is the conversation ROOT id, field 2
is the interaction's OWN id. They should match only on a conversation's first turn.
Running 8 conversations concurrently; each prints its table when it
finishes. >> = re-rooted (root == self mid-chain) XX = function_result rejectedConversation 2 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHauO5OJrdg8UP9aimyAg sTXHauO5OJrdg8UP9aimyAg (none) v1_ChdzVFhIYXVPNU9KcmRnOFVQOWFpbXlBZxIXc1RYSGF1TzVPSnJkZzhVUDlhaW15QWc 2 ok 1 sTXHauO5OJrdg8UP9aimyAg uzXHaqiNHY6EjuMPzJ6-6Ao sTXHauO5OJrdg8UP9aimyAg v1_ChdzVFhIYXVPNU9KcmRnOFVQOWFpbXlBZxIXdXpYSGFxaU5IWTZFanVNUHpKNi02QW8 3 ok 1 sTXHauO5OJrdg8UP9aimyAg xDXHas7LHMXa4-EPs72gwQo uzXHaqiNHY6EjuMPzJ6-6Ao v1_ChdzVFhIYXVPNU9KcmRnOFVQOWFpbXlBZxIXeERYSGFzN0xITVhhNC1FUHM3Mmd3UW8 4 ok (prose) 0 sTXHauO5OJrdg8UP9aimyAg zjXHavy4CPjEg8UPpaCqyQg xDXHas7LHMXa4-EPs72gwQo v1_ChdzVFhIYXVPNU9KcmRnOFVQOWFpbXlBZxIXempYSGF2eTRDUGpFZzhVUHBhQ3F5UWcEnded normally (the model replied in prose).
Conversation 8 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHat6rOPjEg8UPpaCqyQg sTXHat6rOPjEg8UPpaCqyQg (none) v1_ChdzVFhIYXQ2ck9QakVnOFVQcGFDcXlRZxIXc1RYSGF0NnJPUGpFZzhVUHBhQ3F5UWc 2 ok 1 sTXHat6rOPjEg8UPpaCqyQg uzXHauzSAZ-FjuMPjZT1yAg sTXHat6rOPjEg8UPpaCqyQg v1_ChdzVFhIYXQ2ck9QakVnOFVQcGFDcXlRZxIXdXpYSGF1elNBWi1GanVNUGpaVDF5QWc 3 ok 1 sTXHat6rOPjEg8UPpaCqyQg xDXHaq30AsXa4-EPs72gwQo uzXHauzSAZ-FjuMPjZT1yAg v1_ChdzVFhIYXQ2ck9QakVnOFVQcGFDcXlRZxIXeERYSGFxMzBBc1hhNC1FUHM3Mmd3UW8 4 ok (prose) 0 sTXHat6rOPjEg8UPpaCqyQg zjXHauKJELa2g8UPl76RoAk xDXHaq30AsXa4-EPs72gwQo v1_ChdzVFhIYXQ2ck9QakVnOFVQcGFDcXlRZxIXempYSGF1S0pFTGEyZzhVUGw3NlJvQWsEnded normally (the model replied in prose).
Conversation 4 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHapOtOMK6g8UPnuCHiA4 sTXHapOtOMK6g8UPnuCHiA4 (none) v1_ChdzVFhIYXBPdE9NSzZnOFVQbnVDSGlBNBIXc1RYSGFwT3RPTUs2ZzhVUG51Q0hpQTQ 2 ok 1 sTXHapOtOMK6g8UPnuCHiA4 uzXHaoasHq7VqfkP5N-ImAs sTXHapOtOMK6g8UPnuCHiA4 v1_ChdzVFhIYXBPdE9NSzZnOFVQbnVDSGlBNBIXdXpYSGFvYXNIcTdWcWZrUDVOLUltQXM 3 ok 1 sTXHapOtOMK6g8UPnuCHiA4 wzXHaqTtJLa2g8UPjMKRoAk uzXHaoasHq7VqfkP5N-ImAs v1_ChdzVFhIYXBPdE9NSzZnOFVQbnVDSGlBNBIXd3pYSGFxVHRKTGEyZzhVUGpNS1JvQWs 4 ok 1 sTXHapOtOMK6g8UPnuCHiA4 zTXHaqOINLa2g8UPl76RoAk wzXHaqTtJLa2g8UPjMKRoAk v1_ChdzVFhIYXBPdE9NSzZnOFVQbnVDSGlBNBIXelRYSGFxT0lOTGEyZzhVUGw3NlJvQWs 5 ok (prose) 0 sTXHapOtOMK6g8UPnuCHiA4 2DXHarf6PLa2g8UP5PCQ4Ac zTXHaqOINLa2g8UPl76RoAk v1_ChdzVFhIYXBPdE9NSzZnOFVQbnVDSGlBNBIXMkRYSGFyZjZQTGEyZzhVUDVQQ1E0QWMEnded normally (the model replied in prose).
Conversation 1 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHavqXOK7VqfkP19-ImAs sTXHavqXOK7VqfkP19-ImAs (none) v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXc1RYSGF2cVhPSzdWcWZrUDE5LUltQXM 2 ok 1 sTXHavqXOK7VqfkP19-ImAs vjXHatjPCpP54-EP0fHe0A4 sTXHavqXOK7VqfkP19-ImAs v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXdmpYSGF0alBDcFA1NC1FUDBmSGUwQTQ 3 ok 1 sTXHavqXOK7VqfkP19-ImAs xzXHar3nHPe0g8UP3M352Ag vjXHatjPCpP54-EP0fHe0A4 v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXeHpYSGFyM25IUGUwZzhVUDNNMzUyQWc 4 ok 1 sTXHavqXOK7VqfkP19-ImAs 0DXHasz8C42lqfkPsey92QI xzXHar3nHPe0g8UP3M352Ag v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXMERYSGFzejhDNDJscWZrUHNleTkyUUk 5 ok 1 sTXHavqXOK7VqfkP19-ImAs 2DXHatCGM6-yg8UPlY6Z0Qg 0DXHasz8C42lqfkPsey92QI v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXMkRYSGF0Q0dNNi15ZzhVUGxZNlowUWc 6 ok (prose) 0 sTXHavqXOK7VqfkP19-ImAs 5TXHarvSIt7dg8UP8uuz2Ag 2DXHatCGM6-yg8UPlY6Z0Qg v1_ChdzVFhIYXZxWE9LN1ZxZmtQMTktSW1BcxIXNVRYSGFydlNJdDdkZzhVUDh1dXoyQWcEnded normally (the model replied in prose).
Conversation 5 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHatqWOJHEg8UPifXamA0 sTXHatqWOJHEg8UPifXamA0 (none) v1_ChdzVFhIYXRxV09KSEVnOFVQaWZYYW1BMBIXc1RYSGF0cVdPSkhFZzhVUGlmWGFtQTA 2 ok 1 sTXHatqWOJHEg8UPifXamA0 uzXHas-XA5azg8UP1b-XyQg sTXHatqWOJHEg8UPifXamA0 v1_ChdzVFhIYXRxV09KSEVnOFVQaWZYYW1BMBIXdXpYSGFzLVhBNWF6ZzhVUDFiLVh5UWc 3 ok 1 sTXHatqWOJHEg8UPifXamA0 wzXHaunHO5-FjuMPjZT1yAg uzXHas-XA5azg8UP1b-XyQg v1_ChdzVFhIYXRxV09KSEVnOFVQaWZYYW1BMBIXd3pYSGF1bkhPNS1GanVNUGpaVDF5QWc 4 ok 1 sTXHatqWOJHEg8UPifXamA0 zDXHapuALsKkjuMP2uqouAg wzXHaunHO5-FjuMPjZT1yAg v1_ChdzVFhIYXRxV09KSEVnOFVQaWZYYW1BMBIXekRYSGFwdUFMc0tranVNUDJ1cW91QWc 5 ok (prose) 0 sTXHatqWOJHEg8UPifXamA0 1jXHatDoLprdg8UP9aimyAg zDXHapuALsKkjuMP2uqouAg v1_ChdzVFhIYXRxV09KSEVnOFVQaWZYYW1BMBIXMWpYSGF0RG9McHJkZzhVUDlhaW15QWcEnded normally (the model replied in prose).
Conversation 3 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHasTpN-GkqfkPvpeo4A0 sTXHasTpN-GkqfkPvpeo4A0 (none) v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXc1RYSGFzVHBOLUdrcWZrUHZwZW80QTA 2 ok 1 sTXHasTpN-GkqfkPvpeo4A0 vDXHaqWVFe_eg8UPrIeLyQg sTXHasTpN-GkqfkPvpeo4A0 v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXdkRYSGFxV1ZGZV9lZzhVUHJJZUx5UWc 3 ok 1 sTXHasTpN-GkqfkPvpeo4A0 xjXHat_VI_q2g8UP1M6X2Qo vDXHaqWVFe_eg8UPrIeLyQg v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXeGpYSGF0X1ZJX3EyZzhVUDFNNlgyUW8 4 ok 1 sTXHasTpN-GkqfkPvpeo4A0 zjXHatGjO9TPg8UP7b_n6A0 xjXHat_VI_q2g8UP1M6X2Qo v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXempYSGF0R2pPOVRQZzhVUDdiX242QTA 5 ok 1 sTXHasTpN-GkqfkPvpeo4A0 3jXHauXWJI2lqfkPlcyqyQg zjXHatGjO9TPg8UP7b_n6A0 v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXM2pYSGF1WFdKSTJscWZrUGxjeXF5UWc 6 ok (prose) 0 sTXHasTpN-GkqfkPvpeo4A0 6jXHarOHOfjEg8UPpaCqyQg 3jXHauXWJI2lqfkPlcyqyQg v1_ChdzVFhIYXNUcE4tR2txZmtQdnBlbzRBMBIXNmpYSGFyT0hPZmpFZzhVUHBhQ3F5UWcEnded normally (the model replied in prose).
Conversation 7 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHavDALqzFg8UPj-agyQg sTXHavDALqzFg8UPj-agyQg (none) v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXc1RYSGF2REFMcXpGZzhVUGotYWd5UWc 2 ok 1 sTXHavDALqzFg8UPj-agyQg uzXHao2hHdPfg8UP8OPmyAg sTXHavDALqzFg8UPj-agyQg v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXdXpYSGFvMmhIZFBmZzhVUDhPUG15QWc 3 ok 1 sTXHavDALqzFg8UPj-agyQg xDXHasX7HIWvg8UPt4Gy2Qg uzXHao2hHdPfg8UP8OPmyAg v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXeERYSGFzWDdISVd2ZzhVUHQ0R3kyUWc 4 ok 1 sTXHavDALqzFg8UPj-agyQg 0DXHas7KC_e0g8UP3M352Ag xDXHasX7HIWvg8UPt4Gy2Qg v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXMERYSGFzN0tDX2UwZzhVUDNNMzUyQWc 5 ok 1 sTXHavDALqzFg8UPj-agyQg 2TXHaomkFMzEg8UP2YXWyAg 0DXHas7KC_e0g8UP3M352Ag v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXMlRYSGFvbWtGTXpFZzhVUDJZWFd5QWc 6 ok (prose) 0 sTXHavDALqzFg8UPj-agyQg 6TXHasDVDK-yg8UPlY6Z0Qg 2TXHaomkFMzEg8UP2YXWyAg v1_ChdzVFhIYXZEQUxxekZnOFVQai1hZ3lRZxIXNlRYSGFzRFZESy15ZzhVUGxZNlowUWcEnded normally (the model replied in prose).
Conversation 6 -- clean
turn status calls root (field 1) self (field 2) chained from (prev self) interaction id1 start 1 sTXHaqixHcjdg8UP_enn-Ao sTXHaqixHcjdg8UP_enn-Ao (none) v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXc1RYSGFxaXhIY2pkZzhVUF9lbm4tQW8 2 ok 1 sTXHaqixHcjdg8UP_enn-Ao uzXHarDaAsXdg8UP-LG2yQg sTXHaqixHcjdg8UP_enn-Ao v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXdXpYSGFyRGFBc1hkZzhVUC1MRzJ5UWc 3 ok 1 sTXHaqixHcjdg8UP_enn-Ao xDXHapSPNNn-4-EP6ZfOyAg uzXHarDaAsXdg8UP-LG2yQg v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXeERYSGFwU1BOTm4tNC1FUDZaZk95QWc 4 ok 1 sTXHaqixHcjdg8UP_enn-Ao zTXHaoCNM6zFg8UPxK6xmQo xDXHapSPNNn-4-EP6ZfOyAg v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXelRYSGFvQ05NNnpGZzhVUHhLNnhtUW8 5 ok 1 sTXHaqixHcjdg8UP_enn-Ao 1jXHavDtL6zFg8UPj-agyQg zTXHaoCNM6zFg8UPxK6xmQo v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXMWpYSGF2RHRMNnpGZzhVUGotYWd5UWc 6 ok 1 sTXHaqixHcjdg8UP_enn-Ao 5jXHat_pI5-0g8UPmPLdgQs 1jXHavDtL6zFg8UPj-agyQg v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXNWpYSGF0X3BJNS0wZzhVUG1QTGRnUXM 7 ok (prose) 0 sTXHaqixHcjdg8UP_enn-Ao -DXHap30Mse-g8UP25OkyAg 5jXHat_pI5-0g8UPmPLdgQs v1_ChdzVFhIYXFpeEhjamRnOFVQX2Vubi1BbxIXLURYSGFwMzBNc2UtZzhVUDI1T2t5QWcEnded normally (the model replied in prose).
==============================================================================
re-rooted mid-chain : 0/8
rejected submissions: 0/8No rejection this run -- it is sporadic. Re-run, or raise --conversations.
Hi @JasonSteving99, All 8 test conversations completed successfully without any errors, confirming that the Gemini API and function calls are working as expected.
Thanks
Interactions API:
previous_interaction_idchain re-roots mid-conversation, then rejects a validfunction_resultModel:
gemini-3.8-flash· Endpoint:POST /v1beta/interactions(streaming) · SDK: google-genai 2.8.0 and 2.25.0 (same result) · Reproduced: 2026-09-22Summary
In a tool-calling conversation chained only with
previous_interaction_id, the serversometimes starts a new conversation root partway through. Two interactions later,
answering the pending
function_callwith afunction_resultfails with:The client's request is valid. The interaction being chained off ends in a
function_call,and the
function_resultanswers that call's id.How the re-root shows up
An interaction id is
v1_<urlsafe base64 protobuf>: field 1 is the conversation root id andfield 2 is the interaction's own id. They should be equal only on a conversation's first
interaction. In failing runs they become equal mid-chain (
RE-ROOTEDbelow). Therejection follows two interactions later, when the rebuilt history seems to start with a
function_resultwhosefunction_callbelongs to the old root.Evidence it is server-side
Checked against the rejected interaction:
function_result -> thought -> function_call, so answering it is legal.interactions.getand sent explicitly, withoutprevious_interaction_id, is accepted. Same content, so only the server-side chainreconstruction is wrong.
Not caused by the SDK: reproduces on 2.8.0 and 2.25.0, and toggling the
api-revisionheader 2.8.0 sends makes no difference. Not caused by timing: reproduces with no delay
between turns. It happens in roughly 10-50% of conversations, varying from run to run.
Repro
Attached
gemini_reroot_repro.py(self-contained; needsGEMINI_API_KEY):It exits 1 when it catches the bug. Each run may not catch it; re-run or pass
--conversations 16.Example run
Excerpt: conversations that hit the bug are shown in full; 8 clean and 2 re-rooted without a rejection omitted. The full log is attached as
gemini_reroot_bug_report.log.gemini_reroot_bug_report.log
gemini_reroot_repro.py