Skip to content

Feat/desktop#13

Open
Fiooodooor wants to merge 2 commits into
Fiooodooor:mainfrom
HKUDS:feat/desktop
Open

Feat/desktop#13
Fiooodooor wants to merge 2 commits into
Fiooodooor:mainfrom
HKUDS:feat/desktop

Conversation

@Fiooodooor
Copy link
Copy Markdown
Owner

Summary

  • Problem:
  • Why it matters:
  • What changed:
  • What did NOT change (scope boundary):

Change Type

  • Bug fix
  • Feature
  • Refactor
  • NIC porting slice (specify phase + role below)
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • ClawTeam CLI / orchestration
  • Spawn / backends
  • Skills / tool execution
  • MCP server / transport
  • Task board / inbox
  • NIC porting agents / identities
  • Templates / profiles
  • Tests
  • CI/CD / infra
  • Docs

NIC Porting Context (if applicable)

Field Value
Driver
Target OS
Phase
Role
Board Task ID

Gate Checklist (NIC porting PRs)

  • native_score >= 98.0 (no framework/non-native API calls)
  • portability_score >= 95.0 (cross-compile matrix clean)
  • test_pass_rate = 100% (all TDD tests green)
  • build_status = green (Linux + FreeBSD compile)
  • critical_risks = 0 (no open critical risks in register)
  • Zero-copy verified (no memcpy in hot paths)
  • DMA sync discipline followed (PREWRITE/POSTREAD bracketing)
  • Checker agent PASS verdict attached

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

  • Root cause:
  • Missing detection / guardrail:
  • Prior context:
  • Why this regressed now:

Risk Register Impact

  • No new risks introduced
  • New risk(s) added to register with mitigation owner
  • Existing risk(s) mitigated or closed (specify IDs):

Regression Test Plan

For bug fixes, name the test(s) that would have caught this. For porting slices,
list the TDD tests that validate the change. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
  • Scenario the test should lock in:
  • Why this is the smallest reliable guardrail:
  • Existing test that already covers this (if any):
  • If no new test is added, why not:

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
If none, write None.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

Before:
[user action] -> [old state]

After:
[user action] -> [new state] -> [result]

Security Impact (required)

  • New permissions/capabilities? (Yes/No)
  • Secrets/tokens handling changed? (Yes/No)
  • New/changed network calls? (Yes/No)
  • Command/tool execution surface changed? (Yes/No)
  • Data access scope changed? (Yes/No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS:
  • Runtime/container:
  • Model/provider:
  • Integration/channel (if any):
  • Relevant config (redacted):

Steps

Expected

Actual

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
  • Edge cases checked:
  • What you did not verify:

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No)
  • Config/env changes? (Yes/No)
  • Migration needed? (Yes/No)
  • If yes, exact upgrade steps:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk:
    • Mitigation:

tjb-tech and others added 2 commits April 28, 2026 12:25
Bundle the React app under dashboard/ (Vite → clawteam/board/static).
Electron main process auto-spawns `clawteam board serve` on launch and
tears it down on quit; renderer loads the board over HTTP so /api and
SSE stay same-origin in both dev and prod.

Profile wizard mirrors `clawteam profile wizard`: pick a client, then
pick a compatible preset (`clawteam preset list`), then generate via
`clawteam preset generate-profile`. An advanced editor still exposes
raw AgentProfile fields for custom endpoints.

Settings popover: runtime version + install/upgrade prompts +
launch targets (Terminal, iTerm2, Ghostty, VS Code, Cursor) with
real client icons.

Backend changes:
- board/server.py — SPA fallback + path-traversal protection.
- board/collector.py — expose spawn registry as `sessions` per team.
- board/runtime.py — PyPI version probe for in-app upgrade prompts.

.gitignore — exclude Vite build output, Electron release artifacts,
and AnyFS workspace snapshots.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 9, 2026 16:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new desktop-focused dashboard experience (React/Vite + Electron) and expands ClawTeam’s runtime coordination by adding session capture/resume metadata and an optional Redis wakeup mechanism, along with watcher logic to proactively notify leaders of state changes.

Changes:

  • Added a new React/Vite dashboard (built into clawteam/board/static) and an Electron host app with IPC endpoints for runtime install/upgrade, profiles/presets, and session launching.
  • Implemented native-client session capture/resume plumbing across spawn backends plus new session locators (claude/codex/gemini/opencode/openclaw/nanobot).
  • Added an optional Redis-based wakeup layer and a team watch leader watcher, plus new/updated tests for these behaviors.

Reviewed changes

Copilot reviewed 37 out of 49 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/test_session_capture.py New tests for session capture/locator behaviors and resume command building.
tests/test_leader_watcher.py New tests for leader watcher injection/deduping and redis off mode.
tests/test_board.py Extends board tests for sessions exposure, static path hardening, and runtime status.
scripts/run_board.mjs Node script to run the board server from a local clawteam installation.
scripts/install_clawteam.sh User-level installer for PyPI clawteam into ~/.clawteam/.venv.
scripts/clawteam_local_install Local editable install helper for this repo checkout into ~/.clawteam/.venv.
pyproject.toml Adds optional redis extra dependency.
package.json Adds dashboard/electron dev scripts and Electron toolchain deps.
desktop/electron/preload.cjs Exposes a constrained IPC bridge API to the renderer.
desktop/electron/main.mjs Electron main process: board manager, runtime install/upgrade, profiles/presets, session openers.
dashboard/vite.config.mjs Vite config for dashboard build output into clawteam/board/static.
dashboard/src/styles.css Dashboard styling (new UI theme/layout).
dashboard/src/main.jsx React entrypoint for the dashboard.
dashboard/src/App.jsx Main dashboard UI: board, sessions, profiles/presets wizard, runtime settings popover.
dashboard/src/api.js API wrapper for web vs desktop IPC-backed calls + SSE subscription.
dashboard/index.html Vite dashboard HTML entry.
clawteam/team/redis_wakeup.py New optional Redis wakeup module (auto/off/url) + publish/subscribe helpers.
clawteam/team/mailbox.py Publishes best-effort wakeup events on inbox send/broadcast.
clawteam/team/leader_watcher.py New leader watcher loop with polling/redis subscription and injection fallback to inbox.
clawteam/store/file.py Publishes wakeup events on task create/update.
clawteam/spawn/wsh_backend.py Adds session capture persistence integration to WSH spawning.
clawteam/spawn/tmux_backend.py Adds session capture persistence integration to tmux spawning.
clawteam/spawn/subprocess_backend.py Adds session capture persistence integration to subprocess spawning.
clawteam/spawn/session_locators/opencode.py New OpenCode session locator.
clawteam/spawn/session_locators/openclaw.py New OpenClaw session locator.
clawteam/spawn/session_locators/nanobot.py New Nanobot session locator.
clawteam/spawn/session_locators/gemini.py New Gemini session locator.
clawteam/spawn/session_locators/codex.py New Codex session locator + discovery helper.
clawteam/spawn/session_locators/claude.py New Claude Code session locator (supports generated/provided/resume).
clawteam/spawn/session_locators/base.py Shared locator types/utilities (hints, timestamps, recent files).
clawteam/spawn/session_locators/init.py Locator registry + lookup helpers.
clawteam/spawn/session_capture.py Facade for prepare/persist session capture + resume command builder.
clawteam/cli/commands.py Adds team watch, expands session save/show/list metadata, improves resume command logic.
clawteam/board/static/index.html Replaces legacy static UI with Vite-built dashboard shell.
clawteam/board/server.py Adds runtime status API, SPA static serving w/ traversal guard, and index fallback.
clawteam/board/runtime.py New runtime status helper (installed/current/latest/upgrade available).
clawteam/board/collector.py Adds spawn/session registry data into team payload.
.gitignore Ignores Vite build assets dir + electron output dirs and local snapshots.

Comment on lines +7 to +8
<script type="module" crossorigin src="./assets/index-BfEdPshz.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-fc9g6V4N.css">
Comment thread clawteam/board/server.py
except Exception as e:
self.send_error(500, str(e))
elif self._static_exists(path.strip("/")):
self._serve_static(path.strip("/"))
Comment thread clawteam/board/server.py
Comment on lines 215 to 221
content = filepath.read_bytes()
content_type = mimetypes.guess_type(filepath.name)[0] or "application/octet-stream"
if filepath.suffix == ".js":
content_type = "text/javascript"
self.send_response(200)
self.send_header("Content-Type", f"{content_type}; charset=utf-8")
self.send_header("Content-Length", str(len(content)))
Comment thread scripts/run_board.mjs
import os from "node:os";
import path from "node:path";

const REPO_ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), "..");
Comment on lines +177 to +185
completed = [t for t in tasks if t.status == TaskStatus.completed]
blocked = [t for t in tasks if t.status == TaskStatus.blocked]
in_progress = [t for t in tasks if t.status == TaskStatus.in_progress]
pending = [t for t in tasks if t.status == TaskStatus.pending]
return {
"total": len(tasks),
"completed": [_task_ref(t) for t in completed],
"blocked": [_task_ref(t) for t in blocked],
"inProgress": [_task_ref(t) for t in in_progress],
CurrentSessionHint,
PreparedSession,
SessionContext,
discover_codex_session,
import json
import shutil
import subprocess
from pathlib import Path
Comment thread desktop/electron/main.mjs
Comment on lines +214 to +219
webPreferences: {
preload: path.join(__dirname, "preload.cjs"),
contextIsolation: true,
nodeIntegration: false,
sandbox: false,
},
Comment on lines +269 to 273
prepared = self._adapter.prepare_command(
session_capture.command,
prompt=None,
cwd=cwd,
skip_permissions=skip_permissions,
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.

3 participants