Skip to content

Align the Python quickstart with the current backend and web client flow#5

Open
digitallysavvy wants to merge 15 commits intomainfrom
updates
Open

Align the Python quickstart with the current backend and web client flow#5
digitallysavvy wants to merge 15 commits intomainfrom
updates

Conversation

@digitallysavvy
Copy link
Copy Markdown

This PR agent-quickstart-python to match the current expected runtime shape for a Python backend plus React frontend. The backend now uses an async FastAPI path with requester-scoped agent sessions and stateless-safe stop behavior. The web client now uses the shared conversation UI flow, a StrictMode-safe RTC lifecycle, correct transcript normalization, and token renewal. The setup path was also fixed so bun install from the repo root actually manages the frontend package.

What Changed

  • Backend
    • Switched the FastAPI service to AsyncAgora
    • Converted request handlers to async def
    • Scoped agent sessions to the requesting user instead of remote_uids=["*"]
    • Made stop idempotent with a fallback to client.stop_agent(...)
    • Reduced token lifetime to 1 hour so the client can renew RTC and RTM tokens
    • Aligned the default agent config more closely with the current reference behavior
  • Frontend
    • Replaced the custom shell with the shared conversation UI primitives
    • Moved RTC client creation to a useRef pattern to avoid StrictMode double creation
    • Normalized transcript UIDs instead of treating every nonzero speaker as the agent
    • Added token renewal handling for RTC and RTM
    • Updated frontend package versions and Tailwind scanning for the shared UI package
    • Removed obsolete custom transcript/log/store code
  • Setup and docs
    • Added the missing server-python/.env.example
    • Fixed setup instructions to point at the real env template
    • Updated architecture docs to match the implemented backend and frontend behavior
    • Converted the repo root to a Bun workspace so root bun install manages web-client
    • Removed the conflicting nested web-client/bun.lock

Why

The Python quickstart had drifted from the current implementation expectations in a few important ways:

  • agent sessions were not requester-scoped
  • the frontend UI and lifecycle differed from the shared conversation flow
  • token handling differed from the renewal-based session model
  • setup instructions referenced missing files
  • root bun install did not actually manage frontend dependencies

This change closes those gaps and makes the repo’s setup, runtime behavior, and docs consistent with each other.

Validation

  • python3 -m py_compile server-python/src/server.py server-python/src/agent.py
  • bun install from the repo root after converting to a workspace

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-quickstart-python-mason Error Error Apr 25, 2026 3:04am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants