Remove or gate cloud integrations: Grok, Claude backends behind proper feature flags #30

Closed
opened 2026-03-14 13:33:35 +00:00 by Rockachopa · 0 comments
Owner

What

The Grok and Claude backends in timmy/backends.py (240+ lines) are cloud API clients. They're properly gated behind grok_enabled / claude_available() checks, but:

  1. The fallback chain in agent.py auto-falls-back to Claude if Ollama is unreachable — this means a network blip could silently send your data to Anthropic's API
  2. The Grok backend imports openai SDK and makes calls to api.x.ai — a cloud dependency
  3. Config has anthropic-backup and openai-backup providers defined (disabled, but present)

Sovereignty concern

Line 148 in agent.py:

if not _check_model_available(model_name):
    if claude_available():
        logger.warning("Ollama unreachable — falling back to Claude backend")
        return ClaudeBackend()

This is a silent cloud fallback. If Ollama crashes, Timmy starts sending your conversations to Anthropic without explicit consent.

What to do

  1. Remove the auto-fallback to Claude in agent.py. If Ollama is down, fail loudly.
  2. Make cloud backends require explicit --backend claude or --backend grok CLI flag
  3. Consider moving cloud backends to a separate optional package (pip install timmy[cloud])
  4. Add a startup warning if any cloud backend is enabled

Files

  • src/timmy/agent.py lines 143-148 — remove silent fallback
  • src/timmy/backends.py — keep but gate more strictly
  • src/config.py — ensure cloud settings are off by default

Estimated effort: 1 hour

## What The Grok and Claude backends in `timmy/backends.py` (240+ lines) are cloud API clients. They're properly gated behind `grok_enabled` / `claude_available()` checks, but: 1. The fallback chain in `agent.py` auto-falls-back to Claude if Ollama is unreachable — this means a network blip could silently send your data to Anthropic's API 2. The Grok backend imports `openai` SDK and makes calls to `api.x.ai` — a cloud dependency 3. Config has `anthropic-backup` and `openai-backup` providers defined (disabled, but present) ## Sovereignty concern Line 148 in `agent.py`: ```python if not _check_model_available(model_name): if claude_available(): logger.warning("Ollama unreachable — falling back to Claude backend") return ClaudeBackend() ``` This is a **silent cloud fallback**. If Ollama crashes, Timmy starts sending your conversations to Anthropic without explicit consent. ## What to do 1. Remove the auto-fallback to Claude in `agent.py`. If Ollama is down, fail loudly. 2. Make cloud backends require explicit `--backend claude` or `--backend grok` CLI flag 3. Consider moving cloud backends to a separate optional package (`pip install timmy[cloud]`) 4. Add a startup warning if any cloud backend is enabled ## Files - `src/timmy/agent.py` lines 143-148 — remove silent fallback - `src/timmy/backends.py` — keep but gate more strictly - `src/config.py` — ensure cloud settings are off by default ## Estimated effort: 1 hour
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#30