fix bugs - #1
Merged
Merged
Conversation
When CelesTrak is unreachable (egress-blocked or rate-limited), tle_ingestion falls back to starlink_cache.tle. The cache only held 10 satellites, so the fleet capped at ~10-12 in that mode. Regenerate the cache as a 100-satellite Starlink shell (valid TLEs, real inclination/mean-motion, RAAN + golden-angle mean-anomaly spread) so the fallback shows a realistic constellation.
CelesTrak / satellites: - Bound the TLE fetch timeout (30s -> connect 5s / read 8s) so a blocked or rate-limited CelesTrak falls back to the local cache in seconds instead of hanging (this was what made INJECT feel dead on restricted networks). - fetch_and_parse can report its data source; tle_ingestion + startup now log 'CelesTrak (live)' vs 'local cache' honestly instead of always 'CelesTrak'. - (Cache already expanded to 100 sats in a prior commit.) Conjunction button: - Wrap run_pipeline() in demo_inject with error handling: real failures return a clean 500 detail; a completed-but-empty run returns status 'no_conjunction' instead of a misleading 'injected'. - Frontend inject handler now checks res.ok, shows an 'Injecting...' state, and surfaces success/empty/error via a new toast system (also used for WS connection loss) so failures are never silent. OrbitMind: - Correct stale 'YOLOv8' labels to YOLO26 (the model actually trained in the notebook) across backend, frontend, and the inference script. - Pin ultralytics>=8.3.0 (YOLO26-capable) and add a non-fatal Docker build-time smoke check (OrbitMind/check_model.py) that flags unresolved LFS weights or a too-old wheel in the build log. - Memoize per-frame inference so scrubbing/replaying a frame is instant instead of re-running YOLO26+pose on CPU; cache invalidated on upload/reset. - Return a clear 503 (not a cryptic 500) when weights/video are missing or are unresolved Git LFS pointers; the panel shows the reason. Deploy: - Add an LFS-aware GitHub Action that mirrors main to the Hugging Face Space so commits actually deploy (skips with a warning until HF_TOKEN is set).
There was a problem hiding this comment.
Pull request overview
This PR improves SpaceATC’s runtime robustness and user feedback by (1) making OrbitMind inference deployments fail “loudly” (clear 503s / build warnings) when Git LFS assets aren’t present, (2) reducing perceived UI dead-ends via frontend toast notifications, and (3) hardening TLE ingestion with faster network timeouts plus clearer source reporting (network vs local cache).
Changes:
- Add a frontend toast system and surface connection / demo-inject / Reflex errors to users.
- Add OrbitMind deployment guards: build-time YOLO weight smoke check, runtime 503s for missing/LFS-stub assets, and per-frame memoization.
- Improve TLE ingestion reliability: bounded httpx timeouts, local cache fallback with “source” returned to callers, and expand the bundled Starlink cache.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
OrbitMind/inference_video.py |
Updates CLI/help text and logs to reference YOLO26. |
OrbitMind/check_model.py |
Adds non-fatal build-time model/weights smoke check (warns on LFS pointer or load failure). |
frontend/src/store/useSpaceStore.ts |
Adds toast state + actions to the global Zustand store. |
frontend/src/hooks/useWebSocket.ts |
Emits toasts on WS disconnect/reconnect to improve operator awareness. |
frontend/src/components/Toast/Toast.tsx |
Introduces toast UI host + auto-dismiss behavior. |
frontend/src/components/ReflexPanel/ReflexPanel.tsx |
Surfaces backend error detail when Reflex frame fetch fails; updates YOLO labeling in UI copy. |
frontend/src/App.tsx |
Adds toast host to dashboard; improves demo inject UX (disable while in-flight + status toasts). |
Dockerfile |
Runs the OrbitMind model smoke check during image build (non-fatal). |
backend/requirements.txt |
Raises ultralytics minimum version to support the referenced detector model. |
backend/orbital/tle_client.py |
Adds bounded timeout + returns (text, source); optionally returns source from fetch_and_parse. |
backend/orbital/starlink_cache.tle |
Expands the bundled Starlink TLE cache used as a fallback. |
backend/main.py |
Uses fetch_and_parse(..., return_source=True) and logs the true TLE source. |
backend/api/routes.py |
Wraps demo inject pipeline errors and returns structured “no conjunction” result when appropriate. |
backend/api/reflex.py |
Adds asset guards (503 on missing/LFS stubs), adds per-frame memoization, clears cache on video changes, updates YOLO log text. |
backend/agents/nodes/tle_ingestion.py |
Propagates and reports TLE source (“live” vs “local cache” vs unavailable). |
.github/workflows/sync-to-hf.yml |
Adds workflow to sync Git LFS assets and push main to the Hugging Face Space repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
66
to
70
| logger.info( | ||
| "Fetched %.1f kB — approx %d satellites", | ||
| len(text) / 1024, | ||
| text.strip().count("\n") // 3, | ||
| ) |
Comment on lines
80
to
+85
| logger.info( | ||
| "Successfully loaded TLE data from local cache (%s) — approx %d satellites", | ||
| cache_path.name, | ||
| text.strip().count("\n") // 3, | ||
| ) | ||
| return text | ||
| return text, "local_cache" |
Comment on lines
+146
to
+148
| async def fetch_and_parse( | ||
| url: str = CELESTRAK_STARLINK_TLE, return_source: bool = False | ||
| ): |
Comment on lines
+349
to
+352
| state = await run_pipeline(latest_session_id) | ||
| except Exception as e: | ||
| logger.error("demo_inject pipeline failed: %s", e, exc_info=True) | ||
| raise HTTPException(status_code=500, detail=f"Conjunction pipeline failed: {e}") |
Comment on lines
+367
to
+368
| _FRAME_CACHE[cache_key] = response | ||
| return response |
Comment on lines
+39
to
+40
| # Force-push the current main onto the Space's main branch (LFS-aware). | ||
| git push --force "https://Rishet11:${HF_TOKEN}@huggingface.co/spaces/Rishet11/spaceatc" HEAD:main |
Rishet11
added a commit
that referenced
this pull request
Jun 21, 2026
Rishet11
added a commit
that referenced
this pull request
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.