AltimateAI / AltimateAI/altimate-code

fix: TUI shows blank screen and hangs when no internet connection

Offen
#181 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
811
Forks
134
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
50

Beschreibung

### What does this PR do?

When launched without an internet connection, the TUI shows a blank screen and hangs indefinitely. The user sees no UI, no error message, and no way to proceed.

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

### Issue for this PR

N/A — discovered during testing.

### Steps to Reproduce

1. Disconnect from the internet (Wi-Fi off or airplane mode)
2. Run `altimate-code` (TUI mode)
3. Observe: blank screen, no UI rendered, process hangs

### Expected Behavior

The TUI should render immediately and show a warning that it's offline. Core functionality that doesn't require internet (local file operations, cached models) should still work.

### Root Cause (likely)

The startup flow likely blocks on one or more network calls:
- `models.dev` API fetch for model list
- Update check (`upgrade`)
- Provider authentication validation

These calls should have short timeouts and fail gracefully, allowing the TUI to render with cached/fallback data.

### Suggested Fix

1. Add timeouts (3-5s) to all startup network calls
2. Use cached model data when fetch fails
3. Render the TUI immediately, then populate model data asynchronously
4. Show a toast/warning when offline: "No internet — using cached data"

### Checklist

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own changes

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.