Skip to content

Commit 652e9e0

Browse files
committed
Drop Mistral-specific dead code: plan_offer, Nix, default-off telemetry
Several subsystems were inherited from upstream Mistral Vibe and have no purpose in the Albert fork: - plan_offer: a 'Pro plan' upsell calling https://mistral.ai/whoami. Removed albert_code/cli/plan_offer/, all imports in app.py, the related test fixtures (tests/cli/plan_offer/), the snapshot test test_ui_snapshot_whats_new.py, and the plan_offer_gateway parameter threading through tests/conftest.py and the snapshot base app. - Nix packaging: flake.nix and flake.lock plus the nix-build matrix job in .github/workflows/build-and-upload.yml. - Telemetry: enable_telemetry default flipped from True to False so no events are sent to datalake.mistral.ai unless explicitly opted in. The code itself stays; full removal will come in a dedicated pass along with teleport/ and auth/ which are already dormant via nuage_enabled=False. Saves ~55 KB of source plus ~30 lines of CI; 1403/1403 unit tests still pass.
1 parent bdd2bfd commit 652e9e0

16 files changed

Lines changed: 8 additions & 1073 deletions

‎.github/workflows/build-and-upload.yml‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -151,32 +151,3 @@ jobs:
151151
files: release-assets/*.zip
152152
env:
153153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154-
155-
nix-build:
156-
needs: configure
157-
name: "Nix: ${{ matrix.os }}-${{ matrix.arch }}"
158-
permissions:
159-
contents: read
160-
strategy:
161-
matrix: ${{ fromJSON(needs.configure.outputs.matrix) }}
162-
runs-on: ${{ matrix.runner }}
163-
steps:
164-
- name: Checkout repository
165-
if: matrix.os != 'windows'
166-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
167-
168-
- name: Install Nix
169-
if: matrix.os != 'windows'
170-
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
171-
172-
- name: Build with Nix
173-
if: matrix.os != 'windows'
174-
shell: bash
175-
run: |
176-
nix build .#
177-
178-
- name: Nix Smoke Test
179-
if: matrix.os != 'windows'
180-
shell: bash
181-
run: |
182-
nix run .# -- --version

‎albert_code/cli/plan_offer/adapters/http_whoami_gateway.py‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎albert_code/cli/plan_offer/decide_plan_offer.py‎

Lines changed: 0 additions & 87 deletions
This file was deleted.

‎albert_code/cli/plan_offer/ports/whoami_gateway.py‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎albert_code/cli/textual_ui/app.py‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
from albert_code import __version__ as CORE_VERSION
2424
from albert_code.cli.clipboard import copy_selection_to_clipboard
2525
from albert_code.cli.commands import CommandRegistry
26-
from albert_code.cli.plan_offer.adapters.http_whoami_gateway import HttpWhoAmIGateway
27-
from albert_code.cli.plan_offer.decide_plan_offer import (
28-
PlanType,
29-
decide_plan_offer,
30-
plan_offer_cta,
31-
resolve_api_key_for_plan,
32-
)
33-
from albert_code.cli.plan_offer.ports.whoami_gateway import WhoAmIGateway
3426
from albert_code.cli.terminal_setup import setup_terminal
3527
from albert_code.cli.textual_ui.handlers.event_handler import EventHandler
3628
from albert_code.cli.textual_ui.notifications import (
@@ -219,7 +211,6 @@ def __init__(
219211
update_notifier: UpdateGateway | None = None,
220212
update_cache_repository: UpdateCacheRepository | None = None,
221213
current_version: str = CORE_VERSION,
222-
plan_offer_gateway: WhoAmIGateway | None = None,
223214
terminal_notifier: NotificationPort | None = None,
224215
**kwargs: Any,
225216
) -> None:
@@ -261,7 +252,6 @@ def __init__(
261252
self._update_notifier = update_notifier
262253
self._update_cache_repository = update_cache_repository
263254
self._current_version = current_version
264-
self._plan_offer_gateway = plan_offer_gateway
265255
self._initial_prompt = initial_prompt
266256
self._teleport_on_start = teleport_on_start and self.config.nuage_enabled
267257
self._last_escape_time: float | None = None
@@ -1579,9 +1569,6 @@ async def _check_and_show_whats_new(self) -> None:
15791569
content = load_whats_new_content()
15801570
if content is not None:
15811571
whats_new_message = WhatsNewMessage(content)
1582-
plan_offer = await self._plan_offer_cta()
1583-
if plan_offer is not None:
1584-
whats_new_message = WhatsNewMessage(f"{content}\n\n{plan_offer}")
15851572
if self._history_widget_indices:
15861573
whats_new_message.add_class("after-history")
15871574
messages_area = self._cached_messages_area or self.query_one("#messages")
@@ -1593,29 +1580,6 @@ async def _check_and_show_whats_new(self) -> None:
15931580
chat.anchor()
15941581
await mark_version_as_seen(self._current_version, self._update_cache_repository)
15951582

1596-
async def _plan_offer_cta(self) -> str | None:
1597-
self.plan_type = PlanType.UNKNOWN
1598-
1599-
if self._plan_offer_gateway is None:
1600-
return
1601-
1602-
try:
1603-
active_model = self.config.get_active_model()
1604-
provider = self.config.get_provider_for_model(active_model)
1605-
1606-
api_key = resolve_api_key_for_plan(provider)
1607-
action, plan_type = await decide_plan_offer(
1608-
api_key, self._plan_offer_gateway
1609-
)
1610-
1611-
self.plan_type = plan_type
1612-
return plan_offer_cta(action)
1613-
except Exception as exc:
1614-
logger.warning(
1615-
"Plan-offer check failed (%s).", type(exc).__name__, exc_info=True
1616-
)
1617-
return
1618-
16191583
async def _mount_and_scroll(
16201584
self, widget: Widget, after: Widget | None = None
16211585
) -> None:
@@ -1772,14 +1736,12 @@ def run_textual_ui(
17721736
) -> None:
17731737
update_notifier = PyPIUpdateGateway(project_name="albert-code")
17741738
update_cache_repository = FileSystemUpdateCacheRepository()
1775-
plan_offer_gateway = HttpWhoAmIGateway()
17761739
app = VibeApp(
17771740
agent_loop=agent_loop,
17781741
initial_prompt=initial_prompt,
17791742
teleport_on_start=teleport_on_start,
17801743
update_notifier=update_notifier,
17811744
update_cache_repository=update_cache_repository,
1782-
plan_offer_gateway=plan_offer_gateway,
17831745
)
17841746
session_id = app.run()
17851747
_print_session_resume_message(session_id)

‎albert_code/core/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class VibeConfig(BaseSettings):
364364
context_warnings: bool = False
365365
auto_approve: bool = False
366366
auto_fallback_enabled: bool = True
367-
enable_telemetry: bool = True
367+
enable_telemetry: bool = False
368368
system_prompt_id: str = "cli"
369369
include_commit_signature: bool = True
370370
include_model_info: bool = True

0 commit comments

Comments
 (0)