Pretor/pretor
朝夕 d17f6384fc
Feat/dashboard clean monitor upload 1334918525438687015 (#40)
* feat: Clean up dashboard UI, shift workflow WS to SSE, and add file upload support

- Removed Monitoring view and associated `/ws/state` cluster websocket route.
- Modified workflow tracing from WebSocket (`/api/v1/workflow/ws/{trace_id}`) to Server-Sent Events (`/api/v1/workflow/sse/{trace_id}`) for unidirectional pushes, introducing a new `/api/v1/workflow/reply/{trace_id}` POST route to handle incoming client replies.
- Cleaned up dummy data and unneeded links in the chat layout (LeftPanel, ChatPanel).
- Implemented file upload functionality: added a `/api/v1/adapter/client/upload` endpoint to the backend which saves files to a local `uploads` directory, and added an integrated file input triggered via the `+` button in the frontend chat interface to facilitate uploading with an automated chat message confirmation.

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* fix: prevent global_state_machine actor from being garbage collected

Added `lifetime="detached"` and kept a local reference to the `GlobalStateMachine`
actor in `main.py` so that it doesn't get cleaned up by Ray due to going out
of scope, which was causing `ray.get_actor('global_state_machine')` calls to fail
in API route handlers (resulting in 500 errors).

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* fix: resolve named actor addressing failure across Ray processes via explicit namespace

The `ray.get_actor` calls in API routes executing within a Ray Serve worker were failing to
resolve the actors created by the main process because the implicit random namespace of
`ray.init()` did not match the namespace of the Ray Serve application scope.

Instead of overriding garbage collection via `lifetime="detached"` (which can lead to actor
leakage), this assigns an explicit `namespace="pretor"` when initializing Ray in the main process,
and uses the identical namespace in `ray_hook.py` when looking up named actors. Also retains the
local variable assignments in `main.py` to prevent them from being eliminated as unused variables.

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* fix: defer actor lookup in WorkflowRunningEngine to avoid startup race conditions

The `WorkflowRunningEngine` was trying to fetch the `global_state_machine` actor
during its `__init__` method via `ray_actor_hook()`. Since actor creation requests are
dispatched asynchronously, the `global_state_machine` might not be completely
registered and discoverable via `ray.get_actor()` by the time the `WorkflowRunningEngine`'s
`__init__` is evaluated.

Moved the actor lookup to the async `run()` method, which gets executed after the engine
itself is fully up, allowing time for other components to become available in the global
Ray namespace.

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>
2026-04-27 13:06:15 +08:00
..
adapter Jules refactor backend and frontend 3736339600030847383 (#33) 2026-04-26 11:34:46 +08:00
api feat: Clean up dashboard UI, shift workflow WS to SSE, and add file upload support (#37) 2026-04-27 09:45:45 +08:00
core Feat/dashboard clean monitor upload 1334918525438687015 (#40) 2026-04-27 13:06:15 +08:00
plugin fix: 修复了字段名bug 2026-04-26 21:37:20 +08:00
utils Feat/dashboard clean monitor upload 1334918525438687015 (#38) 2026-04-27 10:27:44 +08:00
worker_individual Jules refactor backend and frontend 3736339600030847383 (#35) 2026-04-26 14:54:46 +08:00
workflow_template feat:使用pytanticAI再次重构,增加了对于api的接口管理 2026-03-31 18:15:18 +08:00
__init__.py wip:更新版权 2026-04-10 10:50:25 +08:00