Errors 400 occur when switching between different models within the same session

Errors 400 occur when switching between different models within the same session. gemini 4 argon => gemini nano banana 2.1 => gemini 4 argon, then has error. INVALID_ARGUMENT

## Title

Generic 400 INVALID_ARGUMENT after switching from an image model back to a text model with mixed history

## Report

We would appreciate guidance on transferring a conversation between Gemini models, and on diagnosing a generic validation error. We have not established whether this is an API defect or incorrect history handling in our application.

### Environment

- Python 3.11, Linux container.

- Official Python SDK: `google-genai==2.31.0`.

- HTTP client: `httpx==0.28.1`, supplied through `HttpOptions.httpx_async_client`.

- Endpoint: `https://generativelanguage.googleapis.com/v1beta/\`.

- Text model: `gemini-4-argon`.

- Image model: `gemini-nano-banana-2.1`.

- Observed on October 24, 2026.

### Observed sequence

1. A text request to the text model completed successfully.

2. The conversation switched to the image model. Two subsequent turns completed successfully and each produced an image.

3. The conversation switched back to the text model. Our application replayed the completed history, including the image model’s text, image Parts, and thought signatures, then appended a new user text prompt.

4. Three application requests failed with HTTP 400 before returning generated content.

The initial failing request contained seven Content entries:

```text

user → text prompt

model → text-model response Parts, including its signature

user → image-generation prompt

model → first image-model response Parts, including text, image, and signatures

user → follow-up prompt

model → second image-model response Parts, including text, image, and signatures

user → new text prompt for the text model

```

Images were supplied as `inline_data`. The reconstructed request contained two image Parts and five thought signatures in total. Our persistence code stores signatures as bytes and restores them to their original Part positions. We have not verified that signatures originating from the image model are valid inputs to the text model.

### Constrained diagnostic results

To limit cost, we performed one standalone baseline request and one replay of the initial failing context. Both used:

```python

config = types.GenerateContentConfig(

tools=[types.Tool(google_search=types.GoogleSearch())],

thinking_config=types.ThinkingConfig(thinking_level=“MEDIUM”),

max_output_tokens=1,

)

options = types.HttpOptions(

timeout=30000,

retry_options=types.HttpRetryOptions(attempts=1),

)

# Authentication is supplied from a server-side environment variable.

# Use client.models.generate_content_stream(…).

```

- Baseline: only the synthetic user text `Reply 1.`, with no history, images, or signatures. The request succeeded, reporting 221 input tokens and one output token, with finish reason `MAX_TOKENS`, consistent with the diagnostic output cap.

- Mixed-history replay: the seven Content entries described above. Exactly one attempt was made. It failed with the following response:

```json

{

“code”: 400,

“status”: “INVALID_ARGUMENT”,

“message”: “Request contains an invalid argument.”

}

```

The SDK exposed no additional error details (`details=[]`). The failing response did not include token usage. No diagnostic request generated or saved an image.

### Questions

1. Is replaying image-model response Parts, including their thought signatures, into this text model supported?

2. When switching models, should applications remove signatures from the previous model, convert prior generated images to user-provided reference images, or start a new model context?

3. Can validation errors identify the offending field or Content/Part index, and distinguish an incompatible signature from an unsupported historical image Part?

4. What is the recommended supported representation of mixed-model conversation history?

We understand that manual history reconstruction could be responsible. The standalone baseline and mixed-history replay differ in their contents, but we have not performed signature-only or image-only isolation tests, so neither signatures nor image Parts have been proven to be the specific cause.

### Relevant documentation

- Troubleshooting: google.dev/gemini-api/docs/troubleshooting

- GenerateContent thought signatures: google.dev/gemini-api/docs/generate-content/thought-signatures