Commit History
-
Fix backend crash: Make prompt imports optional with fallbacks
Issue: Backend (port 8000) was crashing on startup, causing ECONNREFUSED errors Root cause: New imports from anycoder_app.prompts and docs_manager were failing due to Gradio dependencies that aren't available in backend-only mode Fix: - Wrap all anycoder_app imports in try/except blocks - Provide fallback prompts if imports fail - Backend will start successfully even if prompt imports fail - Nested try/except: outer for basic prompts, inner for dynamic Gradio/ComfyUI prompts - Add startup logging to track which prompts are loaded - Backend now resilient to missing dependencies This ensures: ✅ Backend always starts on port 8000 ✅ Frontend can fetch /api/languages and /api/models ✅ Language and model dropdowns populate correctly ✅ System uses best available prompts (full or fallback) ✅ No more ECONNREFUSED errors9de4a40 -
Fix streaming and use proper system prompts
Issues fixed: 1. Streaming not working properly - code only appeared at the end 2. Not using language-specific prompts from prompts.py Backend changes (backend_api.py): - Import system prompts from anycoder_app/prompts.py - Initialize Gradio and ComfyUI prompts on startup via docs_manager - Use language-specific prompts (HTML, Gradio, Streamlit, React, etc.) - Add proper system prompt selection based on language parameter - Improve streaming with smaller sleep intervals (0.01s) for immediate flush - Add chunk counting and logging for debugging - Add detailed logging for prompt selection Frontend changes (page.tsx, api.ts): - Add console logging to track chunk reception - Log SSE events for debugging - Log buffer sizes and chunk lengths - Track generation completion with total code length This ensures: ✅ Proper language-specific prompts are used (HTML, Gradio, Streamlit, etc.) ✅ Streaming works immediately with chunks appearing in real-time ✅ Better debugging with console logs ✅ Back…7523755 -
Fix deployment: Use OAuth session tokens properly
Key changes: - Update MockAuth to accept username parameter - get_auth_from_header now looks up OAuth sessions to extract access_token - Session tokens are properly resolved to HF OAuth access tokens - Added detailed logging throughout deployment process - Better error handling with user-friendly messages for 401/403 errors - Added HfApi.whoami() call to verify token and get username - Improved error messages for authentication and permission issues This ensures the deploy endpoint uses the proper OAuth token from the authenticated session rather than trying to use a session UUID directly.0fb9638 -
Fix API connectivity in Docker Space
Root cause: NEXT_PUBLIC_API_URL was defaulting to 'http://localhost:8000' which made the browser try to reach localhost instead of using Next.js proxy. Fixes: - Remove default value for NEXT_PUBLIC_API_URL in next.config.js - Only set NEXT_PUBLIC_API_URL if explicitly provided - In Docker Space, frontend uses relative URLs (empty string) - Next.js server proxies /api/* to localhost:8000 backend - Add console.log debugging to trace API URL resolution - Add comments explaining Docker Space proxy architecture This ensures: ✅ Production: Browser -> /api/models -> Next.js proxy -> localhost:8000/api/models ✅ Dev: Browser -> http://localhost:8000/api/models (direct)d84050d -
Add loading states and debugging to ControlPanel
- Show 'Loading...' while fetching models and languages - Show 'No models/languages available' if API fails - Add console.log debugging to see what's being loaded - Disable dropdowns while loading - This will help identify if API calls are failing5fd62fb -
Fix NameError: move SPACE_HOST definition before CORS configuration
- SPACE_HOST was being used before it was defined, causing NameError - Moved OAuth and environment variables before CORS middleware - This was breaking the sign-in and preventing the backend from starting90a15f5 -
Fix empty Language and AI Model dropdowns
- Update CORS configuration to allow HuggingFace Space domain and use regex for *.hf.space - Improve API URL logic in frontend to correctly detect production vs dev environment - Fix EventSource and WebSocket URL construction to work in both environments - Allow requests from localhost:7860 for Docker Space internal communicationebdc25f -
Implement server-side OAuth for Docker Space
- Add OAuth endpoints to FastAPI backend (/api/auth/login, /api/auth/callback, /api/auth/session) - Replace client-side OAuth with server-side flow using OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET - Handle HuggingFace OAuth callback and token exchange - Create session management for authenticated users - Update frontend to use backend OAuth endpoints instead of @huggingface/hub - Remove @huggingface/hub dependency (not needed for Docker Spaces) - Fix 'Failed to start login process' error by implementing proper Docker Space OAuthc6abd4e -
Fix TypeScript error in file extension logic
f4952e1 -
add files
98b7f49 -
update
cbfc118 -
update
76d15d9 -
fix
a922ba4 -
update
0ce2018 -
new UI
b42dfef
-
Update README.md
Verified signaturea8247a1 -
Update README.md
Verified signature8c27349 -
add sherlock models
6d2d0b8
-
add gpt 5.1 models
00f9681
-
update default
4f952b3
-
fix issue
78016c6 -
fix inference provider show up in history
185b4ff -
add inference provider code
c2c7255 -
fix
ee44e03 -
Update README.md
Verified signatured35c4d3 -
add agent mode
0a3c558 -
show defaults
e9d0363
-
add trending models and spaces
ff04326 -
update
b3264d8 -
add chatbot and mobile link
4f7c59c -
update prompt
51fb7e5 -
update
71563bc -
update react app
24bc760 -
update react app code
9007f56 -
update
ede0c7c -
update
a6cd23f -
update streamlit issue
cb0c0c1 -
fix system prompt issue
84be902 -
fix system prompt
2c4fd95 -
fix
4843971 -
fix
d4d9f52 -
fix
c84101b -
update
f2c450a -
update
2db0fee -
fix issue
3e14d32 -
major update
715bb35 -
remove upload temp media files
df3c3c8 -
fix
eefc4be -
fix output
5f2a64e -
fix
75b0a4c