Co-authored-by: Antoine <33425718+anth2o@users.noreply.github.com>
Co-authored-by: Bastien <bastien.baret@gmail.com>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Robin Gullo <robin.gullo@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Drouin 2026-04-28 17:44:07 +02:00 committed by GitHub
parent a83c81ecf5
commit 632ea8c032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
253 changed files with 13965 additions and 2525 deletions

View file

@ -9,6 +9,9 @@ from textual.widgets import Input
from vibe.core.config import ProviderConfig
from vibe.core.paths import GLOBAL_ENV_FILE
from vibe.core.telemetry.build_metadata import build_entrypoint_metadata
from vibe.core.telemetry.send import TelemetryClient
from vibe.core.types import Backend
from vibe.setup.onboarding import OnboardingApp
from vibe.setup.onboarding.screens.api_key import ApiKeyScreen, persist_api_key
@ -118,3 +121,39 @@ def test_persist_api_key_returns_env_var_error_for_empty_env_var_name() -> None:
result = persist_api_key(provider, "secret")
assert result == "env_var_error:<empty>"
def test_persist_api_key_sends_onboarding_telemetry_with_entrypoint_metadata(
monkeypatch: pytest.MonkeyPatch,
) -> None:
recorded_metadata: dict[str, str] = {}
def capture(self: TelemetryClient) -> None:
recorded_metadata.update(self.build_client_event_metadata())
monkeypatch.setattr(TelemetryClient, "send_onboarding_api_key_added", capture)
provider = ProviderConfig(
name="mistral",
api_base="https://api.mistral.ai/v1",
api_key_env_var="MISTRAL_API_KEY",
backend=Backend.MISTRAL,
)
result = persist_api_key(
provider,
"secret",
entrypoint_metadata=build_entrypoint_metadata(
agent_entrypoint="cli",
agent_version="1.0.0",
client_name="vibe_cli",
client_version="1.0.0",
),
)
assert result == "completed"
assert recorded_metadata["agent_entrypoint"] == "cli"
assert recorded_metadata["agent_version"] == "1.0.0"
assert recorded_metadata["client_name"] == "vibe_cli"
assert recorded_metadata["client_version"] == "1.0.0"
assert "session_id" not in recorded_metadata