- Move /health route into registerHealthRoutes function for backward compatibility
- Update index.ts to only call registerHealthRoutes once
- Now provides 3 endpoints: /health, /health/liveness, /health/readiness
Fixes: FastifyError Method 'GET' already declared for route '/health'
- Add platform infrastructure chapter to frontend-backend architecture design
- Update system architecture document with 6 new infrastructure modules
- Update AI onboarding guide with infrastructure overview
- Link to backend/src/common/README.md for detailed usage guide
Key Updates:
- Storage service (LocalAdapter + OSSAdapter)
- Logging system (Winston + JSON format)
- Cache service (Memory + Redis)
- Async job queue (Memory + Database)
- Health check endpoints
- Monitoring metrics
- Database connection pool
- Environment config management
All modules support zero-code switching between local and cloud environments.
Related: #Platform-Infrastructure
- System architecture and design documentation
- Business module docs (ASL/AIA/PKB/RVW/DC/SSA/ST)
- ASL module complete design (quality assurance, tech selection)
- Platform layer and common capabilities docs
- Development standards and API specifications
- Deployment and operations guides
- Project management and milestone tracking
- Architecture implementation reports
- Documentation templates and guides
- Add batch processing API and mode
- Add deep read mode for full-text analysis
- Add document selector and switcher components
- Add review page with editorial and methodology assessment
- Add capacity indicator and usage info modal
- Add custom hooks for batch tasks and chat modes
- Update layouts and routing
- Add TypeScript types for chat features
- Add common/ layer for shared capabilities (LLM, RAG, document, middleware)
- Add legacy/ layer for existing business code
- Move files to new structure (controllers, routes, services)
- Update index.ts for new route registration
- System remains fully functional
- Day 21-22: fix CORS and file upload issues
- Day 23-24: implement @knowledge base search and conversation integration
- Backend: integrate Dify RAG into conversation system
- Frontend: load knowledge base list and @ reference feature
Previous limit was too conservative:
- Old: 10 messages (5 conversation turns) 鉂?Too limited
- New: 100 messages (50 conversation turns) 鉁?Reasonable
Context capacity comparison:
- DeepSeek-V3: 64K tokens 鈮?100-200 turns
- Qwen3-72B: 128K tokens 鈮?200-400 turns
- Previous 10 messages was only using ~1% of capacity
Real usage scenarios:
- Quick consultation: 5-10 turns
- In-depth discussion: 20-50 turns 鉁?Common
- Complete research design: 50-100 turns
The new 100-message limit covers 99% of real use cases while
staying well within model token limits.
Critical bug fix: Project background was being sent with EVERY message,
causing AI to respond to background instead of follow-up questions.
Problem:
- First message: User asks A, AI answers A 鉁?- Second message: User asks B, but prompt includes background again
- AI responds to background content, ignores question B 鉂?
Solution:
- Only send full prompt template (with project background) on FIRST message
- For follow-up messages, send ONLY user input (+ knowledge base if exists)
- Maintain conversation history properly
Updated: conversationService.assembleContext()
- Check if historyMessages.length === 0 (first message)
- First message: use renderUserPrompt() with all variables
- Follow-up: send userInput directly (optionally with knowledge base)
This ensures multi-turn conversations work correctly.
Major layout optimizations to increase chat area:
1. MainLayout improvements:
- Remove Content padding/margin (was 24px + 24px = 48px wasted)
- Reduce Sider width from 280px to 240px
- Set Content overflow:hidden and flex layout
2. AgentChatPage improvements:
- Replace large Card header with compact toolbar (saved ~40px)
- Remove Card wrapper (saved border/padding)
- Direct div layout for chat area
3. Other pages:
- Added padding:24px to HomePage/KnowledgePage/HistoryPage
- Maintain consistent spacing for non-chat pages
Result: Chat window now occupies ~85% of screen height instead of ~33%
Verified working: AI responses, scrolling, and UI display
1. Fixed double data unwrapping in AgentChatPage
2. Fixed API URL in sendMessageStream (use relative path /api/v1)
Verified working: AI can now respond to messages
Changed userId from '1' to 'user-mock-001' in all conversation controller methods to match the actual mock user created in database.
This fixes the 400 error when creating conversations.
Issue: projectApi and agentApi were unwrapping response.data twice:
1. request interceptor returns response.data
2. API functions returned response.data again (undefined)
This caused all API calls to fail silently with 'response.success' being undefined.
Fixed:
- projectApi: Removed redundant .data access
- agentApi: Removed redundant .data access
All API functions now correctly return the backend response:
{ success: true, data: [...] }
This fixes:
- '鑾峰彇椤圭洰鍒楄〃澶辫触' error on page load
- '鍒涘缓椤圭洰澶辫触' error when creating projects
- Any other API call failures
Issues fixed:
1. Frontend port is 3000 (not 5173)
2. Projects API returns 500 due to missing user
3. Foreign key constraint violation on projects_user_id_fkey
Solutions:
- Created create-mock-user.ts script
- Added user-mock-001 to database
- Created startup guide (娴嬭瘯鍜屽惎鍔?md)
- Created one-click launcher (涓€閿惎鍔?bat)
- Created diagnostic tool (璇婃柇闂.bat)
New files:
- backend/src/scripts/create-mock-user.ts
- 娴嬭瘯鍜屽惎鍔?md
- 涓€閿惎鍔?bat
- 璇婃柇闂.bat