From a3d3437b1d6c1f303e3081dd7e4319869b170efa Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Sun, 4 Jan 2026 13:04:05 -0800 Subject: [PATCH] OpenCode workspace host + MCP sync + iOS fixes (#27) * Add multi-user auth and per-user control sessions * Add mission store abstraction and auth UX polish * Fix unused warnings in tooling * Fix Bugbot review issues - Prevent username enumeration by using generic error message - Add pagination support to InMemoryMissionStore::list_missions - Improve config error when JWT_SECRET missing but DASHBOARD_PASSWORD set * Trim stored username in comparison for consistency * Fix mission cleanup to also remove orphaned tree data * Refactor Open Agent as OpenCode workspace host * Remove chromiumoxide and pin @types/react * Pin idna_adapter for MSRV compatibility * Add host-mcp bin target * Use isolated Playwright MCP sessions * Allow Playwright MCP as root * Fix iOS dashboard warnings * Add autoFocus to username field in multi-user login mode Mirrors the iOS implementation behavior where username field is focused when multi-user auth mode is active. * Fix Bugbot review issues - Add conditional ellipsis for tool descriptions (only when > 32 chars) - Add serde(default) to JWT usr field for backward compatibility * Fix empty user ID fallback in multi-user auth Add effective_user_id helper that falls back to username when id is empty, preventing session sharing and token verification issues. * Fix parallel mission history preservation Load existing mission history into runner before starting parallel execution to prevent losing conversation context. * Fix desktop stream controls layout overflow on iPad - Add frame(maxWidth: .infinity) constraints to ensure controls stay within bounds on wide displays - Add alignment: .leading to VStacks for consistent layout - Add Spacer() to buttons row to prevent spreading - Increase label width to 55 for consistent FPS/Quality alignment - Add alignment: .trailing to value text frames * Fix queued user messages not persisted to mission history When a user message was queued (sent while another task was running), it was not being added to the history or persisted to the database. This caused queued messages to be lost from mission history. Added the same persistence logic used for initial messages to the queued message handling code path. --- .claude/CLAUDE.md | 186 ++- AGENTS.md | 400 +++++ Cargo.toml | 7 +- README.md | 21 +- dashboard/README.md | 2 +- dashboard/bun.lock | 2 +- dashboard/package.json | 2 +- dashboard/src/app/modules/page.tsx | 90 +- dashboard/src/components/auth-gate.tsx | 47 +- dashboard/src/lib/api.ts | 14 +- dashboard/src/lib/auth.ts | 14 + .../OpenAgentDashboard/ContentView.swift | 67 +- .../Services/APIService.swift | 19 +- .../Services/DesktopStreamService.swift | 13 +- .../ToolUI/ToolUIDataTableView.swift | 2 - .../Views/Control/ControlView.swift | 36 +- .../Views/Desktop/DesktopStreamView.swift | 23 +- .../Views/Terminal/TerminalView.swift | 4 +- ios_dashboard/README.md | 2 + opencode.json | 7 +- src/agents/context.rs | 2 +- src/agents/tuning.rs | 2 +- src/api/auth.rs | 144 +- src/api/control.rs | 1435 +++++++++++------ src/api/desktop_stream.rs | 15 +- src/api/fs.rs | 3 + src/api/mcp.rs | 38 +- src/api/mission_runner.rs | 63 +- src/api/providers.rs | 13 +- src/api/routes.rs | 317 ++-- src/api/types.rs | 5 + src/bin/host_mcp.rs | 277 ++++ src/config.rs | 106 +- src/lib.rs | 1 + src/mcp/config.rs | 21 +- src/mcp/mod.rs | 2 +- src/mcp/registry.rs | 116 +- src/memory/embed.rs | 4 + src/opencode/mod.rs | 14 +- src/tools/browser.rs | 2 + src/tools/file_ops.rs | 5 - src/tools/github.rs | 9 +- src/tools/mission.rs | 6 +- src/tools/mod.rs | 51 +- src/tools/web.rs | 3 +- src/workspace.rs | 179 ++ 46 files changed, 2877 insertions(+), 914 deletions(-) create mode 100644 AGENTS.md create mode 100644 src/bin/host_mcp.rs create mode 100644 src/workspace.rs diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 0485485..fa41024 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -9,8 +9,8 @@ Minimal autonomous coding agent in Rust with **full machine access** (not sandbo | Backend (Rust) | `src/` | HTTP API + OpenCode integration | | Dashboard (Next.js) | `dashboard/` | Web UI (uses **Bun**, not npm) | | iOS Dashboard | `ios_dashboard/` | Native iOS app (Swift/SwiftUI) | -| MCP configs | `.open_agent/mcp/config.json` | Model Context Protocol servers | -| Providers | `.open_agent/providers.json` | Provider configuration | +| MCP configs | `.openagent/mcp/config.json` | Model Context Protocol servers | +| Providers | `.openagent/providers.json` | Provider configuration | ## Commands @@ -35,7 +35,7 @@ bun run build # Production build # - bun run