Skip to content

refactor: unified workspaces layout + hand/agent isolation + routing fixes#1542

Merged
houko merged 25 commits intomainfrom
fix/hand-agent-name-collision
Mar 23, 2026
Merged

refactor: unified workspaces layout + hand/agent isolation + routing fixes#1542
houko merged 25 commits intomainfrom
fix/hand-agent-name-collision

Conversation

@houko
Copy link
Copy Markdown
Contributor

@houko houko commented Mar 23, 2026

Summary

Major refactoring of workspaces layout and agent management.

Closes #1543, Closes #1544, Closes #1545

Workspace Layout

workspaces/
├── hands/           # hand workspaces (activate+pause on first boot)
│   └── apitester/
│       ├── hand.toml
│       ├── apitester:debugger/
│       └── apitester:main/
└── agents/          # standalone agents (routing auto-spawn)
    ├── assistant/
    └── debugger/

Key Changes

  • Hand agents prefixed hand_id:name to avoid routing collision
  • Registry as catalog, pre-install core content only
  • 14 hands activate+pause on first boot, 32 agent templates pre-installed
  • Model routing falls back when provider has no API key
  • Per-agent usage from SQLite (persistent)
  • Dashboard: cost field, login redirect, auth retry
  • Requirements warn instead of block
  • Git init on first boot
  • Known config fields: dashboard_user/pass, log_dir, inbox

houko and others added 12 commits March 23, 2026 09:10
- Remove unused workspace_dir (singular) config field
- Stop sync_registry from flattening all content to root dirs
- Registry cache (~/.librefang/registry/) is now a catalog/store
- Pre-install on boot: providers, integrations, aliases.toml,
  assistant agent template, and all hands (via install API)
- Skills and plugins stay in registry, installed from dashboard
- Runtime only reads user directories, never registry/ directly
- Add git init on first boot for config version control
- Remove bundled_agents module (no longer used)
- Update docs (EN + ZH) to reflect new install model
Without this, `librefang init` creates an empty home directory
with no registry cache, no providers, and no hands.
- Fix install test assertion path (hands/ → workspaces/hands/)
- Add ensure_test_home() helper that syncs registry and migrates
  old hands/ dir before running tests
- disk_hands reads definitions from registry/hands/ (no copy needed)
- First boot: activate all hands then pause (creates full workspace
  with AGENT.json, SOUL.md, memory/, sessions/, etc.)
- Subsequent boots: restore from hand_state.json
- Remove file-copy preinstall from both CLI and kernel boot
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added area/docs Documentation and guides area/skills Skill system and FangHub marketplace area/runtime Agent loop, LLM drivers, WASM sandbox area/kernel Core kernel (scheduling, RBAC, workflows) area/security Security systems and auditing labels Mar 23, 2026
When multiple hands define agents with the same name (e.g. both
"researcher" and "strategist" hands use an "analyst" agent), reuse
the existing agent instance instead of failing with "Agent already
exists". Shared agents accumulate memory and sessions in one place.
@houko houko force-pushed the fix/hand-agent-name-collision branch from 9cdce50 to d109cea Compare March 23, 2026 11:50
@houko houko force-pushed the fix/hand-agent-name-collision branch from 2197699 to e871974 Compare March 23, 2026 12:33
workspaces/
├── apitester/          ← hand workspace
│   ├── agent.toml      ← manifest snapshot
│   ├── debugger/       ← agent workspace (SOUL.md, memory/, etc.)
│   ├── scanner/
│   └── tester/
├── collector/
│   ├── agent.toml
│   ├── translator/
│   └── email-assistant/
└── assistant/          ← standalone agent

- Remove workspaces/agents/ and workspaces/hands/ subdirectories
- Hand agents nest under workspaces/<hand-id>/<role>/
- Standalone agents (no hand) go directly in workspaces/<name>/
- Hand definitions read from registry/hands/ only
- Migration flattens old agents/ and hands/ subdirs
@houko houko force-pushed the fix/hand-agent-name-collision branch from e871974 to 7415d28 Compare March 23, 2026 13:13
houko added 4 commits March 23, 2026 13:42
… boot

1. After successful login, navigate to /#/overview instead of staying
   on whatever page the browser cached (often /#/hands)
2. checkAuthRequired retries 3 times with 1s delay when daemon is
   still booting, preventing false "no auth needed" when daemon
   hasn't started yet
@github-actions github-actions Bot removed area/docs Documentation and guides area/skills Skill system and FangHub marketplace area/security Security systems and auditing labels Mar 23, 2026
@houko houko force-pushed the fix/hand-agent-name-collision branch from ea90412 to c790f9f Compare March 23, 2026 14:12
@houko houko force-pushed the fix/hand-agent-name-collision branch from c790f9f to 10e6e69 Compare March 23, 2026 14:13
@houko houko changed the title fix: namespace hand agent names to avoid cross-hand collisions refactor: unified workspaces layout + hand/agent isolation + routing fixes Mar 23, 2026
@houko houko merged commit 1c4dfff into main Mar 23, 2026
11 of 12 checks passed
@houko houko deleted the fix/hand-agent-name-collision branch March 23, 2026 14:43
This was referenced Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kernel Core kernel (scheduling, RBAC, workflows) area/runtime Agent loop, LLM drivers, WASM sandbox

Projects

None yet

1 participant