Skip to content

feat(dashboard): orchestration canvas fase 2 — agents WS channel (2.1) - #12409

Merged
diegosouzapw merged 4 commits into
release/v3.8.51from
feat/orch-fase2-b1
Sep 2, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.51from
feat/orch-fase2-b1

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Orchestration Canvas — Fase 2 / PR-B1: canal WS agents (item 2.1)

Segunda das quatro PRs da Fase 2 (após #12393). O canvas de orquestração passa a receber transições de tasks dos 3 agentes em tempo real e rebaixa o polling de 5 s para 30 s enquanto o WebSocket está conectado (5 s segue como fallback).

Desenho

  • Evento leve como gatilho, não snapshot. Um único evento agent.task.updated { source, taskId, state, timestamp } no canal novo agents; o snapshot continua vindo por REST (que já resolve owner-scoping/serialização). O WS nunca carrega dados de task.
  • 3 pontos de publish, best-effort (emit em try/catch, nunca lança para o write path): insertCloudAgentTask/updateCloudAgentTask (src/lib/cloudAgent/db.ts), A2ATaskManager.createTask/updateTask + ramo TTL do cleanupExpired, e um mirror do Conductor em hubProxy.getFleetSnapshot (cache do último status por task; 1 evento por task nova/mudada; a primeira foto só semeia; foto offline não zera o cache).
  • Enums: "agents" em DashboardChannel/CHANNEL_EVENTS (src/lib/events/types.ts) e nas 3 unions de src/server/ws/types.ts; liveServer.ts roteia via getChannelForEvent sem mudança.
  • Hook useOrchestrationSnapshot: subscreve agents (troca o gatilho-proxy requests), debounce 1 s mantido; POLL_MS_WS_CONNECTED = 30_000 quando connection.isConnected, POLL_MS = 5_000 caso contrário.

Validação

  • node:test novos: ws-agents-channel, agents-channel-publish (DB temporário + handles fechados), conductor-fleet-mirror; vitest do hook (evento → refetch debounced; intervalos 5 s/30 s; transição reprograma).
  • Suites existentes de a2a / cloudAgent / conductor / event-bus verdes; typecheck:core, check:dashboard-typecheck, lint, test:vitest, check:cycles (ver relatório da última task).

Refs #12392 (polish do canvas — minors desta PR anexados lá como comentário).

Spec: _tasks/superpowers/specs/2026-09-01-orchestration-canvas-fase2-design.md §2 (privado). Segue PR-B2 (History) e PR-C (Repetir + memória).

@diegosouzapw
diegosouzapw merged commit 6b4519c into release/v3.8.51 Sep 2, 2026
21 checks passed
@diegosouzapw
diegosouzapw deleted the feat/orch-fase2-b1 branch September 2, 2026 04:19
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
diegosouzapw#12409)

* feat(dashboard): agents WS channel + agent.task.updated event

* feat(a2a): publish agent.task.updated on cloud-agent and a2a task writes

* feat(dashboard): mirror conductor fleet transitions into agents channel

* feat(dashboard): orchestration snapshot rides the agents WS channel (2.1)

---------

Co-authored-by: Markus Hartung <diegosouzapw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant