You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No file in either package imports or instantiates PushClient.
The SERVER side (WebSocketGateway, GatewaySession) is used — by praisonai/cli/features/gateway.py, cli/features/serve.py, cli/commands/gateway.py. That's legit.
The CLIENT side was shipped speculatively "for future SDK users" but is dead code today.
Decision: close this out via issue #1482 (already filed). Move PushClient + transports to praisonai wrapper or delete entirely if there is no concrete user ask. Every LOC that ships has to earn its place — 600+ LOC of unused consumer SDK code does not.
Acceptance test for #1482:grep -rn "PushClient" src/praisonai-agents/ returns zero hits.
Part 2 — #1480 gaps that I got wrong (close these items)
Verdict: duplicate of existing setup command. Drop G1 entirely. Recommendation: just add one doc line to README pointing first‑time users to praisonai setup. No new CLI command, no new 150 LOC.
❌ G10 — "Structured dialectic user model" → PersonaStore is already enough
PersonaStore already captures user facts through LearnConfig(persona=True).
Structured categorisation (preference / goal / expertise / constraint) adds marginal value for 95% of users. It's the kind of feature that looks impressive in a spec and is never queried in practice.
If categorisation is wanted, it costs one optional column in PersonaStore.observe() — no new store, no new protocol.
Verdict:drop G10. If anyone wants dimensions, open a focused 20‑LOC PR against PersonaStore.
Part 3 — #1480 gaps to drop (cargo‑cult from reference codebase)
❌ G6 — Surrogate/non‑ASCII sanitiser
Reference codebase scrubs surrogates because it supports a messaging transport where bytes round‑trip through shells with weird locales. PraisonAI users predominantly hit litellm, which already handles unicode. No bug has been filed. No user has asked for this. Adding 80 LOC to defend against a hypothetical is classic premature hardening.
Verdict:drop G6. If a surrogate crash is ever reported, add a 3‑line .encode("utf-16","surrogatepass").decode("utf-16","replace") at the one call site that needs it. Not a feature.
❌ G7 — Shared iteration budget across parent + subagents
The one use case: "user sets max_iterations=20, agent spawns 3 subagents each with 20 → total 80 tool calls, user surprised". Real‑world hit rate: low. PraisonAI users rarely build deep subagent trees, and those who do can set max_iterations explicitly on the delegator.
Verdict:drop G7. Revisit only if a user reports runaway subagent cost.
❌ G11 — Credential pool / multi‑API‑key rotation
Most users: one key. They don't care.
Heavy users already have litellm provider‑level failover.
Adding a credential pool doubles the key‑management surface area for a niche.
Verdict:drop G11 from core. If someone really wants key rotation, they can supply a litellm router config; PraisonAI doesn't need to own this.
❌ G9 (originally thinking‑block handling) — scope too wide
The genuine user pain: with reasoning models, <think>…</think> leaks into user‑visible chat. That's a one‑line fix at the render step, not a new module.
Verdict:don't add thinking.py. Instead, in the existing display/render path, strip <think>…</think> when detected. ~15 LOC, inside the wrapper's output/ module. Keep as a minor enhancement ticket, not a gap.
Add one optional "retrieval escape hatch": when a tool output is truncated, store the full content to a session‑scoped file and expose load_truncated(ref) tool so the agent can fetch full content on demand.
Reuse context/store.py and context/aggregator.py. No new ToolResultStoreProtocol.
Total diff: ~150 LOC + 2 tests, all in praisonai wrapper (no core SDK change).
✅ G4 — Parallel tool path‑overlap guard
Keep exactly as filed. Concurrent writes to the same path is a real data‑loss class of bug. Low LOC (~100), high safety value.
✅ G5 — Error classifier (reduce scope: only CONTEXT_LIMIT, drop the rest)
The only error category with a distinct automated recovery is context‑length overflow → auto‑compress → retry. AUTH doesn't need a classifier (one check at init). TRANSIENT is already handled by litellm retry. RATE_LIMIT is already handled.
Revised scope:
Add a single helper is_context_overflow(err) -> bool (~10 LOC).
Wire in llm/llm.py: on detection → trigger existing context/compressor.py → retry once.
No new ErrorCategory enum, no classifier module. Total: ~30 LOC + 1 test.
✅ G8 — Session title auto‑gen
Keep as filed. Real UX win for anyone browsing past chats. ~100 LOC, lazy, failure‑silent. Worth it.
✅ G12 — OSV scan on skill install
Keep, gated. Only proceeds when Skills Hub (#1471 Phase 6) ships a remote skill fetcher. Before then, the vulnerability surface is zero. Don't build in advance.
Part 5 — What PraisonAI already does BETTER than the reference
These aren't gaps — they're strengths to retain / market:
G2 interrupt → 50 LOC, all in core Agent (protocol stub already there).
G4 path overlap → 100 LOC in tools/call_executor.py.
G5 context‑overflow auto‑recovery → 30 LOC in llm/llm.py wired to existing compressor.
G8 title auto‑gen → 100 LOC in praisonai wrapper, reuse existing session.set_title.
G9 <think> strip → 15 LOC in wrapper's output formatter.
G3 retrieval escape hatch for truncated results → 150 LOC wrapper side, reuse existing truncation plumbing.
G12 OSV → only when Skills Hub lands.
Net new LOC in praisonaiagents (core SDK): ~150. Net new LOC in praisonai (wrapper): ~300. Removed from praisonaiagents: ~600 (PushClient move). Final: core SDK is smaller and sharper.
Audit: Bloat check on PR #1479, corrections to #1480, and what actually matters
Overview
Honest, evidence-first re-audit of recent self‑improving‑agent work with a strict "only ship what adds real user value" lens. Outcomes:
Net effect:
praisonaiagentsgets smaller, not bigger. Only features that make users safer, faster, or more confident land.Method
Part 1 — Bloat already in main (remove)
B1.
PushClientand concrete transports — zero internal callersShipped by PR #1479 (commit
936f39ed):praisonaiagents/push/client.py(388 LOC)praisonaiagents/push/transports.py(214 LOC)PushClient.WebSocketGateway,GatewaySession) is used — bypraisonai/cli/features/gateway.py,cli/features/serve.py,cli/commands/gateway.py. That's legit.Decision: close this out via issue #1482 (already filed). Move
PushClient+ transports topraisonaiwrapper or delete entirely if there is no concrete user ask. Every LOC that ships has to earn its place — 600+ LOC of unused consumer SDK code does not.Acceptance test for #1482:
grep -rn "PushClient" src/praisonai-agents/returns zero hits.Part 2 —
#1480gaps that I got wrong (close these items)❌ G1 — "Add
praisonai initwizard" → ALREADY EXISTSpraisonai setup(+ aliaspraisonai setup wizard) is a 173‑line typer command that already:--non-interactive --provider --api-key --modelfeatures/setup/handler.pyVerdict: duplicate of existing
setupcommand. Drop G1 entirely. Recommendation: just add one doc line to README pointing first‑time users topraisonai setup. No new CLI command, no new 150 LOC.❌ G10 — "Structured dialectic user model" →
PersonaStoreis already enough$ grep -n "class PersonaStore" src/praisonai-agents/praisonaiagents/memory/learn/stores.py 208:class PersonaStore(BaseStore):PersonaStorealready captures user facts throughLearnConfig(persona=True).PersonaStore.observe()— no new store, no new protocol.Verdict: drop G10. If anyone wants dimensions, open a focused 20‑LOC PR against
PersonaStore.Part 3 —
#1480gaps to drop (cargo‑cult from reference codebase)❌ G6 — Surrogate/non‑ASCII sanitiser
Reference codebase scrubs surrogates because it supports a messaging transport where bytes round‑trip through shells with weird locales. PraisonAI users predominantly hit
litellm, which already handles unicode. No bug has been filed. No user has asked for this. Adding 80 LOC to defend against a hypothetical is classic premature hardening.Verdict: drop G6. If a surrogate crash is ever reported, add a 3‑line
.encode("utf-16","surrogatepass").decode("utf-16","replace")at the one call site that needs it. Not a feature.❌ G7 — Shared iteration budget across parent + subagents
The one use case: "user sets
max_iterations=20, agent spawns 3 subagents each with 20 → total 80 tool calls, user surprised". Real‑world hit rate: low. PraisonAI users rarely build deep subagent trees, and those who do can setmax_iterationsexplicitly on the delegator.Verdict: drop G7. Revisit only if a user reports runaway subagent cost.
❌ G11 — Credential pool / multi‑API‑key rotation
litellmprovider‑level failover.Verdict: drop G11 from core. If someone really wants key rotation, they can supply a
litellmrouter config; PraisonAI doesn't need to own this.❌ G9 (originally thinking‑block handling) — scope too wide
The genuine user pain: with reasoning models,
<think>…</think>leaks into user‑visible chat. That's a one‑line fix at the render step, not a new module.Verdict: don't add
thinking.py. Instead, in the existing display/render path, strip<think>…</think>when detected. ~15 LOC, inside the wrapper'soutput/module. Keep as a minor enhancement ticket, not a gap.Part 4 — Gaps to keep, with narrowed scope
✅ G2 — Interrupt (reduce scope: wire the EXISTING protocol, don't invent)
The protocol stub exists but
Agenthas no concrete implementation:Revised scope (not a new module):
Agent.interrupt()→ sets anEventflag.execution_mixin._run_loop: oneif self._interrupt_flag.is_set(): breakcheck per iteration.delegator.InterruptControllerclass.✅ G3 — Large tool result storage (reduce scope: upgrade existing truncation, don't bolt on a new protocol)
PraisonAI already has truncation infrastructure I missed:
Revised scope:
load_truncated(ref)tool so the agent can fetch full content on demand.context/store.pyandcontext/aggregator.py. No newToolResultStoreProtocol.praisonaiwrapper (no core SDK change).✅ G4 — Parallel tool path‑overlap guard
Keep exactly as filed. Concurrent writes to the same path is a real data‑loss class of bug. Low LOC (~100), high safety value.
✅ G5 — Error classifier (reduce scope: only CONTEXT_LIMIT, drop the rest)
The only error category with a distinct automated recovery is context‑length overflow → auto‑compress → retry.
AUTHdoesn't need a classifier (one check at init).TRANSIENTis already handled bylitellmretry.RATE_LIMITis already handled.Revised scope:
is_context_overflow(err) -> bool(~10 LOC).llm/llm.py: on detection → trigger existingcontext/compressor.py→ retry once.ErrorCategoryenum, no classifier module. Total: ~30 LOC + 1 test.✅ G8 — Session title auto‑gen
Keep as filed. Real UX win for anyone browsing past chats. ~100 LOC, lazy, failure‑silent. Worth it.
✅ G12 — OSV scan on skill install
Keep, gated. Only proceeds when Skills Hub (#1471 Phase 6) ships a remote skill fetcher. Before then, the vulnerability surface is zero. Don't build in advance.
Part 5 — What PraisonAI already does BETTER than the reference
These aren't gaps — they're strengths to retain / market:
Protocolclasses; lazy wrapper loadinglitellm→ 100+ modelsprocess: hierarchical+ manager_llmpraisonai.security.enable_security()(68 tests)praisonai dashboardHookEventbus with before/after agent/LLM/toolpraisonai-tsDon't lose these by bloating the core with features nobody asked for.
Revised scorecard (what this audit actually ships)
Proposed execution order
tools/call_executor.py.llm/llm.pywired to existing compressor.praisonaiwrapper, reuse existingsession.set_title.<think>strip → 15 LOC in wrapper's output formatter.Net new LOC in
praisonaiagents(core SDK): ~150. Net new LOC inpraisonai(wrapper): ~300. Removed frompraisonaiagents: ~600 (PushClient move). Final: core SDK is smaller and sharper.Acceptance criteria for this audit
praisonaiagents/.Protocolclass introduced without at least one in‑tree concrete caller..mdscope‑creep files at repo root.Principles adopted from this audit (for future work)
Protocolneeds an in‑tree caller. No speculative SDK surfaces.References
praisonaiagents/agent/protocols.py:406— existinginterrupt()protocol stubpraisonai/cli/commands/setup.py— existing 173‑line setup wizardpraisonaiagents/memory/learn/stores.py:208— existingPersonaStorepraisonaiagents/context/{store,aggregator,instrumentation}.py— existing truncation infrastructure