Skip to content

Commit c81b3d0

Browse files
feat: demo GIF of a real generation, quiet SDK AFC advisory
- docs/demo.gif: real end-to-end recording (asciinema + agg after vhs could not drive ttyd on this machine): stage -> gitmate commit -> real gemini-3.5-flash-lite generation -> typed accept -> git log proof. - Pin google_genai.models logger to ERROR: the SDK's once-per-process AFC advisory printed above every generated message; genuine errors remain.
1 parent 6d9b87e commit c81b3d0

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎docs/demo.gif‎

79.3 KB
Loading

‎src/gitmate/providers/gemini.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import logging
56
from typing import TYPE_CHECKING
67

78
from tenacity import (
@@ -14,6 +15,12 @@
1415

1516
from gitmate.providers.base import LLMResponse, ProviderUnavailable, RetryableProviderError
1617

18+
# The SDK emits a once-per-process AFC advisory via logger.warning on every
19+
# Models.generate_content call; it is irrelevant to gitmate's single-shot
20+
# usage and pollutes the commit flow's output, so quiet that channel to
21+
# ERROR while leaving genuine SDK errors audible.
22+
logging.getLogger("google_genai.models").setLevel(logging.ERROR)
23+
1724
if TYPE_CHECKING:
1825
from google import genai
1926
from google.genai import types

‎tests/test_providers.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,11 @@ def test_cached_provider_underlying_property(tmp_path: Path) -> None:
265265
assert cached.underlying is fake
266266
finally:
267267
cached.close()
268+
269+
270+
def test_sdk_afc_advisory_quieted() -> None:
271+
# The SDK's once-per-process AFC warning would otherwise print above
272+
# every generated commit message; the provider pins that logger to ERROR.
273+
import logging
274+
275+
assert logging.getLogger("google_genai.models").level == logging.ERROR

0 commit comments

Comments
 (0)