Chọn một blueprint được cấu hình sẵn cho mô hình kinh doanh của bạn. Hệ thống sẽ tự động khởi tạo sơ đồ tổ chức, các agents chuyên môn và quy trình chạy pipeline tương ứng.
{deploying?"Đang cấu hình Swarm phòng ban...":errorMsg?"Triển khai thất bại":"Triển khai thành công!"}
</h3>
<pclassName="text-xs text-muted-foreground mt-1">
{deploying?"Mô hình tác nhân chuyên biệt đang được setup hoàn thiện.":errorMsg?"Vui lòng kiểm tra lại thông số cấu hình.":"Đang đưa bạn đến bảng điều khiển phòng ban..."}
Agent chạy xong nhưng không ghi bất kỳ file nào vào `workspaces/{company_id}/shared/`.
CEO report có status "completed" nhưng không có nội dung thật.
## 🎯 Success criteria
```
python backend/scratch/demo_e2e.py
→ "deliverables": ["ceo_output.md", "pm_output.md", ...] ← KHÔNG rỗng
→ workspaces/{company_id}/shared/*.md có nội dung thật
```
---
## ✅ Checklist
### Phase 1 — Diagnose
-[] D1. Đọc `backend/services/project_orchestrator.py` L459-540 (`_run_single_agent`) — xem system_message truyền vào agent như thế nào
-[] D2. Xem `backend/api/routes/agents.py` → `run_agent_in_background` — agent có nhận system_message không, output được lưu ở đâu
-[] D3. Kiểm tra `HeartbeatRun` model có field `output` / `result` không:
```bash
./.venv/Scripts/python.exe -c "import sqlite3; conn=sqlite3.connect('../.codegraph/codegraph.db'); print(conn.execute(\"SELECT signature FROM nodes WHERE name='HeartbeatRun' AND kind='class'\").fetchall())"
```
### Phase 2 — Fix (chọn 1 trong 2 cách)
**Cách A — System Prompt Injection (khuyến nghị, ít invasive)**
-[] A1. Trong `_run_single_agent` (project_orchestrator.py), sửa `system_message`:
> ⚠️ Dùng camelCase trong TypeScript interface OK, nhưng JSON key gửi lên phải match với gì FE đang dùng. Check `CaseConversionMiddleware` behavior — BE nhận snake_case sau khi middleware convert từ camelCase của FE.
### Phase 3 — Tạo page component
- [ ] B1. Tạo `frontend/src/pages/Onboarding.tsx`:
Support custom plugins, custom skills, and environment variables (secrets) defined in company blueprints to be automatically provisioned during deployment.
## 🎯 Success criteria
-[x] Schema extensions in `CompanyBlueprint` inside `backend/schemas/blueprint.py` to support `plugins`, `skills`, and `env_vars`.
-[x] BlueprintService modified to automatically populate tables `CompanySecret`, `CompanySkill`, and `PluginConfig` when deploying from blueprint.
-[x] Sensitive keys are automatically flagged as `is_sensitive=True`.
-[x] E2E backend tests verifying correct provisioning and creation of objects added.