Author SHA1 Message Date
taodengandClaude Opus 4.6 0338f599ce fix: improve agent tree ordering and parent inference
Root agents with their own bot (hasOwnBot) now sort to the top of the
agent tree alongside main. Agents listed in a parent's
subagents.allowAgents are automatically inferred as children even
without an explicit parentAgentId or Telegram binding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 20:33:03 +10:00
2 changed files with 3 additions and 11 deletions
+2 -10
View File
@@ -3360,20 +3360,12 @@ function renderAgents() {
// Build grouping: prefer explicit parentAgentId; fallback to telegram bot-root grouping.
const byId = {}; (S.agents||[]).forEach(a=>{ byId[a.id]=a; });
// infer parentAgentId for sub-agents if missing
// infer parentAgentId for legacy telegram sub-agents if missing
const accountToRootId = {};
(S.agents||[]).forEach(a=>{ if(a.hasOwnBot && a.accountId) accountToRootId[a.accountId]=a.id; });
(S.agents||[]).forEach(a=>{
if(a.parentAgentId || a.hasOwnBot || a.id === 'main') return; // already resolved or is a root
// Case 1: legacy telegram sub-agent with parentAccountId
if(a.parentAccountId && accountToRootId[a.parentAccountId]){
if(!a.parentAgentId && !a.hasOwnBot && a.parentAccountId && accountToRootId[a.parentAccountId]){
a._inferParentAgentId = accountToRootId[a.parentAccountId];
return;
}
// Case 2: orphan agent (no own bot, no parentAgentId, no binding-based inference)
// These are likely dynamically created sub-agents — default to 'main'
if(byId['main']){
a._inferParentAgentId = 'main';
}
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "openclaw-manager",
"version": "0.9.4",
"version": "0.9.3",
"description": "A local web UI for managing OpenClaw AI agents \u2014 no npm install required",
"main": "openclaw-manager.js",
"scripts": {