overview: exclude sandbox teams from the agents list, and name agents for display
sandbox:librechat-test is a throwaway test account rather than an agent of the co-op, so it drops out of the panel. Its spend then appears nowhere — accepted knowingly. Agents also carry a display `name` (the alias minus its "agent:" prefix), so the panel does not have to strip prefixes itself.
This commit is contained in:
1 parent
a0040f52e0
commit
9f198fcf4c
1 file changed
+7
-1
+7
-1
@@ -3137,12 +3137,18 @@ async def admin_overview(request: Request):
|
||||
agents = [
|
||||
{
|
||||
"alias": alias,
|
||||
# Display name: the panel's section header already says "Agents", so the
|
||||
# "agent:" prefix is noise there. `alias` keeps the full string.
|
||||
"name": alias.split(":", 1)[1] if ":" in alias else alias,
|
||||
"spend": float(t.get("spend") or 0.0),
|
||||
"budget": t.get("max_budget"),
|
||||
"team_members": len(t.get("members_with_roles") or []),
|
||||
}
|
||||
for alias, t in teams.items()
|
||||
if alias and not alias.startswith("member:")
|
||||
# member:* are members; sandbox:* are throwaway test accounts rather than
|
||||
# agents of the co-op. Their spend stops being visible anywhere once
|
||||
# filtered here — accepted knowingly.
|
||||
if alias and not alias.startswith(("member:", "sandbox:"))
|
||||
]
|
||||
agents.sort(key=lambda a: a["spend"], reverse=True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user