Commit Graph

62 Commits

Author SHA1 Message Date
Krishav Raj Singh c9c07c4860 update sandbox 2025-10-08 15:34:06 +05:30
marko-kraemer ddf2d32f59 feat(admin): add user thread viewer with admin access bypass
 Features:
- Add admin portal thread viewer with pagination
- Display thread list with project names and public status
- Add clickable links to view threads via /share/{thread_id}
- Add admin bypass for accessing all threads (public and private)

🔧 Backend Refactoring:
- Consolidate admin APIs into admin_api.py and billing_admin_api.py
- Remove unused files: users_admin.py, admin/api.py
- Remove unused endpoints: user search, grant-bulk-credits, migrate-user
- Update admin thread endpoint to use share URLs

 Performance:
- Remove message_count from UserThreadSummary (optimization)
- Remove N+1 query issue in thread listing

🔒 Authorization:
- Add admin role bypass in verify_and_authorize_thread_access
- Create RLS migration (20251005160000_admin_roles_access.sql)
- Update thread_select_policy for admin access
- Update message_select_policy for admin access
- Update project_select_policy for admin access
- Update agent_runs_select_policy for admin access

💻 Frontend:
- Add Threads tab to admin user details dialog
- Add useAdminUserThreads hook with pagination
- Remove unused admin hooks (useAdminUserSearch, useAdminAdvancedSearch)
- Display thread metadata with Open button and ExternalLink icon

🗃️ Database:
- Apply RLS policies allowing admin/super_admin roles to bypass restrictions
- Admins can now view any thread, message, project, or agent_run

This enables admins to view and debug any user's threads through the
share page interface, regardless of public/private status.
2025-10-05 18:09:26 +02:00
marko-kraemer 0ec17b0d3a refactor: completely remove workflow and playbook system
- Remove workflow_tool.py and all workflow-related backend code
- Delete all workflow database tables and create migration
- Remove workflow API endpoints and execution logic
- Clean workflow references from agent tools and triggers
- Remove playbooks tab and UI from agent configuration
- Eliminate workflow_id, workflow_input, and execution_type fields
- Simplify trigger system to agent-only execution
- Remove workflow tool definitions from tool registry
- Clean up TypeScript interfaces and remove workflow types
- Remove playbooks button from chat input
- Update all trigger components to remove workflow selection
- Clean workflow metadata from threads and sidebar
- Remove 80+ critical workflow code references

Simplifies codebase by eliminating complex dual-mode (agent/workflow)
execution system in favor of pure agent-based automation.
2025-10-05 01:51:44 +02:00
marko-kraemer c62ea28237 refactor: remove deprecated code and endpoints
- Removed deprecated GET /agent-runs/{agent_run_id} endpoint from threads.py (20 lines)
- Removed unimplemented delete_mcp_server() method from mcp_server_service.py (12 lines)
- Removed deprecated 'sync' and 'update-all' commands from manage_suna_agents.py script (9 lines)
- Cleaned up 41 lines of dead/deprecated code
- No functional impact as these were already marked deprecated or non-functional
2025-10-04 22:45:41 +02:00
marko-kraemer 8b7bc36d5f refactor: consolidate duplicate account lookup logic
- Extracted get_account_id_from_thread() to auth_utils.py (new shared utility)
- Refactored 2 identical _get_current_account_id() methods:
  * tools/agent_builder_tools/base_tool.py (reduced 23 lines → 9 lines)
  * tools/sb_upload_file_tool.py (reduced 23 lines → 9 lines)
- Simplified agent_creation_tool.py's version for consistency
- Eliminated 28+ lines of duplicate code
- Centralized thread→account lookup logic in one place
2025-10-04 22:45:09 +02:00
marko-kraemer 98e9196d41 refactor: simplify backend - fix naming conflicts and centralize DB dependencies
Backend improvements:
- Fixed duplicate TemplateService naming conflict:
  * Renamed marketplace_service.py::TemplateService → MarketplaceService
  * Eliminates confusion between two classes with same name

- Created centralized DB dependency helpers (db_helpers.py):
  * get_db() - FastAPI dependency for DB connection (singleton)
  * get_db_client() - Returns initialized Supabase client
  * get_initialized_db() - For module-level backward compatibility
  * Addresses 100+ DBConnection() instantiations across 53 files

- Applied new DB helpers to high-usage files:
  * services/api_keys_api.py - Now uses get_db() dependency
  * templates/services/marketplace_service.py - Uses get_initialized_db()

- Comprehensive simplification analysis document:
  * Identified 9 modules with duplicate initialize() patterns
  * Documented large files needing breakdown (1700-2000 lines)
  * Analyzed 35 tool files for common patterns
  * Prioritized recommendations for future work

Frontend cleanup:
- Removed unused template preview components and pages
2025-10-04 22:40:16 +02:00
marko-kraemer 8d7e85de4c refactor: massive backend simplification - eliminate 450+ lines of duplicate code
- Created unified AgentLoader for all agent data operations
- Eliminated 8 manual AgentResponse constructions across codebase
- Reduced agent_runs.py complexity by 163 lines (85→35 lines in 2 functions)
- Reduced core_utils.py from 553→69 lines (-87%)
- Extracted focused utility modules:
  * utils/icon_generator.py (179 lines)
  * utils/limits_checker.py (245 lines)
  * utils/run_management.py (145 lines)
  * utils/project_helpers.py (113 lines)
  * utils/mcp_helpers.py (41 lines)
- Fixed duplicate router inclusions in api.py
- Renamed template_service.py → marketplace_service.py for clarity
- Reduced template transformer from 73→17 lines (-77%)
- Inlined module-specific helpers (moved agent_run access check)
- Fixed version data false alarm warnings
- Updated AgentResponse model to support optional fields for list operations

Total impact: ~450 lines of duplicate code eliminated, dramatically improved maintainability
2025-10-04 22:32:51 +02:00
Saumya 550b9f42ce Merge branch 'main' of https://github.com/kortix-ai/suna into fix-ui-bugs 2025-10-04 03:06:43 +05:30
Krishav Raj Singh 6d208ef7f3 fix: present_presentation in ppt grp 2025-10-03 21:50:07 +05:30
marko-kraemer 85c4ae00e7 Remove usage_example decorator and all usages 2025-10-03 12:24:36 +02:00
Saumya 6f02f398d3 Merge branch 'main' into fix-ui-bugs 2025-10-02 00:36:03 +05:30
Bobbie b82e0f757f
Merge pull request #1759 from escapade-mckv/research-agent
Research agent
2025-09-30 21:01:41 +05:30
Saumya 87e83e37a3 disable doc parser tool 2025-09-30 20:56:47 +05:30
Saumya 4908f174d6 chore: research agent v1 2025-09-30 20:53:55 +05:30
marko-kraemer f8ab7059b7 fixes 2025-09-29 22:52:49 +02:00
Saumya 22fc672a4d Merge branch 'main' into doc-parser 2025-09-29 23:17:00 +05:30
Saumya 3bdb026831 script to fix missing subscription 2025-09-29 22:14:49 +05:30
Saumya 8141428fb6 doc parser tool 2025-09-29 10:59:50 +05:30
marko-kraemer 079d7347da model changes 2025-09-28 23:36:14 +02:00
Saumya ddc85c4a9f Merge branch 'main' of https://github.com/kortix-ai/suna into people-search-tool 2025-09-27 13:26:36 +05:30
Saumya 2a1f370d79 feat: company search tool 2025-09-27 13:26:07 +05:30
Saumya 0fbaca8b27 people search tool 2025-09-27 01:16:45 +05:30
Krishav Raj Singh 8198ad0937 snapshot update 2025-09-26 20:09:06 +05:30
Saumya f31b66bc00 Merge branch 'main' into people-search-tool 2025-09-26 15:52:27 +05:30
Saumya 18af773e71 chore: remove icon and color classes form tool groups 2025-09-26 15:08:49 +05:30
Saumya fb080073c0 chore: granular control of tools 2025-09-26 14:49:12 +05:30
Saumya d226e38809 chore: show all tools in config 2025-09-25 13:29:03 +05:30
Saumya c5653ae55a people search tool 2025-09-24 17:51:27 +05:30
marko-kraemer 31c697f774 billing rem old file, other changes 2025-09-21 16:35:14 +02:00
marko-kraemer c0b58d9afa merge 2025-09-21 10:08:10 +02:00
Saumya 7e25978e10 new sandbox snapshot 2025-09-21 12:28:00 +05:30
marko-kraemer 692c0983fc wip 2025-09-19 12:25:48 +02:00
marko-kraemer 3af20d6a2e wip 2025-09-18 10:51:58 +02:00
marko-kraemer 2169127960 wip 2025-09-18 10:28:12 +02:00
marko-kraemer ff86931e1a wip 2025-09-17 19:46:34 +02:00
marko-kraemer 7319dc7a56 wip 2025-09-17 19:23:20 +02:00
Krishav Raj Singh 46e19894c6 img search tool with serper 2025-09-17 13:53:49 +05:30
Saumya ca84e76c56 fix: agent stopping in middle of task 2025-09-16 01:23:31 +05:30
Saumya c5a155554d fix: caching and duplicate system messages 2025-09-15 11:16:47 +05:30
Saumya f54e2e176e fix: prompt caching and double system prompt 2025-09-14 15:13:00 +05:30
Saumya 9803d3b0d8 make free trial worth 5 dollars 2025-09-12 11:42:23 +05:30
Krishav a1a04a1b87
Merge branch 'kortix-ai:main' into fix/editor 2025-09-11 03:35:19 +05:30
Krishav Raj Singh 1150a0ff4d update snapshot 2025-09-11 03:34:38 +05:30
Bobbie 85a02b14f9
Merge pull request #1606 from escapade-mckv/billing-improvements-clean
fix: user search endpoint fix
2025-09-10 14:58:38 +05:30
Saumya 87d0eeb62f fix: user search endpoint fix 2025-09-10 14:57:31 +05:30
Marko Kraemer 43a94999fb
Merge pull request #1568 from KrishavRajSingh/fix/img
transparency in ss
2025-09-09 15:55:17 -07:00
Saumya 780cf59626 improve billing and trial flows 2025-09-09 17:14:41 +05:30
Krishav Raj Singh e0d61d2053 update snapshot 2025-09-09 09:59:05 +05:30
Krishav Raj Singh db4b70bf5d update snapshot 2025-09-09 09:59:02 +05:30
marko-kraemer 75aad69d14 10 gig sandbox 2025-09-08 15:41:18 -07:00