diff --git a/app/core/deep_agent.py b/app/core/deep_agent.py index 61c3c7f..fb48499 100644 --- a/app/core/deep_agent.py +++ b/app/core/deep_agent.py @@ -127,14 +127,22 @@ async def build_brief_multi_project_manifest() -> str: if not projects: return "" blocks: list[str] = [""] + any_entry = False for p in projects: - files = sorted(p.get("files", []), key=lambda f: f.get("mtimeMs", 0), reverse=True)[:5] - if not files: - continue + all_files = p.get("files", []) or [] + files = sorted(all_files, key=lambda f: f.get("mtimeMs", 0), reverse=True)[:5] blocks.append(f"project: {p.get('projectName','?')} [{p.get('projectId','?')}]") blocks.append(f" path: {p.get('folderPath','?')} (scanned {p.get('lastScannedAt','?')})") - for f in files: - blocks.append(f" - /{f['relPath']} [{f.get('kind','text')}] {f.get('summary','')}") + if not all_files: + blocks.append(" (no indexed files yet — folder is linked but empty or unscanned)") + else: + for f in files: + blocks.append(f" - /{f['relPath']} [{f.get('kind','text')}] {f.get('summary','')}") + if len(all_files) > 5: + blocks.append(f" … {len(all_files) - 5} more files (use read_project_folder_file by relPath)") + any_entry = True + if not any_entry: + return "" blocks.append("") return "\n".join(blocks)