feat(workbench): add browser workspace, kanban feedback, and executor CLI foundations#2
Open
gu87 wants to merge 11 commits into
Open
feat(workbench): add browser workspace, kanban feedback, and executor CLI foundations#2gu87 wants to merge 11 commits into
gu87 wants to merge 11 commits into
Conversation
added 11 commits
June 6, 2026 12:54
…tract
browser-host/: new Electron child-process (status/start/stop + snapshot/screenshot/context proxies) — Phase 2B + 2C
plugins/browser-workspace/dashboard/: Codex-like sidebar tab (manifest + bundled dist/index.js) — Phase 4 entry point
hermes_cli/web_server.py: expose /api/browser-host/{status,start,stop,snapshot,screenshot,context} and read-only HTTP proxy to the host on localhost — Phase 2B/2C
web/src/pages/ChatPage.tsx: window.__HERMES_INSERT_CHAT_TEXT__ (term.paste path) + window.__HERMES_SET_BROWSER_CONTEXT_REF__ (metadata only — no DOM/selection/clipboard) — Phase 4A/4B
Out of scope: Kanban review/qa CLI + diff events; Codex-like embedded-chat nav reshuffle; ToolCall selected ring; ChatSidebar structured preview parser; executors/ module; dashboard screenshots.
Add review/qa CLI subcommands, emit diff events after dispatch, and publish diff/review/qa task events to the dashboard WebSocket stream. Includes focused CLI tests for dispatch diff recording and review/QA result events.
Parse diff, review, QA, and artifact payloads from tool events and render them in a dedicated ChatSidebar detail panel. Add ToolCall onClick/selected props for activity-list selection and highlight state, with graceful fallback for unparseable results.
Redirect root and unknown routes to /chat when embedded chat mode is enabled, slim the sidebar nav for chat-first usage, and add Config diagnostics links for hidden dashboard pages.
Add the core executor types, registry, router, and health helpers behind a core-safe package API that does not import adapter implementations. Add router and registry tests covering keyword recommendations, fallback behavior, default manifests, and missing-binary health checks without invoking live models.
Add Hermes Local, Claude Code, Codex, OpenCode, and DeepSeek TUI executor adapters implementing the AgentExecutorAdapter protocol. CLI adapters use asyncio subprocess array calls without shell=True; Hermes Local restores cwd with try/finally; DeepSeek TUI remains an explicit unavailable stub. Add adapter registry tests covering imports, missing-binary health checks, inert imports, and no live CLI/model/worktree side effects.
Add project-scoped workspace context, inbox persistence, and per-executor prompt building utilities. These tools write only to caller-supplied project .hermes files and do not invoke subprocesses, models, git, or external services. Add tests covering JSON round trips, default loading, prompt generation, inbox lifecycle, and side-effect boundaries.
Add worktree lifecycle utilities and CLI helpers with dirty-tree rejection and confirmation gates for destructive merge/discard operations. Fix the clean-working-tree preflight check so user dirty files reject worktree creation while .hermes infrastructure files are ignored as intended. Add worktree tests covering dirty rejection, infra filtering, merge/discard confirmation, and tmp-repo-only git operations.
Add IPC dataclasses, review/QA prompt parsing primitives, and a fixture-driven bridge CLI simulation layer without importing the real review handler. Keep D1a read-only and subprocess-free; bridge CLI uses local stubs for review/QA simulation while D1b decides the real review backend boundary. Fix diff deletion parsing so file header lines are not counted as deletions.
Adds the executors/IPC rail for review and QA, parallel to the existing hermes_cli.kanban_feedback trigger_* path. The two rails target different consumers (Kanban SQLite vs. Electron IPC) and are NOT interchangeable. - executors/review_handler.py: trigger_review_ipc / trigger_qa_ipc async wrappers around _launch_opencode, with shutil.which gate, OpencodeUnavailable exception, emit_diff_event side-channel, and stub_review_report / stub_qa_report fallback when opencode is absent. Module docstring documents the dual-rail architecture to prevent confusion with kanban_feedback.trigger_*. - executors/review_cli.py: 6 subcommand handlers (build-prompt / parse / executor for both review and QA) + handle_review_command / handle_qa_command dispatchers. SEVERITY_ICONS map for human-readable output. - tests/executors/test_review_handler.py: 582 lines, 9 test classes covering rename verification, IPC happy paths, fallback paths, subprocess invocation, side-channel events, stub reports, exception handling, and boundary guards (no kanban_feedback, no executors.cli, no executors.bridge, no sqlite3 imports, no real opencode invocation). - tests/executors/test_review_cli.py: 443 lines, 9 test classes covering all 6 subcommand handlers, dispatchers, SEVERITY_ICONS lookup, and parallel boundary guards. The rename trigger_* -> trigger_*_ipc was required to disambiguate from hermes_cli.kanban_feedback.trigger_* which writes to the Kanban SQLite task_events table. Both are live in parallel; callers pick the rail appropriate to their consumer (CLI vs. Electron IPC). 70 new tests; full executors suite: 415 passing (was 345).
Add the argparse-based executor CLI entry point wiring registry, health, routing, worktree, context, review, QA, inbox, and bridge subcommands. Preserve destructive operation gates by delegating worktree actions to the guarded C2 handlers, and keep imports free of hermes_cli or live external CLI side effects. Add CLI tests covering registry commands, delegation, help output, missing binaries, import side effects, and boundary guards.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch delivers three foundation layers for the Hermes Agent desktop workbench. First, a read-only Browser Workspace — an Electron host that renders external URLs and exposes a chat message insertion contract, without any browser automation capability. Second, kanban review/QA feedback events — structured defect tracking wired into the CLI kanban surface. Third, a complete executors framework spanning a typed registry, capability-based router, five CLI adapters, guarded worktree tools, context/inbox/prompt tooling, an IPC bridge, review chain primitives, and a top-level argparse CLI entry point. Two UI upgrades ship alongside: structured tool-result preview panels and embedded chat session routing. All executor modules are backed by 463 passing tests, destructive operations are gated behind confirmation prompts, and import side-effect guards prevent the CLI from leaking into live subsystems.
What Changed
Browser Workspace
main.ts(lifecycle, window management, IPC handlers),preload.ts(context bridge),renderer.html(shell),schema.ts(typed contracts)browser-workspace:insert-chat-message) validated against a goldencontract-snapshot.jsonviavalidate-contract.mjsplugins/browser-workspace/dashboard/Kanban Review/QA Feedback
hermes_cli/kanban_feedback.py— structured review and QA defect event types with typed routinghermes_cli/kanban.py— kanban surface integration gluehermes_cli/web_server.py— lightweight HTTP server for dashboard plugin deliverytests/hermes_cli/test_kanban_cli.pyStructured Preview UI
web/src/components/ToolCall.tsx— structured preview panel that renders tool results with formatted sections instead of raw JSON blobsweb/src/components/ChatSidebar.tsx— expanded sidebar with session list, routing, and status indicatorsweb/src/pages/ChatPage.tsx/web/src/pages/ConfigPage.tsx— page-level wiring for preview and sidebarweb/src/App.tsx— top-level routing integrationEmbedded Chat Routing Mode
Executors Framework
A — Core Registry and Router
executors/registry.py— typed executor registry with binary discovery and structured health probesexecutors/router.py— capability-based router that produces recommendations and accepts user overridesexecutors/types.py— shared dataclass type system (capabilities, routing decisions, health status, executor info)executors/health.py— per-executor health checks with table and JSON output formattersB — Adapters
executors/claude_code_adapter.py— Claude Code CLI adapterexecutors/codex_adapter.py— Codex adapterexecutors/deepseek_tui_adapter.py— DeepSeek TUI adapterexecutors/hermes_local_adapter.py— Hermes local adapterexecutors/opencode_adapter.py— OpenCode adapterExecutorCapabilitiescontract defined intypes.pyC1 — Context / Inbox / Prompt Tools
executors/context.py+executors/context_cli.py— workspace context injection CLIexecutors/inbox.py+executors/inbox_cli.py— external inbox management CLIexecutors/prompt_builder.py— structured prompt assembly from context + task specC2 — Guarded Worktree Tools
executors/worktree.py+executors/worktree_cli.py— worktree create, list, merge, and discard--force; the gate is verified in testsD1a — Bridge / IPC / Review Parsing Primitives
executors/ipc.py— typed IPC message protocol with structured envelopesexecutors/bridge.py+executors/bridge_cli.py— run-event-log ↔ review bridgeexecutors/review_agent.py— review chain agent logicD1b — Review Handler + Review CLI
executors/review_handler.py— review orchestration handlerexecutors/review_cli.py— review subcommand CLID2 — Top-Level CLI
executors/cli.py— argparse-based entry point wiring all subcommands: registry, health, routing, worktree, context, review, QA, inbox, and bridgeexecutors/__init__.py— package public API surfaceshutil.which, loadhermes_cli, or spawn subprocessesSafety Boundaries
--force. Tests verify the gate blocks unconfirmed destructive calls.executors/cli.pydoes not triggershutil.which, does not loadhermes_cli, does not spawn subprocesses, and does not importworktree,kanban_feedback, or other uncommitted modules at the top level.$TMPDIR. No repository-level destructive operations are performed by any test.Validation
validate-contract.mjs)web/)py_compile— all executor modulestests/executors/full suitetests/executors/test_cli.py--forcebypassesWhat Did Not Ship
chrome.tabs/chrome.scripting/chrome.debuggerbridgeChatSessionSidebarwiring — kept as a local excluded draft, not connected to the app shell in this PRbrowser_adapter.py)Risks / Follow-ups
kanban_feedbackevent path by design. Future work may bridge them at the routing or bridge layer, but for now they are independent subsystems.ChatSessionSidebaris kept as a local excluded draft. It is not wired into the app shell and is not part of this PR. Downstream work will need to integrate it.hermes_cli/kanban_feedback.pyintroduces a new feedback event path. Its interaction with the existing kanban CLI surface should be documented before downstream consumers adopt it.Commit Breakdown
ce62fbc5cfeat(browser-workspace): Electron host lifecycle + chat insertion contract312050bfefeat(kanban): add review and QA feedback events313b5d896feat(ui): add structured preview panel for tool results86d2b64e7feat(ui): add embedded chat routing mode51671f813feat(executors): add core registry and router APIb9b28ddf4feat(executors): add CLI adapter implementationsdb8129cf0feat(executors): add context inbox and prompt toolsa95211d9efeat(executors): add guarded worktree tools50bb17679feat(executors): add bridge IPC and review parsing primitives5b150a6befeat(executors): add review handler and CLI subcommands7bbb0a3edfeat(executors): add top-level CLI integration🤖 Generated with Claude Code