Skip to content

Build HF Docker Space text-adventure TUI (React + FastAPI + Llama 3)

Session from build-small-agent-trace on Hugging Face by drdavidtang · MIT · condensed by Coders Talk

24msession
0interventions
GOAL

Build a self-contained Hugging Face Docker Space app: a retro terminal UI for a storyboarding text adventure, using React/xterm.js frontend and FastAPI backend calling HF Inference APIs for narrative and ASCII art generation.

  1. Prompt · +0
    Build a full HF Docker Space text-adventure app: React/xterm.js TUI frontend, FastAPI backend using Llama 3 for narrative and FLUX/Pillow for ASCII art, stateless /api/chat endpoint
  2. Agent did · +0m
    Installed frontend npm deps and ran build; hit a tsconfig TS5096 error and fixed it inline before the build passed
  3. Agent did · +1m
    Set up backend: created .gitignore/.dockerignore, built a local venv, installed pinned Python deps, then built the full multi-stage Docker image
  4. Fail · +2m
    In-container smoke test crashed: starlette TestClient required httpx, which wasn't installed in the image
  5. Agent did · +7m
    Fixed the dependency gap, reran the smoke test until API routes and static bundle passed, then delivered the full app summary (FastAPI chat endpoint, Llama 3 narrative, FLUX/Pillow ASCII art, React TUI, Docker build)
  6. Agent did · +8m
    Bumped runtime to Python 3.14 (Pillow 12.0.0, Pydantic 2.12.5), rebuilt the Docker image and verified the new runtime in-container
  7. Prompt · +18m
    push code to [email protected]:spaces/build-small-hackathon/storyboard-tui
  8. Fail · +18m
    git push over SSH failed: host key verification failed for hf.co
  9. Agent did · +19m
    Added hf.co's SSH host key, diagnosed a subsequent auth rejection, located the right local SSH identity, merged the Space's initial history with the app commits, then reran the build/verify checks
  10. Outcome · +24m
    Pushed the merged main branch (verified frontend build, backend compile, and git diff checks) to the Hugging Face Space [email protected]:spaces/build-small-hackathon/storyboard-tui
VERDICT

I'd open with the Python version pinned upfront and the deployment target/SSH access sorted before asking for a push — the 3.14 bump and the SSH host-key/auth dance both cost real time that a clearer first prompt would've avoided. The fix that actually mattered was letting the agent self-diagnose the httpx and SSH auth failures in-place rather than me stepping in; it resolved both without any correction from me.

I tried this · 0

Discussion · 0

How Builds work