mirror of
https://github.com/dtzp555-max/ocm.git
synced 2026-07-19 09:43:37 +00:00
fix: orphan agents now grouped under main in agent tree
Agents without parentAgentId, own bot, or binding-based inference (e.g. dynamically created sub-agents like codex-worker) were incorrectly displayed as top-level roots. They now default to main's subtree. Bump version to 0.9.4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d3fdbcef6a
commit
15798e007d
+10
-2
@@ -3360,12 +3360,20 @@ 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 legacy telegram sub-agents if missing
|
||||
// infer parentAgentId for 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.parentAccountId && accountToRootId[a.parentAccountId]){
|
||||
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]){
|
||||
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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openclaw-manager",
|
||||
"version": "0.9.3",
|
||||
"version": "0.9.4",
|
||||
"description": "A local web UI for managing OpenClaw AI agents \u2014 no npm install required",
|
||||
"main": "openclaw-manager.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user