Commit 8f85260
fix(live): history_config rejection on Vertex/Enterprise Live sessions
Merge google#6035
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
### Link to Issue or Description of Change
**Problem:**
On the Vertex AI / Gemini Enterprise Agent Platform backend, ADK auto-injects `history_config` into the Live setup message when seeding conversation history. That backend has no `history_config` field and rejects it with `ValueError: history_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode`
**Solution:**
Gate the history_config auto-injection to the Gemini Developer API backend only (`isinstance(llm, Gemini)` and `llm._api_backend == GoogleLLMVariant.GEMINI_API`). On Vertex, history is already seeded via the sanctioned `send_history` (`send_client_content`) path.
### Testing Plan
**Unit Tests:**
- [X] I have added or updated unit tests for my change.
- [X] All unit tests pass locally.
$ pytest tests/unittests/flows/llm_flows/test_base_llm_flow.py -k history_config
2 passed, 35 deselected, 4 warnings in 0.78s
**Manual End-to-End (E2E) Tests:**
Verified intended functionality in ADK web.
### Checklist
- [X] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [X] I have performed a self-review of my own code.
- [X] I have commented my code, particularly in hard-to-understand areas.
- [X] I have added tests that prove my fix is effective or that my feature works.
- [X] New and existing unit tests pass locally with my changes.
- [X] I have manually tested my changes end-to-end.
- [X] Any dependent changes have been merged and published in downstream modules.
### Additional context
N/A
COPYBARA_INTEGRATE_REVIEW=google#6035 from allen-stephen:fix/live-history-config-bug cf8e1fc
PiperOrigin-RevId: 9334026071 parent 780b0ab commit 8f85260
2 files changed
Lines changed: 81 additions & 10 deletions
File tree
- src/google/adk/flows/llm_flows
- tests/unittests/flows/llm_flows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
558 | 565 | | |
559 | 566 | | |
560 | 567 | | |
| 568 | + | |
| 569 | + | |
561 | 570 | | |
562 | 571 | | |
563 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1402 | 1402 | | |
1403 | 1403 | | |
1404 | 1404 | | |
1405 | | - | |
1406 | | - | |
1407 | | - | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
| 1405 | + | |
| 1406 | + | |
1414 | 1407 | | |
1415 | 1408 | | |
1416 | 1409 | | |
| |||
1457 | 1450 | | |
1458 | 1451 | | |
1459 | 1452 | | |
1460 | | - | |
| 1453 | + | |
1461 | 1454 | | |
1462 | 1455 | | |
1463 | 1456 | | |
| |||
1475 | 1468 | | |
1476 | 1469 | | |
1477 | 1470 | | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1478 | 1540 | | |
1479 | 1541 | | |
1480 | 1542 | | |
| |||
0 commit comments