Commit Graph
34 Commits
Author SHA1 Message Date
bymyself 706b6d8317 [refactor] Remove legacy thread management for TaskQueue
- Add proper async worker management to TaskQueue class
- Remove redundant task_worker_thread and task_worker_lock global variables
- Replace manual threading with async task management
- Update is_processing() logic to use TaskQueue state instead of thread status
- Implement automatic worker cleanup when queue processing completes
- Simplify queue start endpoint to use TaskQueue.start_worker()
2025-06-13 19:40:27 -07:00
bymyself a59e6e176e [refactor] Remove redundant ExecutionStatus NamedTuple
- Eliminate TaskQueue.ExecutionStatus NamedTuple in favor of generated TaskExecutionStatus Pydantic model
- Remove manual conversion logic between NamedTuple and Pydantic model
- Use single source of truth for task execution status
- Clean up unused imports (Literal, NamedTuple)
- Maintain consistent data model usage throughout TaskQueue
2025-06-13 19:37:57 -07:00
bymyself 1d575fb654 [refactor] Replace non-standard OpenAPI validation with Redoc CLI
- Replace deprecated openapi-spec-validator with @redocly/cli
- Remove fragile custom regex-based route alignment script
- Use industry-standard OpenAPI validation tooling
- Switch from Python to Node.js for validation pipeline
- New validation catches 41 errors and 141 warnings that old validator missed
2025-06-13 19:37:57 -07:00
bymyself 98af8dc849 add claude memory 2025-06-13 19:37:57 -07:00
bymyself 4d89c69109 add installed packs to openapi 2025-06-13 19:37:57 -07:00
bymyself b73dc6121f refresh cache before reporting status 2025-06-13 19:37:57 -07:00
bymyself b55e1404b1 return installed pack list on status update 2025-06-13 19:37:57 -07:00
bymyself 0be0a2e6d7 migrate to data models for all routes 2025-06-13 19:37:57 -07:00
bymyself 3afafdb884 remove dist dir 2025-06-13 19:37:57 -07:00
bymyself 884b503728 [feat] Add comprehensive Pydantic validation to all API endpoints
- Updated all POST endpoints to use proper Pydantic model validation:
  - `/v2/manager/queue/task` - validates QueueTaskItem
  - `/v2/manager/queue/install_model` - validates ModelMetadata
  - `/v2/manager/queue/reinstall` - validates InstallPackParams
  - `/v2/customnode/import_fail_info` - validates cnr_id/url fields

- Added proper error handling with ValidationError for detailed error messages
- Updated TaskQueue.put() to handle both dict and Pydantic model inputs
- Added missing imports: InstallPackParams, ModelMetadata, ValidationError

Benefits:
- Early validation catches invalid data at API boundaries
- Better error messages for clients with specific validation failures
- Type safety throughout the request processing pipeline
- Consistent validation behavior across all endpoints

All ruff checks pass and validation is now enabled by default.
2025-06-13 19:37:57 -07:00
bymyself 7f1ebbe081 [cleanup] Remove completed TODO comments and fix ruff issues
- Removed completed TODO comments about code quality checks and client_id handling
- Updated comments to reflect implemented features
- Fixed ruff linting errors:
  - Removed duplicate constant definitions
  - Added missing locale import
  - Fixed unused imports
  - Moved is_local_mode logic to security_utils module
  - Added model_dir_name_map import to model_utils

All ruff checks now pass successfully.
2025-06-13 19:37:57 -07:00
bymyself c8882dcb7c [feat] Implement comprehensive batch tracking and OpenAPI-driven data models
Enhances ComfyUI Manager with robust batch execution tracking and unified data model architecture:

- Implemented automatic batch history serialization with before/after system state snapshots
- Added comprehensive state management capturing installed nodes, models, and ComfyUI version info
- Enhanced task queue with proper client ID handling and WebSocket notifications
- Migrated all data models to OpenAPI-generated Pydantic models for consistency
- Added documentation for new TaskQueue methods (done_count, total_count, finalize)
- Fixed 64 linting errors with proper imports and code cleanup

Technical improvements:
- All models now auto-generated from openapi.yaml ensuring API/implementation consistency
- Batch tracking captures complete system state at operation start and completion
- Enhanced REST endpoints with comprehensive documentation
- Removed manual model files in favor of single source of truth
- Added helper methods for system state capture and batch lifecycle management
2025-06-13 19:36:55 -07:00
bymyself 601f1bf452 [feat] Add client_id support to task queue system
- Add client_id field to QueueTaskItem and TaskHistoryItem models
- Implement client-specific WebSocket message routing
- Add client filtering to queue status and history endpoints
- Follow ComfyUI patterns for session management
- Create data_models package for better code organization
2025-06-13 19:33:05 -07:00
Christian ByrneandGitHub 731c89dc27 [api] Add OpenAPI specification file (#1856) 2025-05-21 21:48:50 +09:00
Christian ByrneandGitHub dbf988fd5a [docs] Add README for docs directory (#1855)
* [docs] Add README for docs directory

* [docs] Remove redundant sections from docs README
2025-05-21 21:45:17 +09:00
Christian ByrneandGitHub 0031743ad4 [docs] Add README for node_db directory (#1854) 2025-05-21 21:45:05 +09:00
Christian ByrneandGitHub 0f2c0ab65d [docs] Add README for js directory (#1853)
* [docs] Add README for js directory

* [docs] Update js/README.md based on PR review feedback

* [docs] Update js/README.md with corrected descriptions
2025-05-21 21:44:48 +09:00
Christian ByrneandGitHub 53244b794f [docs] Add README for glob directory (#1852) 2025-05-21 21:44:24 +09:00
Christian ByrneandGitHub a66bada8a3 Update workflow-metadata.js 2025-04-23 17:24:07 -07:00
Christian ByrneandGitHub af269d198d trim version string embedded in workflow (#1758) 2025-04-19 09:30:41 +09:00
Christian ByrneandGitHub 09e8e8798c Add is_legacy_manager_ui route from the legacy package as well (#1748)
* add `is_legacy_manager_ui` route to `legacy` package  as well

* add static
2025-04-15 18:36:38 +09:00
Christian ByrneandGitHub abfd85602e Only load legacy FE extension if --enable-manager-legacy-ui is set (#1746)
* only load JS extensions when legacy arg is set

* add `is_legacy_manager_ui` endpoint
2025-04-15 08:03:04 +09:00
Christian ByrneandGitHub 46a37907e6 add development guide (#1739) 2025-04-13 08:40:28 +09:00
bymyself 3c413840d7 use parsed version and id even when no cnr map exists 2025-04-11 16:33:12 -07:00
bymyself 29ca93fcb4 fix: installed nodes should still be initialized in offline mode 2025-04-11 15:56:03 -07:00
bymyself 9dc8e630a0 fix is_legacy_front should be a function still 2025-04-10 18:24:34 -07:00
bymyself 10105ad737 if pip package, force offline mode 2025-04-10 13:09:56 -07:00
bymyself 5738ea861a don't load legacy web dir when --disable-manager arg set 2025-04-09 22:19:56 -07:00
bymyself 0de9d36c28 enable legacy manager frontend during beta phase 2025-04-09 14:59:32 -07:00
bymyself 05f1a8ab0d add missing v2 prefix to customnode/installed route 2025-04-09 14:59:06 -07:00
bymyself 5ce170b7ce don't handle queue in legacy front if element is not visible 2025-04-09 14:58:39 -07:00
bymyself 2b47aad076 don't show menu buttons if past comfyui front 1.16 2025-04-09 14:58:21 -07:00
bymyself b4dc59331d fix merge conflict 2025-04-09 14:57:53 -07:00
bymyself 81e84fad78 add workflow to publish to pypi 2025-04-09 08:59:39 -07:00