Skip to content

feat(agent): Better Harness, coordinated subagents, and harness tooling#6

Merged
iptoux merged 18 commits into
mainfrom
feat/better-harness
May 21, 2026
Merged

feat(agent): Better Harness, coordinated subagents, and harness tooling#6
iptoux merged 18 commits into
mainfrom
feat/better-harness

Conversation

@iptoux
Copy link
Copy Markdown
Contributor

@iptoux iptoux commented May 21, 2026

Summary

This PR delivers the Better Harness agent stack and coordinated subagents on top of the existing BLXCode workbench agent, plus supporting UI, i18n, documentation, and CI.

Better Harness (core skills + slim system prompt)

  • Embeds 11 core harness skills (file-access, memory, plans, tasks, rules-skills, harness, environment, shell, git, web, subagents) via CORE_SKILLS in skills_rules/store.rs.
  • Adds SkillSourceKind::Core and Skills panel Core / User tabs with core badge and remove guard.
  • Reduces system_prompt.rs to a compact checklist + tool name index; full tool docs via skills_read on core skills.
  • Web core skill exposes availability: disabled_no_key when no Tavily/Brave key is configured.

Coordinated subagents

  • New server tool subagents.run — parallel runs (max 5 agents, default concurrency 3) sharing coordinator provider/model/key/thinking.
  • Roles: scout, review, security_analyst with role-specific default allowedToolGroups.
  • Per-subagent HTTP loops in subagent_runner.rs for OpenRouter, OpenAI-compatible, and Anthropic (non-streaming).
  • Forced submit_result tool with structured JSON; truncation for coordinator payload size.
  • Live timeline: SubagentGroup cards, localized labels, 50 ms event debounce (subagent_debounce.rs).
  • Hard caps: 8 tool rounds / ~20k output tokens per subagent; no nesting (subagents.run / shell_write stripped from subagent catalogs).

Harness server tools

  • environment_detect with session cache; agent_environment_invalidate + frontend call on workspace switch.
  • shell_exec with read-only allowlist, child registry, cancel kill.
  • Git and workspace tools (git_*, workspace_search, workspace_diff, …).
  • Web tools (web_search / web_fetch) with settings envelope + keyring (agent:web:tavily / agent:web:brave) and Harness Web Tools UI.
  • Unified tool_dispatch.rs and tool_groups.rs for coordinator + subagent filtered catalogs.

UI & i18n

  • Harness Agent pane: web provider + API key management.
  • Subagent timeline rendering with AgSubagent*, AgRole*, AgTool*, AgWeb* keys across all 13 locales.
  • Rules/skills panel improvements (expandable cards, rule creation, styling) included on this branch.

Docs

Other (already on branch)

  • Leptos 0.8 upgrade and related dependency bumps.
  • PR cargo check workflow (.github/workflows/pr-check.yml).
  • Platform setup script path fixes; plans marked done in .agents/plans/.

Architecture (high level)

flowchart TB
  UI[Leptos Agent panel]
  Bridge[tauri_bridge]
  Orch[session_orchestrator]
  Dispatch[tool_dispatch]
  Sub[subagents.run]
  Skills[CORE_SKILLS + skills_read]

  UI --> Bridge --> Orch --> Dispatch
  Dispatch --> Sub
  Orch --> Skills
  Sub --> Runner[subagent_runner]
  Runner --> API[OpenRouter / OpenAI / Anthropic]
Loading

Test plan

  • cargo test -p blxcode — backend unit tests (tool groups, environment cache, skills store, …)
  • cargo check -p blxcode and cargo check -p blxcode-ui --target wasm32-unknown-unknown
  • cargo tauri dev — open workspace, configure provider + optional web keys
  • Agent turn: verify skills_list shows 11 core skills; Skills panel Core/User tabs
  • Explicit subagent prompt (e.g. “use subagents to review …”) — timeline Subagents group, debounced updates, final coordinator reply
  • Switch workspace — shell/git after environment_detect works; cache invalidation on switch
  • Web Tools: save Tavily/Brave key, confirm web_search appears in tool catalog when enabled
  • Anthropic + OpenRouter provider paths for main agent and subagents
  • Read updated docs under docs/user/ and docs/developer/

Breaking / behavior notes

  • System prompt is significantly shorter; agents must call skills_read for detailed tool guidance (by design).
  • Subagents only run on explicit user request (documented in system prompt).
  • shell_write and subagents.run are never exposed to subagent tool catalogs.

Plans

  • .agents/plans/better-harness.md — done
  • .agents/plans/coordinated-subagents.md — done

Made with Cursor

Maik Roland Damm and others added 16 commits May 21, 2026 12:45
…5→0.7

Lucide icon renames required by icondata 0.7:
- LuFileEdit → LuFilePenLine
- LuPlusCircle → LuCirclePlus
- LuSendHorizonal → LuSendHorizontal (typo fix)
- LuAlertTriangle → LuTriangleAlert
- LuTerminalSquare → LuSquareTerminal
- LuPlayCircle/AlertCircle/CheckCircle/MinusCircle → LuCircle* variants

No reactive API changes needed — leptos 0.8 is backward-compatible
for all signal, effect, callback and event-listener APIs used here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs cargo check for both crates on every pull request:
- blxcode (Tauri backend, native Linux)
- blxcode-ui (Leptos frontend, wasm32-unknown-unknown)

Uses dtolnay/rust-toolchain for reliable toolchain setup
and actions/cache to speed up repeated runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract all per-tool documentation from the system prompt into 6
embedded Core Skill files (file-access, memory, plans, tasks,
rules-skills, harness). System prompt shrinks from ~470 to ~240 lines;
tool docs are now served lazily via `skills_read`.

- Add `SkillSourceKind::Core` variant (backend + frontend wire types)
- `list_skills` prepends 6 always-present core skills; `read_skill`
  serves embedded content; `remove_skill` rejects core names
- Skills tab: Core/User sub-tabs; "Install" button hidden in Core view
- SkillCard: "core" badge + remove button suppressed for core skills
- All 13 locale files updated with SrSkillsTabCore/User/SrSourceCore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Refactored SkillCard to render as an expandable card with a shadcn-style switch.
- Added lazy loading for the skill's `SKILL.md` body on first expand.
- Updated styling for the card, including hover effects and improved layout.
- Introduced source-kind icon badges for better visual representation.
- Enhanced SkillsTab with a modern pill switcher for Core/User sub-tabs.
- Added counts for core and user skills in the tab headers.
- Improved error and empty state handling in the SkillsTab.
- Updated CSS for better visual consistency and responsiveness across components.
…spatch and enhanced role management

- Introduced subagent events for tracking lifecycle: `SubagentStarted`, `SubagentStep`, `SubagentToolCall`, and `SubagentFinished`.
- Enhanced the timeline to display subagent activities and their statuses.
- Implemented environment detection and session caching for workspace management.
- Added Git tools scoped to the workspace, including commands for status, diff, log, and more.
- Established a shell execution framework with command allowlisting and child process management.
- Refactored tool dispatching to support subagent operations across multiple providers (Anthropic, OpenRouter, OpenAI).
- Updated documentation to reflect new features and usage guidelines for subagents.
…uses

- Added Portuguese, Russian, Simplified Chinese, and Traditional Chinese translations for various subagent roles, statuses, and web tool descriptions.
- Introduced new structures and functions in `tauri_bridge.rs` for managing web settings and API keys.
- Implemented a debounce mechanism for subagent timeline events to optimize event handling in the agent panel.
- Enhanced the agent panel UI to include web settings management, allowing users to configure API keys for Tavily and Brave.
- Updated the timeline rendering logic to support localized labels for tools and subagent statuses.
- Added functionality to invalidate the agent environment cache when necessary.
- Added new sections for Agent Harness and Subagents in user and developer documentation.
- Updated README and various documentation files to include links to Agent Harness and Subagents.
- Improved clarity on core skills, tool usage, and the interaction between the main agent and subagents.
- Documented the structure and functionality of the Agent Harness, including core skills and web tools.
- Clarified the roles and limits of subagents, including their interaction with the main agent and tool access.
- Enhanced troubleshooting guidance for web tools and subagent visibility.
@iptoux iptoux added documentation Improvements or additions to documentation enhancement New feature or request review Ticket/Steps need to be review/tested labels May 21, 2026
- Updated README to reflect the new features and enhancements in the workbench, including the upgrade to Leptos 0.8.
- Enhanced documentation for the localization process, including the new path for the render script and added parallel processing capabilities.
- Improved clarity on how to add UI strings and manage translations, with examples for specific keys and full rewrites.
- Updated localization files for German, Spanish, French, Hungarian, and Italian to ensure consistency with the latest changes.
@iptoux iptoux self-assigned this May 21, 2026
Signed-off-by: Maik Damm <iptoux@gmail.com>
@iptoux iptoux merged commit 15a50cb into main May 21, 2026
1 check passed
@iptoux iptoux deleted the feat/better-harness branch May 21, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request review Ticket/Steps need to be review/tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant