Compare commits

...
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison 85ba558a3b fix: real MCP readiness check in example + drop unused SseServerTransport
- simple-mcp-server.py: replace blind 2s sleep with TCP readiness poll so
  the smoke test genuinely verifies the server bound and exits non-zero on
  failure (addresses Greptile P1: daemon exited claiming false success)
- execution_mixin.py: remove now-unused SseServerTransport import/instance
  after switching to FastMCP.sse_app() (dead code flagged by Greptile)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-24 08:57:52 +00:00
Dhivya-Bharathy 1cfb2bc26f fix: resolve 4 remaining E2E example failures after batch-3 merge 2026-07-24 14:25:40 +05:30
Mervin Praison cb7f4821d9 Merge pull request #3335 from MervinPraison/feat/slack-allow-shell
feat(bot): opt-in shell execution for inbound Slack channels
2026-07-23 17:03:39 +01:00
praisonai-triage-agent[bot]andMervin Praison 4fa0711282 fix(bot): apply shell setup to routed agents and fail-closed manual approval
Addresses two Greptile P1 findings on the allow_shell opt-in:

1. Routed agents lose shell tools: _inject_routing_handler swapped in a raw
   agent from self._agents, stripping execute_command applied to the default
   channel clone. Re-apply enable_shell_tools to the routed agent (cloned once
   per channel+agent so non-shell channels never gain the shell tool).

2. Manual approval retained auto-approval (security): with auto_approve_shell
   false and no Slack approval channel, a pre-existing AutoApproveBackend was
   left installed, silently auto-approving shell. Now fail-closed with a
   deny-by-default backend that rejects shell commands.

Adds tests for both fail-closed approval paths.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 15:32:52 +00:00
Mervin Praison b9e16dc0da Merge pull request #3336 from MervinPraison/feat/shell-approval-all-channels
feat(bot): allow_shell with multi-channel approval wiring
2026-07-23 16:27:24 +01:00
MervinPraison 3bba1e6fd8 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 15:26:23 +00:00
praisonai-triage-agent[bot] 56326b779f Merge pull request #3325 from MervinPraison/claude/issue-3311-20260723-1026
fix: surface retry/backoff status in the CLI
2026-07-23 15:25:50 +00:00
praisonai-triage-agent[bot]andMervin Praison e07424179b fix(bot): guard webhook approval url and validate approval_mode
- Fix missing approval_webhook_url becoming the literal string "None"
  which bypassed WebhookApproval's ValueError guard; now falls through
  to platform/gateway approval instead of building a broken backend
- Add fail-closed approval_mode validator (channel|gateway|http|webhook)
  so config typos are rejected at load time, matching other enum fields
- Add regression tests for webhook-mode with and without a URL

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 15:19:49 +00:00
MervinPraison 7742cf8b5f feat(bot): wire shell approvals for Telegram, Discord, and gateway
Extend allow_shell to route human-in-the-loop approvals through platform
backends (Slack/Telegram/Discord) plus gateway, HTTP, and webhook modes,
with gateway fallback for channels without native wiring.
2026-07-23 16:11:42 +01:00
MervinPraison 01bd8e1bb9 feat(bot): opt-in shell execution for inbound Slack channels
Add gateway allow_shell channel config to inject execute_command, lift permission deny, and wire auto-approve or SlackApproval.
2026-07-23 16:04:40 +01:00
Mervin Praison 686b422c00 Merge pull request #3334 from MervinPraison/feat/cli-backend-debug
feat(agents): add CLI backend debug logging
2026-07-23 16:02:52 +01:00
praisonai-triage-agent[bot]andMervin Praison 4f576a65a9 fix(cli_backend): redact prompt argv and emit hook on failure
Address reviewer feedback on the CLI_BACKEND_EXECUTE hook path:

- Security: redact prompt/system argv values (redact_command) at the
  payload serialization boundary and in the plugin bridge, so prompts and
  system instructions do not leak into downstream log sinks. The live
  in-memory command field is preserved for programmatic consumers.
- Observability: emit the hook on failure too (extracted
  _emit_cli_backend_hook helper) so subprocess startup errors and timeouts
  remain traceable via error=<message>, instead of only on success.
- Tests: cover redaction (serialization + plugin bridge) and failure-path
  hook emission.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 14:57:14 +00:00
MervinPraison 5d6a378847 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 14:54:02 +00:00
Mervin Praison afa1f309df Merge pull request #3331 from Dhivya-Bharathy/fix/e2e-examples-batch3
fix: batch-3 E2E — skip non-runnable examples and fix remaining runner/example bugs
2026-07-23 15:53:19 +01:00
Mervin Praison d3457c62b7 Merge pull request #3333 from MervinPraison/feat/codex-grok-cli-backends
feat(code): add codex-cli and grok-cli agent backends
2026-07-23 15:51:45 +01:00
MervinPraison e2fe855a0a refactor(agents): emit CLI backend hook instead of inline logging
Replace agent.py debug logging with CLI_BACKEND_EXECUTE hook payload.
Logging moves to praisonai-plugins cli_backend_tracer entry point.
2026-07-23 15:51:36 +01:00
praisonai-triage-agent[bot] e2a9d9917f Merge pull request #3324 from MervinPraison/claude/issue-3308-20260723-1026
fix: harden praisonai serve agents (auth, caching, converged routes)
2026-07-23 14:49:20 +00:00
MervinPraison b78dbf907c feat(agents): add CLI backend debug logging
Log subprocess command and confirm PraisonAI skips LLM HTTP when cli_backend delegates a turn.
Enable with PRAISONAI_CLI_BACKEND_DEBUG=1 or LOGLEVEL=DEBUG.
2026-07-23 15:46:24 +01:00
praisonai-triage-agent[bot]andMervin Praison 4cbfb0d848 fix(code): gate gemini session resume on is_resume
Gemini backend forwarded --resume on every turn including the first,
which would fail resuming a non-existent session. Gate on
CliSessionBinding.is_resume for parity with codex/grok/claude.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 14:45:40 +00:00
praisonai-triage-agent[bot]andMervin Praison 22fb06595d fix(code): forward session id on codex/grok resume turns
Codex backend never forwarded the session id to `codex exec`, so
multi-turn conversations lost context (Greptile P1). Now forwards
`resume <session_id>` on resume turns. Gate both codex and grok
session forwarding on CliSessionBinding.is_resume so the first turn
does not attempt to resume a non-existent session.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 14:45:08 +00:00
MervinPraison 83dc068a08 feat(code): add gemini-cli agent backend
Delegate Agent turns to  headless mode alongside codex-cli and grok-cli.
2026-07-23 15:42:33 +01:00
Mervin Praison 8fb796e1e3 Merge pull request #3332 from MervinPraison/fix/claude-subscription-oauth-readonly
fix(agents): stop claude-code OAuth refresh invalidating shared sessions
2026-07-23 15:41:43 +01:00
MervinPraison 2bf11482d5 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 14:39:58 +00:00
praisonai-triage-agent[bot] 9adeb8829a Merge pull request #3323 from MervinPraison/claude/issue-3309-20260723-1025
fix: self-repair and actionable feedback on unknown tool calls
2026-07-23 14:39:20 +00:00
MervinPraison 228c984d53 feat(code): add codex-cli and grok-cli agent backends
Enable Agent(cli_backend=...) delegation to OpenAI Codex and xAI Grok CLIs so subscription logins work without direct API auth.
2026-07-23 15:36:58 +01:00
praisonai-triage-agent[bot]andMervin Praison 7b8ec88f03 fix(tests): harden claude-code auth tests for shared-session read-only policy
- Isolate ANTHROPIC_TOKEN/CLAUDE_CODE_OAUTH_TOKEN env in the expiring-token
  test so the Keychain read-only path is deterministically exercised (was
  leaking a real CI OAuth token and returning the wrong access token).
- Assert both anthropic-beta policy changes: fine-grained-tool-streaming is
  present and the unsupported context-1m long-context beta stays absent
  (per CodeRabbit review).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 14:29:33 +00:00
MervinPraison 989e1cc872 fix(agents): stop claude-code OAuth refresh from invalidating shared sessions
PraisonAI read Keychain OAuth tokens but refreshed without persisting back,
rotating refresh tokens and breaking Claude CLI and other tools on the same
machine. Use read-only credential resolution, skip LLM auth refresh for
claude-code, fix invalid_request_error misclassification, and drop the
context-1m beta header unsupported on many subscriptions.
2026-07-23 15:13:52 +01:00
praisonai-triage-agent[bot] 5aa5943ed5 Merge pull request #3322 from MervinPraison/claude/issue-3312-20260723-1021
fix: round-trip long interactive select/reply values via durable callback store
2026-07-23 12:07:44 +00:00
MervinPraison 2b99bacd61 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 12:01:50 +00:00
praisonai-triage-agent[bot] d14f6911c1 Merge pull request #3321 from MervinPraison/claude/issue-3313-20260723-1025
fix: neutralise untrusted platform metadata in prompt attribution
2026-07-23 12:01:17 +00:00
praisonai-triage-agent[bot]andMervin Praison 1aff8c7d66 fix: dispatch async retry stream events to async-only callbacks
The async retry loop emitted RETRY events via the sync emit() path, so
consumers registered through the public add_async_callback() API passed
has_callbacks but never received the event. Add an async-aware
_aemit_retry_stream_event helper (using emit_async) and share event
construction via _build_retry_stream_event. Adds tests for the async-only
callback path and the no-callback no-op case.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:58:34 +00:00
praisonai-triage-agent[bot]andMervin Praison e5e962b9bb fix: surface retry/backoff status in the CLI (fixes #3311)
Add StreamEventType.RETRY emitted alongside the existing ON_RETRY hook (guarded by has_callbacks for zero-overhead) in both sync and async retry loops, carrying attempt/max_attempts/delay/reason in metadata. Map it to a canonical run.retry NDJSON event in the CLI stream-json bridge so consumers get a live 'retrying in Ns (attempt k/N)' signal. Non-JSON/silent modes stay silent.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:57:38 +00:00
praisonai-triage-agent[bot]andMervin Praison f64c67a854 fix: only echo tool parameter hint on genuine bind failures
A TypeError/ValueError raised inside a successfully-bound tool (domain
validation) no longer receives a misleading required/optional parameter
hint. The hint is now gated on inspect.signature().bind() confirming the
failure is an argument-binding error, so runtime errors surface their
real message and the model fixes the value, not the parameter names.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:56:09 +00:00
praisonai-triage-agent[bot]andMervinPraison 70765e9761 fix: self-repair and actionable feedback on unknown tool calls (fixes #3309)
Adds a zero-overhead resilience layer to the core agent tool-dispatch path.
When a tool call cannot be resolved, the runtime now:
1. Self-repairs case/separator drift (e.g. WebSearch/web-search -> web_search)
   against the agent's active tools and executes if a unique match exists.
2. Otherwise returns a model-readable error naming the nearest valid tool
   (fuzzy) and listing the available tools so the model can self-correct.
3. On an argument-binding failure, echoes the tool's required/optional params.

No new public API or Agent params; stays on the existing dispatch path.

Co-authored-by: MervinPraison <[email protected]>
2026-07-23 11:54:56 +00:00
MervinPraison 17a19af2c4 docs: auto-update feature parity trackers [skip ci] 2026-07-23 11:53:40 +00:00
praisonai-triage-agent[bot] b5abfeebe0 Merge pull request #3317 from MervinPraison/claude/issue-3311-20260723-1021
fix: surface retry/backoff status in the CLI so rate-limit waits aren't mistaken for a hang
2026-07-23 11:53:12 +00:00
MervinPraison 6935d99c28 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 11:49:58 +00:00
praisonai-triage-agent[bot]andMervin Praison b829946696 fix: harden praisonai serve agents — auth default, cached generator, converged routes (fixes #3308)
- Security: refuse non-localhost bind without --api-key/PRAISONAI_SERVE_API_KEY,
  mirroring jobs/server.py; enforce the resolved key unconditionally.
- Performance: cache one AgentsGenerator per app via FastAPI lifespan (built at
  startup, closed on shutdown) instead of rebuilding YAML parse + framework
  resolution + a 32-worker pool per request; falls back to praisonai.arun if
  caching fails.
- Correctness: /agents and /agents/{name} now run the same cached generator, so
  identical YAML gets identical lowering (ToolResolver, tool_timeout, approval,
  guardrails, retry). Removed the hand-rolled PraisonAgent registration that
  silently dropped those safety fields.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:49:30 +00:00
praisonai-triage-agent[bot] 2ccfcc41ea Merge pull request #3316 from MervinPraison/claude/issue-3309-20260723-1021
fix: self-repair and actionable feedback on unknown tool calls
2026-07-23 11:49:27 +00:00
praisonai-triage-agent[bot] 0f912b27fc Merge pull request #3318 from MervinPraison/claude/issue-3308-20260723-1021
fix: harden praisonai serve agents (auth, generator caching, route convergence)
2026-07-23 11:46:06 +00:00
praisonai-triage-agent[bot]andMervin Praison 614bd2946f chore: remove committed example run artifacts and ignore them
Remove 13 knowledge.db binaries plus managed_ids.json, blog_post.md,
tutorial.md, token_metrics_export.json, market_research_results.json that
were accidentally committed (PR notes explicitly say not to commit local
artifacts). Add .gitignore rules to prevent recurrence.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:38:54 +00:00
Dhivya-Bharathy 2895163e81 fix: batch-3 E2E — skip optional-deps failures and fix remaining example bugs 2026-07-23 17:04:42 +05:30
praisonai-triage-agent[bot]andMervin Praison 45218a4bf3 fix(security): collapse Unicode line separators + harden attribution fallback (#3313)
Address reviewer findings on PR #3321:
- Core neutralize_untrusted_text now also collapses U+2028/U+2029/U+0085,
  which render as line breaks but bypassed the ASCII control filter.
- Bot _attribute() fallback (core helper unavailable / version skew) now
  mirrors the sanitiser: collapses all newline-like separators, strips
  control chars, and bounds length.
- Added tests for Unicode separators (core + bot) and the fallback path.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:22:38 +00:00
praisonai-triage-agent[bot]andMervin Praison 40a0748155 fix: neutralise untrusted platform metadata in prompt attribution (fixes #3313)
Add a core, pure-stdlib helper neutralize_untrusted_text() in
praisonaiagents.session.context and apply it by default to the
third-party-controlled sender display name before it is interpolated into
the [{sender}] attribution prefix. Newlines/CR are collapsed, control chars
stripped and length is bounded, so a hostile name can no longer masquerade
as a fake system directive the model re-reads every turn. Well-behaved names
render byte-identically. On by default, no new config knobs.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 11:21:29 +00:00
MervinPraison dd4cfc34c8 docs: auto-update documentation parity trackers [skip ci] 2026-07-23 11:17:03 +00:00
praisonai-triage-agent[bot] fc2ddbf085 Merge pull request #3315 from MervinPraison/claude/issue-3313-20260723-1021
fix: neutralise untrusted platform metadata in prompt attribution
2026-07-23 11:16:29 +00:00
praisonai-triage-agent[bot] 19e8a96ed3 Merge pull request #3314 from MervinPraison/claude/issue-3310-20260723-1021
fix: route bare prompts through the modern Typer run engine
2026-07-23 11:10:38 +00:00
praisonai-triage-agent[bot]andMervin Praison 6285d02f8e fix: wire callback payload store through Telegram render + registry (#3312)
The durable-reference encoding for long interactive reply/select values only
took effect when a shared store was explicitly passed in tests; every
production renderer/registry used the no-store default and fell back to the
unrecoverable hash. This shares one InMemoryCallbackPayloadStore between the
Telegram render side (render_presentation -> adapt_presentation) and the inbound
registry so long values round-trip losslessly past the 64-byte callback cap.

- create_registry(store=): thread an optional store into the InteractiveRegistry
- TelegramPresentationRenderer.render(callback_store=): pass store to adapt
- TelegramBot: construct one shared store, inject into registry + render
- add regression test asserting production render+dispatch round-trip

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:44:29 +00:00
praisonai-triage-agent[bot]andMervin Praison 4c2560547e fix(serve): restore named-agent selection + decouple per-request generator
- POST /agents/{agent_name} now dispatches to the requested registered agent
  and returns 404 for an unknown name, instead of silently running the whole
  YAML workflow (fixes named-agent regression flagged in review).
- Both routes build a lightweight per-request AgentsGenerator that borrows the
  cached generator's shared adapter, tool-timeout pool and resolver while owning
  its own cli_config, so concurrent requests overlap without a run-length lock.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:42:16 +00:00
praisonai-triage-agent[bot]andMervin Praison d69067f60e fix: parameter hints reach model + MCP tools participate in repair/inventory
Addresses two P1 review findings on the tool self-repair path:
- Fold the bind-failure parameter schema into the error string so it survives
  conversion to ToolExecutionError (which keeps only the message) and reaches
  the model.
- Expand MCP instances into their contained tools via a shared
  _iter_active_named_tools() helper so MCP tool names participate in
  case/separator repair and appear in the corrective inventory instead of an
  empty/opaque container.

Adds 3 tests (public-path param hint, MCP inventory, MCP name repair).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:32:47 +00:00
praisonai-triage-agent[bot]andMervin Praison fe66d6935c fix: harden fallback + small-bounds in metadata neutralisation (PR #3315)
Address reviewer feedback on the prompt-injection defence:

- Greptile P1 (security): the bot's _attribute() fallback (taken when the
  core helper import fails on an older praisonaiagents still allowed by the
  >=1.6.152 range) only replaced CR/LF, leaking control chars and oversized
  display names into every shared-chat prompt. It now mirrors the core
  helper: collapse newlines, strip control chars, collapse whitespace and
  length-bound to 240 — byte-identical to neutralize_untrusted_text.
- Greptile P2: neutralize_untrusted_text with max_chars<=3 returned the
  3-char "..." string, exceeding the advertised bound. Small bounds now
  truncate hard so len(out) <= max_chars always holds.
- Tests: add small-bounds regression (core) and a fallback-path hostile-name
  regression that forces the helper import to fail (bot).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:30:48 +00:00
praisonai-triage-agent[bot]andMervin Praison 377b06c1f4 fix: join multi-token bare prompts into single run argument
An unquoted bare prompt (praisonai build a weather agent) arrives as
multiple argv tokens, but the modern `run` command takes a single
positional target. Join the flag-free tokens into one argument so the
whole prompt reaches `run` intact instead of Typer rejecting the extra
positionals. Addresses Greptile P1 (multi-token prompt).

Also adds a regression test pinning that flagless operational commands
(serve/call/realtime/debug/lsp/diag) stay Typer commands and are never
misrouted to `run` as prompts (Greptile P1 #2 was a false positive).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:30:43 +00:00
praisonai-triage-agent[bot]andMervinPraison f3b75f5fa7 fix: round-trip long interactive select/reply values via durable callback store (fixes #3312)
Interactive reply/select values that exceed a channel's callback byte-cap
(e.g. Telegram's 64-byte limit) were hashed with no way to recover the
original value, so long option values (URLs, file paths, free-text) made
menus silently non-functional. This generalises the durable-reference
pattern already used by approvals to ordinary interactive callbacks.

- Add CallbackPayloadStoreProtocol (peer of ApprovalStoreProtocol) plus a
  bounded, zero-dependency InMemoryCallbackPayloadStore default in core.
- Encoders persist an overflowing value under a short reference and emit
  reply:@<ref> / select:<action_id>:@<ref>; inline values are unchanged.
- InteractiveRegistry(store=...) resolves @<ref> back to the exact value on
  dispatch, preserving the select action_id prefix, and fails closed on an
  unknown/expired reference. Without a store the prior hash behaviour is kept.

Additive and backward compatible: adapt_presentation gains an optional
callback_store kwarg; registry gains an optional store arg.

Co-authored-by: MervinPraison <[email protected]>
2026-07-23 10:28:22 +00:00
praisonai-triage-agent[bot]andMervin Praison f00e3ba60a fix: harden praisonai serve agents (auth, generator caching, route convergence) (fixes #3308)
- Refuse non-localhost bind without --api-key/PRAISONAI_SERVE_API_KEY,
  mirroring jobs/server.py policy (POST /agents can run YAML-defined tools).
- Cache one AgentsGenerator per app via FastAPI lifespan instead of rebuilding
  it (YAML re-parse, registry re-resolve, fresh 32-worker pool) per request;
  serialise the shared cli_config with an asyncio.Lock and close() on shutdown.
- Converge /agents and /agents/{agent_name} on the same generator path so both
  apply identical YAML lowering (ToolResolver, tool_timeout, approval,
  guardrails, retry) instead of the safety-stripped hand-rolled PraisonAgent.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:25:45 +00:00
praisonai-triage-agent[bot]andMervinPraison 53f3449abe fix: surface retry/backoff as a stream event so CLI waits aren't mistaken for a hang (fixes #3311)
Add StreamEventType.RETRY and emit it alongside the existing ON_RETRY hook in both the sync and async retry loops (guarded by has_callbacks, so it stays zero-overhead when no consumer is attached). The event carries attempt, max_attempts, delay and reason in metadata.

The CLI stream-event bridge maps it to a canonical run.retry NDJSON event so consumers can render a live 'retrying in Ns (attempt k/N)' status instead of a silent, hung-looking terminal. Non-JSON/silent modes stay silent.

Co-authored-by: MervinPraison <[email protected]>
2026-07-23 10:25:32 +00:00
praisonai-triage-agent[bot]andMervin Praison bcb62c832c fix: self-repair and actionable feedback on unknown tool calls (fixes #3309)
When the LLM emits an unresolvable tool call, the runtime now:
- attempts a deterministic self-repair by normalising case/separator drift
  (e.g. 'WebSearch' -> 'web_search') against the agent's active tools;
- otherwise returns a corrective, model-readable error naming the nearest
  valid tool and listing the currently available tools;
- on argument-bind failure, echoes the tool's required/optional parameters.

Reuses existing dispatch path; no new public API or Agent params.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:24:52 +00:00
praisonai-triage-agent[bot]andMervin Praison 423144d43c fix: neutralise untrusted platform metadata in prompt attribution (fixes #3313)
Add a pure-stdlib core helper neutralize_untrusted_text() in
praisonaiagents.session.context and apply it by default to the sender
display name in the bot's _attribute() prefix. Collapsing newlines/control
chars and bounding length stops a hostile group display name / title from
masquerading as a fake heading or system directive in the per-turn prompt,
while well-behaved names render byte-identically. Safe-by-default; no new
config knobs.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-23 10:24:19 +00:00
praisonai-triage-agent[bot]andMervinPraison 82f55c97b0 fix: route bare prompts through the modern Typer run engine (fixes #3310)
A bare free-text prompt (`praisonai "do something"`) now forwards to the
same modern `run` path as `praisonai run`, inheriting session continuity,
--output modes, the credential gate and permissions. `.yaml` workflows and
flag-bearing legacy invocations remain on the legacy dispatcher.

Co-authored-by: MervinPraison <[email protected]>
2026-07-23 10:24:08 +00:00
praisonai-triage-agent[bot] 7494bbadc9 Merge pull request #3306 from MervinPraison/feat/praisonai-train-gen-guard
feat(data): in-loop cost/sponsorship guard + per-row provenance stamping
2026-07-22 17:50:43 +00:00
praisonai-triage-agent[bot] 362aba4619 Merge pull request #3305 from MervinPraison/claude/issue-3304-20260722-1603
fix: async-safe serve/jobs hot paths + scheduler thread-leak
2026-07-22 17:13:56 +00:00
praisonai-triage-agent[bot]andMervin Praison 1a64808cd1 fix(train/data): emit guard trigger row + harden check interval
Address reviewer feedback on the in-loop continuation guard:
- Emit the just-completed (paid) row before the guard halts, so the
  request that trips the sponsorship check is no longer silently dropped.
- Coerce sponsor_check_rows to a safe minimum of 1 so a 0 (divide-by-zero)
  or negative (never-poll, guard disabled) value cannot break/disable the
  safety check; unset preserves the 5000 default.

Adds tests for trigger-row emission and invalid-interval handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 17:02:12 +00:00
MervinPraisonandClaude Opus 4.8 e363f3a43d feat(data): in-loop continuation guard + per-row provenance stamping
Two additive, backward-compatible features for the synthetic-data generator.

1. In-generator continuation guard. generate_dataset gains an optional
   should_continue() -> bool callback, re-checked every `sponsor_check_rows`
   completed requests (default 5000). When it returns False the run halts
   cleanly via the existing shutdown path (touch stop-file + cancel pending
   futures + break). If no callback is passed but `subscription_id` (or env
   AZ_SUBSCRIPTION) is set, a built-in Azure sponsorship check is wired in
   (quotaId == "Sponsored_2016-01-01"). The guard fails OPEN on transient
   errors — an external watchdog is the hard fail-closed guard; this is
   belt-and-suspenders. New public helper: azure_sponsorship_guard().

2. Per-row provenance stamping. Emitted rows are now self-describing: _call
   stamps `model` (deployment) and passes through `task_type`/`topic` from the
   prompt spec when present. The axis recipe stamps task_type/topic onto each
   spec, so QC (which already reads r["task_type"]) and downstream category
   splits key off metadata instead of brittle text. Keys are added only when a
   value is available (backward-compatible).

Tests (network stubbed): the guard halts after N rows when the predicate turns
False and never halts while True; rows carry model/task_type/topic when
provided and omit task_type/topic when absent; plus fail-open and
subscription-id wiring.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-22 17:54:20 +01:00
praisonai-triage-agent[bot]andMervin Praison ba1dfe413e fix: thread caller prompt/query into serve+jobs workflow input (fixes #3304 P1)
The switch to praisonai.arun() dropped the caller's required input on the
native jobs path (job.prompt) and the serve /agents fallback (query), since
arun has no prompt param and the workflow topic is read from YAML input/topic
only. Honour input/topic overrides in AgentsGenerator._merge_cli_config
(reusing the existing merge seam, no new params/exports) and pass
job.prompt / query through cli_config so per-run input drives the workflow
instead of being silently discarded. Static YAML input is preserved when no
prompt is supplied.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 16:14:58 +00:00
praisonai-triage-agent[bot]andMervinPraison ba08895393 fix: async-safe serve/jobs hot paths + scheduler thread-leak (fixes #3304)
- serve.py: route the crew fallback through praisonai.arun (owns the
  AgentsGenerator lifecycle, runs off the event loop) and replace
  asyncio.get_event_loop() with asyncio.to_thread in both agent handlers.
- jobs/executor.py: _run_praisonai_agents now delegates to praisonai.arun
  so the caller's agent_file/agent_yaml/framework/config are honoured
  instead of silently dropped by a stock Agent.
- scheduler/agent_scheduler.py: reuse an instance-owned ThreadPoolExecutor
  with leak accounting and recycling (mirrors AgentsGenerator), unify the
  timeout branch into the backoff path, and close() the pool on stop().

Co-authored-by: MervinPraison <[email protected]>
2026-07-22 16:07:17 +00:00
praisonai-triage-agent[bot] 4aa4480051 Merge pull request #3303 from MervinPraison/feat/praisonai-train-dedup
feat(train/data): scalable MinHash+LSH near-dedup + cross-file global dedup
2026-07-22 15:57:03 +00:00
praisonai-triage-agent[bot]andMervin Praison fef83097b8 fix(train/data): correct dedup edge cases from review
- reuse a supplied empty shared MinHashLSH index (is not None, not `or`)
  so cross-batch near-dedup works on the first call
- treat empty MinHash signatures as non-similar (0.0) and reject
  minhash_perm/ngram_n < 1, so degenerate config can't collapse a dataset
- global_dedup honours near_dup_method='sliding' and raises a clear
  FileNotFoundError for missing paths instead of a cryptic AttributeError
- sliding look-back treats window<=0 as intentional unbounded
- dedup CLI writes to a temp file + atomic replace, so an --out that
  aliases an input is never truncated and a malformed line never leaves
  a partial output

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 15:10:04 +00:00
MervinPraisonandClaude Opus 4.8 4910fa9d23 feat(train/data): scalable MinHash+LSH near-dedup + cross-file global dedup
The QC near-dup pass was O(n·3000) sliding-window char-4gram Jaccard, which is
both slow at scale and structurally blind to near-duplicates more than 3000 rows
apart — and score() rebuilds its dedup state per call, so it cannot remove dups
that span multiple batch files (the common case when merging parallel runs).

Add praisonai_train.data.dedup (pure stdlib, no datasketch/numpy):
- MinHasher / MinHashLSH: seeded, deterministic MinHash signatures over the same
  normalized char-4gram shingles the sliding engine uses (so near_dup_jaccard
  keeps identical semantics), with LSH banding for sub-linear candidate lookup
  and no bounded look-back window.
- near_dedup(rows, cfg): one interface, YAML-tunable near_dup_method
  ("sliding" default = unchanged, or "minhash"). qc.score() now delegates to it
  (DRY); default path behaviour is byte-for-byte the same. near_dup_window is now
  configurable too.
- global_dedup(sources, cfg): dedup ACROSS many JSONL files / row-lists with ONE
  shared exact+LSH index — what per-file score() cannot do.
- CLI: `praisonai-train dedup batch_*.jsonl --out merged.jsonl`.

Backward compatible: no new deps, default engine and outputs unchanged; MinHash
and cross-file dedup are opt-in.

Tests: 13 new (deterministic) — MinHash catches a far near-dup the window misses,
preserves genuinely-distinct rows, cross-file exact+near removal, exact-only, and
default-still-sliding. Full data suite 60 passed.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-22 16:02:01 +01:00
praisonai-triage-agent[bot] 6646dcc0cb Merge pull request #3302 from MervinPraison/feat/praisonai-train-benchmark
feat(praisonai-train): speed-benchmark SDK feature + CLI
2026-07-22 14:47:26 +00:00
MervinPraison 70fddb587d docs: auto-update documentation parity trackers [skip ci] 2026-07-22 14:38:18 +00:00
praisonai-triage-agent[bot] 2f3d9bda70 Merge pull request #3301 from MervinPraison/claude/issue-3297-20260722-1323
fix: close the loop on permanently-undelivered gateway replies
2026-07-22 14:37:46 +00:00
praisonai-triage-agent[bot] 23ebb6ee13 Merge pull request #3300 from MervinPraison/claude/issue-3298-20260722-1323
fix: coalesce inbound media albums into a single agent turn
2026-07-22 14:32:34 +00:00
MervinPraison c82d4ab033 docs: auto-update feature parity trackers [skip ci] 2026-07-22 14:32:16 +00:00
praisonai-triage-agent[bot] 883e8c5c71 Merge pull request #3299 from MervinPraison/claude/issue-3296-20260722-1322
fix: surface turn-completion reason to gateway users
2026-07-22 14:31:50 +00:00
praisonai-triage-agent[bot]andMervin Praison 9e476750eb fix(praisonai-train): benchmark metric consistency, JSON-mode toggle, input validation
- Count completion tokens only for successful (ok) responses so token
  throughput and avg_out_tok stay consistent with the success count.
- Thread a json_mode flag through _timed_call/_measure_target/
  benchmark_deployments and expose --json-mode/--no-json-mode + yaml key,
  so OpenAI-compatible endpoints without JSON mode aren't ranked as failures.
- Validate prompt dicts (require non-empty 'user') and reject n<1 /
  concurrency<1 with a clear ValueError instead of KeyError / silent
  zero-request runs miscounted as endpoint failures.
- Add 4 tests; existing stubs updated for the new json_mode arg. 102 passed.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 13:43:38 +00:00
MervinPraisonandClaude Opus 4.8 148880c88b feat(praisonai-train): add speed-benchmark SDK feature + CLI
Add a first-class, protocol-driven speed benchmark to the praisonai-train
data SDK, mirroring the generate/validate idiom. It sends N identical
requests per deployment at a fixed concurrency and reports throughput
(rows/min, completion-tokens/sec), latency (avg/p50/p95), success count
and average output tokens, then ranks deployments fastest-first.

DRY: extract the generator's HTTP call path into shared helpers
(`build_chat_request`, `resolve_cfg`) so benchmarking reuses the exact
same Azure/OpenAI-compatible request construction and credential
resolution as real generation — no duplicated HTTP code. The default
prompt reuses a registered Recipe so benchmarks reflect the real workload.

- data/benchmark.py: `benchmark_deployments(...) -> list[BenchResult]`,
  pure `aggregate()`, and network confined to a `_timed_call` seam.
- cli/commands/benchmark.py: `praisonai-train benchmark` (YAML/flags),
  ranked table + JSON output.
- setup/benchmark.yaml: documented sample config.
- tests: aggregation math, ranking, success/failure counting, real
  threaded path, per-target endpoint override (network stubbed).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-22 13:43:38 +00:00
praisonai-triage-agent[bot] 3601fba539 Merge pull request #3294 from MervinPraison/feat/praisonai-train-taskaware-qc
feat(train/data): task-aware script purity + translation-share metric
2026-07-22 13:40:49 +00:00
praisonai-triage-agent[bot]andMervin Praison 62f7fa599e fix: wire gateway.notify_on_undelivered opt-in end-to-end (#3297)
The documented gateway.notify_on_undelivered / undelivered_template YAML
opt-in was a dead path: GatewayServerSchema (extra="forbid") rejected the
keys at load time, and neither start_with_config nor from_config_file
propagated them onto self.config, so the delivery router's getattr always
saw the OFF default.

- Accept both keys in GatewayServerSchema (kept optional, lightweight).
- Stamp them onto self.config in start_with_config (primary CLI path) and
  from_config_file, honouring the "no new core GatewayConfig field" design.
- Add a regression test covering schema acceptance + propagation.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 13:40:47 +00:00
praisonai-triage-agent[bot]andMervin Praison 705e848154 fix: wire gateway to surface turn-completion note (fixes #3296)
Connect the previously-inert completion path (Greptile P1): BotSessionManager
now reads the agent's last_stop_reason after each turn and, when the new opt-in
surface_completion_reason flag is set, appends a concise user-safe note for
early stops (max_steps / cancelled / error). Off by default so clean
completions and existing deployments are unchanged.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 13:38:35 +00:00
praisonai-triage-agent[bot]andMervin Praison e1527911af fix: reclaim orphaned album temp files on owner cancellation (#3298)
Address greptile P1 review feedback on the inbound media-album coalescer:
when the owning Telegram update is cancelled (e.g. during shutdown) after
sibling updates already folded their media in, the buffered temp files could
leak. Add an on_orphan cleanup hook invoked whenever a flushed album has no
live owner awaiting it, wired to a shared _remove_inbound_media helper in the
Telegram bot. Also clarify the max_items cap semantics (bounded, intentional).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 13:37:13 +00:00
praisonai-triage-agent[bot]andMervinPraison d6c846c058 fix: close the loop on permanently-undelivered gateway replies (fixes #3297)
On a confirmed-permanent outbound failure the reply was parked in the DLQ /
the target marked dead but the user heard nothing. Add an opt-in last-resort
notice: a short plain-text delivery-failure message on the same channel plus a
MESSAGE_UNDELIVERED lifecycle hook so operators can route the failure.

Core (protocol only): add HookEvent.MESSAGE_UNDELIVERED and
MessageUndeliveredInput. Wrapper (praisonai-bot): DeliveryRouter fires the hook
and best-effort sends the notice on permanent failure; default OFF, wired from
gateway.notify_on_undelivered.

Co-authored-by: MervinPraison <[email protected]>
2026-07-22 13:29:17 +00:00
praisonai-triage-agent[bot]andMervinPraison 9067531313 fix: coalesce inbound media albums into a single agent turn (fixes #3298)
Telegram delivers a media album (multiple photos/files sent together) as N
separate updates sharing one media_group_id, so the agent saw each part as
its own turn. Add an AlbumCoalescer that buffers media parts by group key
and flushes them as one multimodal turn, mirroring the existing
InboundDebouncer text pattern.

- New praisonai_bot/bots/_album.py: bounded per-group buffer (window +
  max_items), operator-tunable via config.metadata (media_group_window_ms /
  media_group_max), disabled by default so behaviour is unchanged.
- Wire into TelegramBot.handle_message (sibling updates fold into one turn)
  and flush pending buffers on stop().
- Tests in tests/unit/test_bot_album.py.

Co-authored-by: MervinPraison <[email protected]>
2026-07-22 13:27:36 +00:00
praisonai-triage-agent[bot]andMervinPraison b2627dd8b9 fix: surface turn-completion reason to gateway users (fixes #3296)
Add an optional, backward-compatible TurnCompletion contract to the bot
reply path so a chat user learns *why* a turn stopped early instead of
seeing a silently truncated/empty reply.

- TurnCompletion wraps the existing coarse Agent.last_stop_reason
  (completed | max_steps | cancelled | error) into a portable value with
  a user-safe, localisable .note(); completed turns surface nothing.
- AgentReply gains an optional `completion` field (defaults None).
- extract_completion() reads it off any result (incl. a bare Agent via
  last_stop_reason); append_completion_note() lets a gateway optionally
  append the note, off by default so existing deployments are unchanged.

Reuses the existing runtime stop reason rather than adding new detection
or Agent params — no new module, no wrapper knobs.

Co-authored-by: MervinPraison <[email protected]>
2026-07-22 13:26:40 +00:00
MervinPraison 6aa9f4cb51 docs: auto-update api.md [skip ci] 2026-07-22 13:25:43 +00:00
Mervin Praison f70a9c8a09 Merge pull request #3285 from Dhivya-Bharathy/fix/e2e-examples-batch2
fix: batch-2 E2E example failures (workflow results, imports, skip stale examples)
2026-07-22 14:25:17 +01:00
Mervin Praison 9cd15b2e99 Merge pull request #3295 from MervinPraison/feat/praisonai-train-gen-progress
feat(praisonai-train): optional progress_callback for synthetic-data generation
2026-07-22 14:24:12 +01:00
praisonai-triage-agent[bot]andMervin Praison 589b20afed fix(praisonai-train): report progress kept after yield so it never leads emitted rows
Move progress_callback below the yield in generate_dataset so 'kept' reflects
rows the consumer has actually received (Greptile P1). Docstring clarified.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 13:18:03 +00:00
MervinPraisonandClaude Opus 4.8 a21e825300 feat(praisonai-train): optional progress_callback for synthetic-data generation
generate_dataset() gains an optional progress_callback(done, total, kept)
invoked as teacher requests complete, so a CLI/monitor/notebook can show
completion and remaining work. Backward compatible: default None keeps the
original behaviour (no callback). Fires once up-front with (0, total, 0) then
after each completed request; done is monotonic up to total, kept counts unique
rows emitted.

The `generate` CLI command wires a default reporter (_Progress): a tqdm bar when
tqdm is importable, else throttled done/total prints. tqdm stays optional — the
import is guarded and never becomes a hard dependency.

Adds unit tests asserting the callback fires with monotonic done up to total,
that kept tracks dedup, and that the default (no callback) path is unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-22 14:12:23 +01:00
praisonai-triage-agent[bot]andMervin Praison 903d1c6d31 fix(train/data): correct unknown-metadata fallback + exemption-count semantics
- intent.translation_intent: an unrecognised non-empty task_type no longer
  short-circuits to non-translation; it falls through to the documented text
  fallback so an explicit "translate into English" instruction is honoured and
  its English output is not dropped as low_script_purity (greptile P1).
- qc.score: the translation `exempted` metric now counts only rows the
  English-target exemption ACTUALLY rescued from LowScriptPurity (task-awareness
  on AND output below the purity floor), so it reconciles with check behaviour
  instead of over-counting failed translations and task_aware_purity=false runs
  (greptile P1).
- Add 4 regression tests (29 passed total).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 12:28:12 +00:00
MervinPraisonandClaude Opus 4.8 c86780a911 feat(train/data): task-aware script purity + translation-share metric
Add two dataset-QC features to the praisonai-train data SDK, wired in the
SDK's protocol-driven idiom (registered RowChecks + a corpus metric) and
sharing ONE translation-intent detector so they can never disagree (DRY).

1. Task-aware script purity: the script-purity checks no longer delete an
   output that is legitimately in another script because the instruction
   asked to translate INTO that language (e.g. a Tamil->English row's
   correct output is English). LowScriptPurity/ScriptReview now exempt a
   resolved English-target row; a new WrongTargetScript flag catches the
   inverse failure (asked for English, output still Tamil). Only a resolved
   English target exempts — en->ta / ambiguous / native rows stay strict.

2. Translation-share corpus metric: metrics.translation reports the fraction
   of kept rows that are translation tasks, by direction (en_ta/ta_en/unknown)
   and an exempted count, computed with the SAME detector so it reconciles
   with the per-row exemptions.

New single source of truth: data/intent.translation_intent(); metadata
(task_type) is authoritative, instruction-text detection is the external-row
fallback, ambiguous direction yields no exemption (safe default).

17 new unit tests (mirroring the modeltrain reference); full data suite green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-22 13:21:36 +01:00
Leebana efda323b78 Merge pull request #3287 from MervinPraison/feat/praisonai-train-data-sdk
praisonai-train: protocol-driven data SDK — generate + validate (YAML-driven)
2026-07-22 12:09:36 +01:00
Leebana 0621bb878d Merge pull request #3292 from MervinPraison/fix/claude-triage-bug-before-howto
fix: triage bug reports before "how to" question label
2026-07-22 12:09:03 +01:00
Leebana 81f95686d4 Merge pull request #3291 from MervinPraison/claude/issue-3244-20260722-1032
fix: never load profile legacy .praison/config.toml as project source
2026-07-22 12:08:05 +01:00
Leebana 25653af0ea Merge pull request #3290 from MervinPraison/claude/issue-3280-20260722-1032
fix: remove nonexistent self.env from terminal_bench adapters
2026-07-22 12:06:07 +01:00
praisonai-triage-agent[bot]andMervin Praison 52c729d4c6 fix: exclude [question] titles from bug label to prevent false auto-claude
Addresses Greptile P1: an issue such as '[QUESTION] How do I handle this
API error?' matched 'error' before the question marker was checked,
receiving 'bug' + auto 'claude'. Guard bug detection on \!title.includes('[question]').

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 11:05:56 +00:00
Leebana a6f680eeb3 Merge pull request #3289 from MervinPraison/claude/issue-3282-20260722-1032
fix: pass required logs_dir to external agent integration tests
2026-07-22 12:05:37 +01:00
Leebana ef3a64751a Merge pull request #3288 from MervinPraison/claude/issue-3281-20260722-1032
fix: make test_code_agent_command_shape compatible with Harbor pipefail wrapper
2026-07-22 12:04:48 +01:00
MervinPraison 65f8903d60 fix: triage bug reports before "how to" question label
Bug issues with a "## How to fix" section were labelled question first,
which blocked autoClaude. Check bug/error/crash before how-to heuristics,
ignore "how to fix" for question detection, and let bug label win over
a stale question label for auto-triage.
2026-07-22 12:02:34 +01:00
praisonai-triage-agent[bot]andMervin Praison 74bbe562c0 fix(praisonai-train): address data SDK review bugs (dedup, chat pairing, safe output, validate robustness)
- qc: include output in exact-dedup key so distinct answers to the same
  prompt are not silently dropped
- _util.fields: pair the final assistant turn with the user turn that
  precedes it (never a trailing unanswered user turn)
- cli generate: forward --snapshot-every override; defer output truncation
  until the first row is produced (a failed run no longer destroys an
  existing file / self-referential dedup source); exit non-zero when 0 rows
  are generated instead of reporting empty success
- cli validate: skip malformed JSONL lines (with line numbers) instead of
  aborting the whole run
- generate: configurable request_timeout; accurate stop-file docstring
- tests: cover distinct-answer dedup and multi-turn chat pairing

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:40:22 +00:00
praisonai-triage-agent[bot]andMervin Praison dfaa319895 fix: strip Harbor pipefail prefix then assert command start (Greptile P2)
Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:37:36 +00:00
praisonai-triage-agent[bot]andMervin Praison ba679a1ca3 fix: never load profile legacy .praison/config.toml as project source (fixes #3244)
Remove the legacy `.praison/config.toml` from PROJECT_CONFIG_NAMES so the
walk-up discovery never mislabels a profile-level legacy global config as a
`project:` source. The legacy file is owned exclusively by
_load_global_config() with a `global:` label. Removes the now-dead
search_dir == home skip guard and adds a regression test.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:35:16 +00:00
praisonai-triage-agent[bot]andMervin Praison 2d915a3151 fix: pass required logs_dir to external agent integration tests (fixes #3282)
Harbor 0.20's BaseAgent.__init__ requires logs_dir as first positional
arg. The TestPraisonAIExternalAgent tests constructed the agent with zero
args, causing a TypeError. Pass logs_dir via pytest tmp_path to match the
existing pattern used by TestPraisonAICodeAgent and TestPraisonAIInstalledAgent.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:33:59 +00:00
praisonai-triage-agent[bot]andMervin Praison a7dcfe3a5d fix: remove nonexistent self.env from terminal_bench adapters (fixes #3280)
Harbor 0.20 agents expose extra_env (wired into the container exec
context by Trial), not self.env. Passing env=self.env crashed
PraisonAICodeAgent.run() with AttributeError. Omit the per-exec env=
so Harbor's trial-scoped injection applies. Same fix applied to
praisonai_installed_agent.py.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:33:52 +00:00
praisonai-triage-agent[bot]andMervin Praison 99b5193260 fix: make test_code_agent_command_shape compatible with Harbor pipefail wrapper (fixes #3281)
Harbor's BaseInstalledAgent._exec always prefixes commands with
'set -o pipefail; ', so the .startswith assertion failed even when the
adapter command was correct. Switch to a substring match.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:33:42 +00:00
MervinPraisonandClaude Fable 5 fe2f08fcbc praisonai-train: add protocol-driven data SDK (generate + validate), YAML-driven
Adds dataset tooling to praisonai-train, following the SDK principles (protocol-
driven, DRY, extendable, YAML-configurable):

- praisonai_train/data/: registry + protocols (Recipe, RowCheck) + pluggable
  recipes (tamil, extendable) and QC checks (dedup, boilerplate/refusal, script
  purity, truncation, restates-question) + shared helpers. Add a language/domain
  or a QC rule by registering one class — the CLI picks it up automatically.
- generate: teacher-LLM synthetic generation (Azure OpenAI / OpenAI-compatible),
  JSON mode for high yield, diversity axes so large runs don't collapse,
  start_offset for disjoint parallel workers, dedup-on-write, incremental
  snapshots, and a stop-file circuit-breaker (halts instantly, e.g. on a billing
  guard). Stdlib HTTP, no new deps.
- validate: research-backed QC (LIMA/AlpaGasus/Deita/Self-Instruct thresholds) —
  exact + near-dedup, per-row drop/flag checks, and diversity metrics (distinct-2,
  length CV, template concentration) with warnings.
- CLI: 'praisonai-train generate --config generate.yaml' and
  'praisonai-train validate data.jsonl --out clean.jsonl'; example YAMLs shipped.
- Tests: tests/unit/data/test_data.py (6 tests). Validated end-to-end live:
  YAML generate -> 19 rows (distinct-2 0.93); validate on 500 real rows kept 81%,
  caught low-purity/near-dup, warned on template concentration.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 11:33:17 +01:00
Mervin Praison 3a7abaea27 Merge pull request #3286 from MervinPraison/fix/praisonai-train-complete
praisonai-train: land auto-resume + reconciliation (missed #3283 merge) + finish P2 hygiene
2026-07-22 11:27:18 +01:00
praisonai-triage-agent[bot]andMervin Praison 6a373d0efa praisonai-train: address final review — boolean PRAISON_DEBUG, checkpoint filtering, GGUF push default, passthrough cadence reconcile
- PRAISON_DEBUG now parsed as a boolean (0/false/no disable it, not just unset)
- auto-resume filters to real numeric checkpoint-* dirs and passes the validated
  path to the trainer (instead of leaving resume=True and re-discovering); also
  accepts 1/yes/on/off spellings before treating a string as a literal path
- push_model_gguf honors quantization_method default (q4_k_m) matching save path
- final save/eval cadence reconciliation after training_arguments passthrough so
  load_best_model_at_end can't reach SFTConfig with mismatched strategies/steps

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 10:10:40 +00:00
MervinPraisonandClaude Fable 5 fa9d6e2cca praisonai-train: restore tokenize_function (public re-export by praisonai.train)
Reverts the removal of tokenize_function — it is imported and re-exported in
praisonai/train.py __all__, so deleting it breaks that public API. Kept it (now
uncalled by the training path but retained for backward compat) and removed only
the internal, unreferenced tokenize_dataset method.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 09:39:32 +01:00
MervinPraisonandClaude Fable 5 70a0ba70a4 praisonai-train: log epochs-vs-max_steps precedence (final P2 item)
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 09:35:58 +01:00
MervinPraisonandClaude Fable 5 ac03570b91 praisonai-train: finish P2 hygiene (dead code, gguf quant, debug noise)
- Remove dead tokenize_function/tokenize_dataset (unused since TRL tokenizes
  internally; used padding='max_length' which would waste compute if ever rewired).
- save_model_gguf now honors config quantization_method (was hardcoded 'q4_k_m',
  inconsistent with push_model_gguf).
- Gate the per-batch DEBUG prints behind PRAISON_DEBUG so normal runs stay readable.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 09:34:49 +01:00
MervinPraison 569e0d7ebc docs: auto-update feature parity trackers [skip ci] 2026-07-22 08:21:19 +00:00
Mervin Praison deef1053df Merge pull request #3284 from Dhivya-Bharathy/fix/e2e-examples-failures
fix: E2E examples failures (Windows timeout, missing modules, broken examples)
2026-07-22 09:20:53 +01:00
Dhivya-BharathyandCursor bc8a39dd29 fix: batch-2 E2E example failures from full audit
- Fix AgentTeam.start() result handling across 22+ workflow/usecase examples

- Fix missing AgentFlow/AgentTeam/AutoAgents imports and registry override demo

- Fix scope_identifiers, state_redis db import, and ToolsMCPServer.run_sse API

- Mark STT and stale tool-import examples as skip until refreshed

- Remove stale db mapping that shadowed praisonaiagents.db submodule

Co-authored-by: Cursor <[email protected]>
2026-07-22 13:34:33 +05:30
MervinPraisonandClaude Fable 5 32d648ce7d praisonai-train: auto-reconcile save_steps/eval_steps for load_best_model_at_end
HF requires save_steps to be a multiple of eval_steps when load_best_model_at_end
is on. A config with save_steps=100, eval_steps=500 (both valid-looking) crashed.
Now the trainer aligns eval_steps to save_steps (preserving the user's checkpoint
frequency) with a warning, instead of erroring out.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 08:12:20 +01:00
MervinPraisonandClaude Fable 5 9e59148167 praisonai-train: crash-safe auto-resume from latest checkpoint
resume_from_checkpoint: true now auto-finds the latest checkpoint in output_dir
and resumes from it; if none exists yet (fresh run) it starts fresh instead of
erroring. So after any crash (OOM, GPU reclaim) you just relaunch the SAME
command and training continues from the last saved step. Validated on GPU:
fresh run -> checkpoint-2/4; relaunch -> resumed from checkpoint-4, continued 5->8.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 08:06:33 +01:00
praisonai-triage-agent[bot]andMervin Praison dd297fe56f fix: C7 boundary, timeout process group, and command cwd in agent tools
- Remove wrapper import from praisonai-code agent_tools.py (C7 gate
  regression): use a module-local _run_sync bridge instead of
  `from praisonai._async_bridge import run_sync` so the Tier-2 package
  no longer depends on the praisonai wrapper at the hot path.
- suite_runner: start child processes with start_new_session=True on
  POSIX so timeout killpg reaps only the child tree, never the runner.
- agent_tools/orchestrator: honor acp_execute_command cwd by forwarding
  it into the plan step; orchestrator validates it stays in workspace.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 06:34:24 +00:00
Dhivya-BharathyandCursor e182b36257 fix: resolve E2E examples failures from platform audit
- Kill Windows subprocess trees on suite-runner timeout (uvicorn hang)

- Restore Agent.launch() shared server globals in execution_mixin

- Add missing praisonai_code.cli.features.agent_tools module

- Fix compression_demo ContextCompressor API usage

- Import AgentFlow in workflow output/routing examples

- Use UTF-8 when parsing doctor ci subprocess output on Windows

- Set BrowserBaseTool __name__ for agent tool schema compatibility

Co-authored-by: Cursor <[email protected]>
2026-07-22 12:00:25 +05:30
praisonai-triage-agent[bot] 8a6097c584 Merge pull request #3283 from MervinPraison/fix/praisonai-train-flexibility
praisonai-train: multi-GPU (DDP), checkpointing/resume, eval, and full training flexibility
2026-07-22 06:19:54 +00:00
MervinPraisonandClaude Fable 5 bcd6e64a61 praisonai-train: default ddp_find_unused_parameters=True for multimodal/MoE models
Gemma 4 E4B (and other multimodal/MoE/elastic models) have LoRA-adapted params
that don't fire every step (vision/audio towers in text-only training), which
crashes DDP with 'Expected to have finished reduction' when find_unused=False.
Default True works universally; set false for a small speedup on dense-text models.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 06:26:51 +01:00
praisonai-triage-agent[bot]andMervin Praison 52a9c48fed fix(praisonai-train): resolve 4 P1 DDP/full-FT/reload/early-stop bugs
- Set UNSLOTH_USE_NEW_MODEL before unsloth import (DDP non-reentrant path)
- Skip LoRA when full_finetuning: true (train base weights directly)
- Reload model with trained precision (dtype/8bit/full_finetuning), not 4bit-only
- Re-align save/eval strategy when early stopping enables load_best_model_at_end

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-22 05:20:23 +00:00
MervinPraisonandClaude Fable 5 4069b585cc praisonai-train: guard final save + HF/Ollama publish to rank 0 under DDP
Only the main process merges/pushes and writes the final adapter, so multi-GPU
runs don't race to write the same repo/dir.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 06:14:54 +01:00
MervinPraisonandClaude Fable 5 5c38677af1 praisonai-train: multi-GPU (DDP), checkpointing/resume, eval, and full flexibility
Validated end-to-end on 2x A6000 (unsloth 2026.7.4 / trl 0.24 / torch 2.10):
multi-GPU DDP trains (Data Parallel GPUs = 2, no 'marked ready twice'),
checkpointing + eval + best-model + final_model_dir all work.

Multi-GPU (DDP):
- Detect distributed (LOCAL_RANK/WORLD_SIZE); load full model per-rank
  (device_map={'':local_rank}); set UNSLOTH_USE_NEW_MODEL=1 under DDP to force
  Unsloth's non-reentrant checkpointing (the legacy path hard-codes reentrant,
  which double-fires autograd hooks and crashes DDP). Set ddp_find_unused_parameters
  =False (LoRA freezes the base). Launch: torchrun --nproc_per_node=N.

Checkpointing / resume:
- Config-driven save_strategy/save_steps/save_total_limit (was only under an env var);
  resume_from_checkpoint (bool=latest, or a path); final_model_dir (fixes the old
  lora_model vs output_dir mismatch that broke load_model).

Evaluation / early stopping:
- val_split_ratio carves an eval set; eval_strategy/eval_steps/load_best_model_at_end/
  metric_for_best_model; EarlyStoppingCallback via early_stopping_patience.

Flexibility:
- Generic training_arguments passthrough (any raw SFTConfig field), auto-filtered to
  what the installed TRL accepts (version-proof; e.g. save_safetensors/group_by_length
  differ by version) — warns instead of crashing.
- Knobs: max_grad_norm, warmup_ratio, neftune_noise_alpha, dataloader_num_workers,
  data_seed, adam betas, report_to/run_name (config, not just env), push_to_hub.
- Quantization: load_in_8bit, dtype, full_finetuning. LoRA: modules_to_save,
  rank_pattern, alpha_pattern, use_dora. Data: local files, shuffle, rename, filter.

Correctness fixes:
- load_in_4bit KeyError when omitted; inference().to(cuda) -> self.device;
  drop empty-formatted rows instead of silently training on blanks.

All new keys optional with prior defaults; existing configs unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 06:12:38 +01:00
praisonai-triage-agent[bot] 7367c5877d Merge pull request #3279 from MervinPraison/fix/praisonai-train-beginner-dx
praisonai-train: safe-by-default DX for beginners & agents (auto masking, no surprise pushes)
2026-07-21 17:47:22 +00:00
praisonai-triage-agent[bot]andMervin Praison 7223f7875b fix(train): guard publishing when train:false; frozenset KNOWN_KEYS
- Skip publishing (return early) when train:false leaves self.model None,
  preventing an AttributeError on the merged/gguf push path.
- Make KNOWN_KEYS a frozenset to prevent accidental class-state mutation.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 17:15:24 +00:00
praisonai-triage-agent[bot]andMervin Praison 4c3c6b774e fix(train): validate num_samples & publish targets; fix stale interactive-tools union test
- num_samples: reject 0/negative/bool/non-int and honor explicit values (fail
  fast with a clear message instead of silently training the full set or
  crashing mid-run).
- Publishing: fail fast in validate_config when huggingface_save /
  huggingface_save_gguf / ollama_save is enabled without its target name,
  instead of silently skipping the requested upload after a long run.
- Fix pre-existing CI failure: test_interactive_group_is_union was stale after
  the `search` tool group was wired into the interactive default set (#3254);
  add TOOL_GROUPS["search"] to the expected union.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 17:12:04 +00:00
praisonai-triage-agent[bot] 33ccfc76e0 Merge pull request #3248 from MervinPraison/claude/issue-3246-20260721-0648
fix: Typer Literal sandbox type + missing usage help category (#3246)
2026-07-21 17:05:44 +00:00
MervinPraisonandClaude Fable 5 cc7f086835 praisonai-train: make it just-work for beginners & agents (safe defaults)
Validated end-to-end on GPU (2x A6000, unsloth 2026.7.4 / trl 0.24.0).

- Response masking: assistant_only_loss now tri-state with default "auto" — a
  live probe checks whether the model's chat template actually supports assistant
  masking and enables it only when safe, else full-sequence SFT. Prevents TRL's
  cryptic RuntimeError on stock Qwen/Gemma/Llama templates (they lack the
  {% generation %} markers). Explicit true on an unsupported template now fails
  fast with a clear message. 'train_on_responses_only' accepted as an alias.
- Publishing defaults OFF and is gated on a target name being set — a plain
  'train locally' config finishes with the LoRA saved to lora_model/ instead of
  crashing after training on a missing/foreign hf_model_name.
- Config flags accept real YAML booleans (train: true) not just strings, via a
  _flag() coercion helper (no more AttributeError on .lower()).
- Honor dataset num_samples (was advertised but silently ignored).
- validate_config(): clear error on missing required keys, warn on unknown keys
  (typo/unsupported) so nothing is silently dropped — friendlier for agents.
- 'model' accepted as an alias for 'model_name' (matches --model flag).
- One concise run-summary block (model / examples / masking mode / steps / output).
- Align license to SPDX "MIT" + setuptools>=77 (matches main).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-21 18:04:37 +01:00
MervinPraisonandClaude Fable 5 796f06ff72 Fix publish pipeline: SPDX license, setuptools>=77, resilient uv lock
- pyproject (train + bot): license = "MIT" SPDX string (was deprecated table
  form); bump build requires to setuptools>=77 which the string form needs.
- _release_lib: 'uv lock' instead of 'uv lock --frozen' so publish regenerates a
  missing/stale lockfile (praisonai-train had none; dependency changes stale it)
  instead of failing with 'Unable to find lockfile'.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-21 17:48:47 +01:00
MervinPraison 966c287326 Bump praisonai-bot to 0.0.40 2026-07-21 17:44:17 +01:00
MervinPraison 4b7b24b20f Bump praisonai-code to 0.0.55 2026-07-21 17:43:07 +01:00
MervinPraison c1a15dce6d Bump praisonaiagents to 1.6.159 2026-07-21 17:41:56 +01:00
Mervin Praison 21ec8ebd3e Merge pull request #3239 from MervinPraison/claude/issue-3236-20260720-1715
fix: guard six trace emit methods before ContextEvent allocation
2026-07-21 17:40:29 +01:00
Mervin Praison e4485b56ad Merge pull request #3240 from MervinPraison/claude/issue-3238-20260720-1715
fix: delegate context aggregator token estimate to canonical heuristic
2026-07-21 17:40:16 +01:00
Mervin Praison bc5f964ad9 Merge pull request #3241 from MervinPraison/claude/issue-3237-20260720-1715
fix: gate parallel LLM context summary behind branch-count threshold
2026-07-21 17:39:50 +01:00
MervinPraison 6ffd00171a docs: auto-update documentation parity trackers [skip ci] 2026-07-21 16:39:25 +00:00
Mervin Praison 45c76d4702 Merge pull request #3250 from MervinPraison/claude/issue-3249-20260721-0712
fix: route Ollama tool-result formatting through OllamaAdapter
2026-07-21 17:38:43 +01:00
Mervin Praison e25e04b428 Merge pull request #3252 from MervinPraison/claude/issue-3251-20260721-0817
fix: close leaked generator resources, harden cli_backend duck-type, wire workflow YAML to observability
2026-07-21 17:38:27 +01:00
Mervin Praison a920bda3bc Merge pull request #3256 from MervinPraison/claude/issue-3255-20260721-0851
fix: gate reads of secret files by default in permission system
2026-07-21 17:38:04 +01:00
Mervin Praison 9ca14460a9 Merge pull request #3257 from MervinPraison/claude/issue-3254-20260721-0851
fix: wire fast search tools into coding agent default toolset
2026-07-21 17:37:36 +01:00
Mervin Praison 0e4508b995 Merge pull request #3258 from MervinPraison/claude/issue-3253-20260721-0850
feat: surface per-run git-worktree isolation via praisonai run --worktree
2026-07-21 17:37:20 +01:00
Mervin Praison 6854cfff98 Merge pull request #3261 from Dhivya-Bharathy/fix/examples-runner-windows-utf8
fix: use UTF-8 encoding in examples suite runner on Windows
2026-07-21 17:37:00 +01:00
Mervin Praison 110cbb4413 Merge pull request #3262 from MervinPraison/claude/issue-3260-20260721-0925
fix: add doctor auto-fix safety rails via RepairPlan
2026-07-21 17:36:40 +01:00
MervinPraison e557bd9e59 docs: auto-update feature parity trackers [skip ci] 2026-07-21 16:36:28 +00:00
Mervin Praison 72a05969ec Merge pull request #3263 from MervinPraison/claude/issue-3259-20260721-0924
fix: fail closed on known-weak/placeholder gateway auth secrets
2026-07-21 17:36:02 +01:00
Mervin Praison 3ee0649c7c Merge pull request #3266 from MervinPraison/claude/issue-3264-20260721-0942
fix: unify scheduler store so agent-authored jobs fire on gateway
2026-07-21 17:35:26 +01:00
Mervin Praison 078173047b Merge pull request #3267 from MervinPraison/claude/issue-3265-20260721-0943
fix: honour intentional-silence contract on scheduled delivery path
2026-07-21 17:35:00 +01:00
Mervin Praison 70373d8aac Merge pull request #3270 from MervinPraison/fix/auto-merge-cancelled-ci
fix: unblock auto-merge when smoke/windows cancel but core CI passes
2026-07-21 17:34:30 +01:00
Mervin Praison ffc6af00b4 Merge pull request #3271 from Iyanuoluwa007/fix-calculator-divide-by-zero
fix: calculator division by zero handling
2026-07-21 17:34:20 +01:00
Mervin Praison ae8f0cf62d Merge pull request #3272 from Iyanuoluwa007/fix-windows-test-signal-compatibility
fix: Windows compatibility in agent termination test
2026-07-21 17:33:54 +01:00
Mervin Praison 8baf7c2fca Merge pull request #3273 from Iyanuoluwa007/fix-telemetry-cleanup
fix: verify telemetry cleanup does not hang agent termination
2026-07-21 17:33:31 +01:00
Mervin Praison 256d63139d Merge pull request #3277 from MervinPraison/claude/issue-3275-20260721-1614
fix: consolidate duplicate API-key middleware into shared helper
2026-07-21 17:32:52 +01:00
Mervin Praison 4cb07c5ef4 Merge pull request #3278 from MervinPraison/claude/issue-3276-20260721-1615
fix: extract shared command_profiler helper for rag/knowledge CLI
2026-07-21 17:32:35 +01:00
Mervin Praison 94b1050af6 Merge pull request #3274 from MervinPraison/fix/praisonai-train-unsloth-latest
praisonai-train: align with latest Unsloth (modern TRL API, model-aware chat template)
2026-07-21 17:31:26 +01:00
praisonai-triage-agent[bot]andMervin Praison 7197e9e365 fix(praisonai-train): harden Unsloth trainer + drop stale uv.lock
- Fail fast when neither the tokenizer nor config provides a chat template,
  instead of silently training on empty text (swallowed apply_chat_template).
- Correct Gemma Ollama template to fold the system prompt into the first user
  turn per the Gemma spec (no separate system turn).
- Document that assistant_only_loss requires a template exposing assistant
  masks ({% generation %}); keep it opt-in and default-off.
- Remove the stale uv.lock (pinned trl<0.9.0 / trl 0.8.6, old torch/transformers/
  unsloth floors) so it regenerates against the modern pyproject stack.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 16:22:15 +00:00
praisonai-triage-agent[bot]andMervinPraison 3c6a493d8a fix: extract shared command_profiler helper for rag/knowledge CLI (fixes #3276)
Both rag_profiler and knowledge_profiler were byte-for-byte identical
except the "command" label. Extract a single command_profiler helper in
cli/commands/_profiling.py and have both delegate to it, so profiling
logic has one owner and cannot drift. Behaviour, flags, and output are
unchanged.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 16:17:37 +00:00
praisonai-triage-agent[bot]andMervinPraison 1e60df1cda fix: consolidate duplicate API-key middleware into shared helper (fixes #3275)
Extract the bearer / X-API-Key token extraction and constant-time
comparison used by both the serve feature and the jobs server into a
single build_api_key_middleware() helper so future auth fixes only need
to be made in one place. Behaviour and lazy-import posture are unchanged;
per-server public-path allowlists remain distinct via a parameter. The
JobsAuthRequiredMiddleware non-localhost guard is left untouched.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 16:16:32 +00:00
MervinPraisonandClaude Fable 5 343beeb427 praisonai-train: align with latest Unsloth (modern TRL API, model-aware chat template)
The dependency pins (trl<0.9.0, unsloth>=2024.8) were incompatible with any recent
Unsloth, which requires trl>=0.18.2 / transformers>=4.51.3. This modernizes the LLM
fine-tuning path so it works with the current stack (tested on 2x A6000 with
unsloth 2026.7.4 / trl 0.24.0 / torch 2.10 / peft 0.19.1).

Changes:
- deps: transformers>=4.51.3, unsloth>=2025.9.1, trl>=0.18.2, peft>=0.13.0,
  accelerate>=0.34.0, bitsandbytes>=0.45.0 (pyproject + setup_conda_env.sh; the
  conda script no longer pins an ancient Unsloth git commit).
- trainer: migrate to modern TRL API — SFTConfig instead of TrainingArguments,
  processing_class instead of tokenizer, dataset_text_field/max_length/packing on
  SFTConfig; drop the pre-tokenize + dummy-field hack (TRL tokenizes internally).
- trainer: stop force-applying the llama-3.1 chat template to every model (broke
  Gemma/Qwen). Chat template is now config-driven and defaults to the model's own.
- trainer: honor config LoRA params (lora_r/alpha/target_modules/... were ignored).
- trainer: response-only loss via SFTConfig assistant_only_loss (model-agnostic),
  replacing the Llama-hardcoded train_on_responses_only markers.
- Ollama Modelfile: add Gemma template + stop tokens (was Llama-only, wrong for Gemma).

Tested: end-to-end LoRA fine-tune smoke runs on GPU for both Qwen2.5-0.5B and
Gemma-2-2B (native templates) — train loop + local save succeed.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-21 17:13:33 +01:00
Iyanuoluwa007 83cd7d7e9c fix: make agent termination test cross-platform 2026-07-21 15:44:47 +01:00
Iyanuoluwa007 5c62530930 test: verify telemetry cleanup does not hang agent termination 2026-07-21 15:07:20 +01:00
Iyanuoluwa007 0f97cc7550 fix: Windows compatibility in agent termination test 2026-07-21 14:43:28 +01:00
praisonai-triage-agent[bot]andMervin Praison f7d1aa027a fix: keep pending check runs in bestRunsByName to prevent premature merge
A completed cancelled run (rank 1) could override an in-progress run
(conclusion=null, rank 0) of the same name, hiding a still-running check
from allChecksGreenOnSha and allowing the merge gate to pass early.
Prioritize any non-completed run so pending checks always block.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 12:31:47 +00:00
Iyanuoluwa007 b474eee596 Fix calculator division by zero handling 2026-07-21 13:28:51 +01:00
MervinPraison 15b1ffa777 fix: unblock auto-merge when smoke/windows cancel but core CI passes
Treat cancelled smoke and test-windows as non-blocking when all test-core
shards succeeded on HEAD, dedupe check runs by best conclusion, and raise
smoke (12m) and Windows (10m) job timeouts to reduce timeout cancellations.
2026-07-21 13:26:26 +01:00
Mervin Praison e05fcda111 Merge pull request #3269 from MervinPraison/claude/issue-3268-20260721-0951
fix: make Terminal-Bench/Harbor integration runnable + benchmark praisonai code
2026-07-21 13:12:18 +01:00
praisonai-triage-agent[bot]andMervin Praison 3b2962438e fix: standardize terminal_bench examples on gpt-4o-mini model
Switch all Harbor adapters, job configs, docs, and tests to
openai/gpt-4o-mini for a consistent, low-cost default across the
Terminal-Bench benchmark path.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 10:21:11 +00:00
praisonai-triage-agent[bot]andMervin Praison 62d2a65c0f fix: propagate praisonai code exit status instead of masking with true
Surfaces genuine install/auth/startup failures in the Harbor code adapter
instead of always reporting success (per reviewer feedback). A benchmark
miss still exits 0 (Harbor grades by verification); only a crashed
assistant now fails the attempt.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 10:03:47 +00:00
praisonai-triage-agent[bot]andMervinPraison 98701ee2a5 fix: make Terminal-Bench/Harbor integration runnable + benchmark praisonai code (fixes #3268)
Repairs the examples/terminal_bench/ Harbor adapters (external/wrapper/
installed), adds a headline praisonai_code_agent that drives `praisonai code`
headlessly, rewrites job configs to the real Harbor JobConfig schema for
Terminal-Bench 2.1, adds packaging __init__.py files, rewrites the tests to
skip only when Harbor is truly absent, and adds a manual-dispatch smoke
workflow + RESULTS.md. Examples/CI layer only — no SDK changes.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 09:57:19 +00:00
praisonai-triage-agent[bot]andMervin Praison 7a057de7f3 fix: log (not silently swallow) schedule store repoint/migration failures
Addresses reviewer feedback that set_store()/migration failing open could
hide reader/writer drift. The local tool store remains authoritative, so
these paths stay best-effort but are now diagnosable via logs.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:52:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 69c1790103 test: cover full-gateway intentional-silence suppression in ScheduledAgentExecutor
Adds direct coverage for the bot-side _execute_one silence path (exact
markers, whitespace variants, ordinary output, prose mention) asserting
delivery is suppressed while the run is still recorded as succeeded.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:52:33 +00:00
praisonai-triage-agent[bot]andMervinPraison bb03dff081 fix: honour intentional-silence contract on scheduled delivery path (fixes #3265)
Scheduled/automation runs now consult the existing core silence primitive
(praisonaiagents.bots.silence.is_intentional_silence_response) before
delivering. When a run's whole output is an exact silence marker
(NO_REPLY / [SILENT] / SILENT) delivery is suppressed while the run still
completes and is recorded, so unattended monitors stop posting the raw
control token. Applied to both the wrapper lightweight path
(AgentScheduler._deliver_result) and the bot full-gateway path
(ScheduledAgentExecutor). Prose merely mentioning the token is unaffected
(exact-match semantics).

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 09:46:35 +00:00
praisonai-triage-agent[bot]andMervinPraison e8d7c49907 fix: unify scheduler store so agent-authored jobs fire on gateway (fixes #3264)
Add a canonical get_default_store()/set_default_store() resolver in
praisonaiagents.scheduler and route the agent tools, gateway tick loop,
and host bridge through it so writer and reader share one backend.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 09:46:34 +00:00
praisonai-triage-agent[bot]andMervin Praison ebf59d1b74 fix: guard is_weak_secret against non-string inputs
Convert value to str before strip()/lower() so an unquoted YAML
auth_token (e.g. 12345) cannot raise AttributeError during the
weak-secret check. Preserves empty/None handling and denylist match.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:38:51 +00:00
praisonai-triage-agent[bot]andMervin Praison fa99e51879 fix: doctor parity + neutralize high-entropy test tokens (#3259)
- gateway doctor now fails closed on a MISSING auth_token on an external
  bind (matching startup), not just a weak one (Greptile P1)
- doctor --json always emits a single parseable JSON document on the
  no-channels weak/missing-secret failure path (Greptile P2)
- replace high-entropy fake hex test tokens with an obviously-non-secret
  literal to clear GitGuardian false positives without weakening tests
- add TestDoctorGatewaySecretStrength covering the new doctor paths

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:35:40 +00:00
praisonai-triage-agent[bot]andMervin Praison bb4a198a51 fix: harden doctor RepairPlan safety rails (in-place repairs, collect failures, backup collisions, no-op applied)
Address Greptile review findings on the doctor auto-fix safety contract:
- In-place repairs no longer discarded: pass a fresh copy to apply_fix so
  rules that mutate-and-return their argument still record a diff.
- Collection failures now recorded as blocking refused findings instead of
  being silently swallowed (previously produced an apparently clean plan).
- Auto-derived backup paths use microsecond timestamps plus a numeric
  uniqueness suffix so a rapid/concurrent run never overwrites an earlier
  snapshot.
- No-op apply runs no longer report applied=True; applied now requires an
  actual change.

Adds tests for each case.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:34:52 +00:00
praisonai-triage-agent[bot]andMervinPraison 21a6e960d0 fix: fail closed on known-weak/placeholder gateway auth secrets (fixes #3259)
Add a core weak-secret guard so an externally-bound gateway refuses to
start behind a publicly-known placeholder token (e.g. change-me,
your-token-here, or the literal $(openssl rand -hex 16) fix-hint pasted
verbatim). Loopback binds downgrade to a warning, consistent with the
existing permissive-loopback posture.

- core: KNOWN_WEAK_SECRETS, is_weak_secret, assert_gateway_secret_strong,
  WeakGatewaySecretError in praisonaiagents.gateway.protocols
- praisonai-bot: enforce in assert_external_bind_safe (fail closed on
  external, warn on loopback) and surface in `gateway doctor`

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 09:29:14 +00:00
praisonai-triage-agent[bot]andMervinPraison d66401dcd6 fix: add doctor auto-fix safety rails via RepairPlan (fixes #3260)
Add a repair safety contract to the core doctor engine so self-repair is
safe to run: dry-run diff preview, backup, refuse-on-unrecoverable, and
post-fix re-validation. Introduces ConfigDiff/RepairPlan and a
DoctorRulesRegistry.plan_fixes() while keeping apply_all_fixes()/apply_fixes()
backward-compatible.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 09:28:16 +00:00
Dhivya-BharathyandCursor 0492eb6f69 fix: use UTF-8 encoding in examples suite runner on Windows
Co-authored-by: Cursor <[email protected]>
2026-07-21 14:54:39 +05:30
praisonai-triage-agent[bot]andMervin Praison 6627697001 fix: prevent data loss and shared state in worktree isolation (#3253)
Address reviewer-flagged issues in praisonai run --worktree:

- P0: untracked output no longer silently deleted. Teardown now detects
  changes via git status --porcelain (sees untracked files, which git diff
  does not) and commits them to the isolated branch, retaining the branch;
  only the worktree checkout is pruned. Falls back to keeping the worktree
  if the commit fails (e.g. no git identity), so output is never lost.
- P1: identical targets get independent worktrees/branches via a per-run
  unique token, so concurrent/repeated runs never share state.
- P1: relative/untracked local YAML now resolved to an absolute path before
  chdir, so praisonai run ./agents.yaml --worktree still loads its config.

Adds tests for untracked-output preservation and per-run independence.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:04:20 +00:00
praisonai-triage-agent[bot]andMervin Praison 3ef7590d1e fix: honor workspace + search opt-out in wired search tools
- code_intelligence: core grep now searches the configured workspace
  (search_path) instead of the process CWD, matching the grep -rn fallback;
  paths outside the core tool's root fall back cleanly.
- interactive_tools: apply PRAISON_TOOLS_DISABLE via ToolConfig.__post_init__
  so direct constructions (to_tool_config, HeadlessInteractiveCore) honor the
  advertised opt-out, not just from_env().

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:02:21 +00:00
praisonai-triage-agent[bot]andMervin Praison df015d2134 fix: prevent broad read:* allow from bypassing secret-read gate
A catch-all read:* allow rule previously opted every secret file into
ALLOW, trivially defeating the gate. Now only a secret-specific allow
rule (e.g. read:*.env) or a persistent approval opts in; a broad
wildcard falls through to the ASK default. Deny and approvals still win.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 09:00:31 +00:00
praisonai-triage-agent[bot]andMervinPraison 258509866c feat: add --worktree/--keep git isolation to praisonai run (fixes #3253)
Wire the existing core GitWorktreeAdapter into the CLI run lifecycle as a live consumer. praisonai run with --worktree provisions a fresh git worktree/branch, runs the agent there, reports the branch + a summary diff, and tears the worktree down (or keeps it with --keep). Degrades to a transparent no-op outside a git repo. Kept lightweight: no new Agent params/modules, only a self-contained context manager in run.py plus two CLI flags.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 08:56:13 +00:00
praisonai-triage-agent[bot]andMervinPraison 605f60a8ee fix: wire fast search tools into coding agent default toolset (fixes #3254)
Add a `search` tool group (grep, glob, ast_grep_search) to the interactive
coding agent's default toolset, resolving to the existing ripgrep-backed core
builtins. Also route code_intelligence search through the core grep first,
keeping `grep -rn` only as a last-resort fallback.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 08:55:26 +00:00
praisonai-triage-agent[bot]andMervinPraison 706d1aa9aa fix: gate reads of secret files by default in permission system (fixes #3255)
Reads of secret files (.env, private keys, *.pem, *.key, id_rsa, etc.) now
default to `ask` in the core permission manager, closing a silent
secret-exfiltration path where a default coding agent could read credentials
and forward them to the model provider. Safe example/sample/template files
remain allowed, and explicit user rules/approvals (e.g. `read:*.env=allow`)
override the default so opting in for trusted workflows stays a single rule.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 08:54:27 +00:00
praisonai-triage-agent[bot]andMervinPraison a185cb74f5 fix: close leaked generator resources, harden cli_backend duck-type, wire workflow YAML to observability (fixes #3251)
Gap 1: run/arun and the 4 legacy CLI call sites now own the
AgentsGenerator lifecycle via `with`, releasing its lazily-allocated
tool-timeout executor per run instead of leaking daemon threads in
long-lived server workers.

Gap 2: _is_protocol_instance / _is_cli_backend_instance now use
isinstance against the @runtime_checkable CliBackendProtocol instead of a
hasattr(execute, stream) duck-type, so a BaseCLIIntegration look-alike is
no longer mistaken for a backend; it fails fast at construction with a
pointed TypeError instead of crashing deep in the agent loop.

Gap 3: both workflow kickoff branches are bracketed in observability_session
so AgentOps init/finalize fires for workflow YAMLs too, and _build_yaml_workflow
now runs cli_backend compatibility validation and warns when a set
tool_timeout cannot be enforced on the native workflow path.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 08:32:14 +00:00
praisonai-triage-agent[bot] 9734c62b01 Merge pull request #3247 from MervinPraison/claude/issue-3245-20260721-0649
fix: use tmp_path in browser server tests to avoid Windows SQLite lock (fixes #3245)
2026-07-21 08:11:29 +00:00
praisonai-triage-agent[bot]andMervin Praison b65e924022 fix: align _format_ollama_tool_result_message return type with adapter protocol
Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 07:30:21 +00:00
praisonai-triage-agent[bot]andMervinPraison 6a391d1db4 fix: route Ollama tool-result formatting through OllamaAdapter (fixes #3249)
Make llm.py delegate _format_ollama_tool_result_message to the
protocol-driven OllamaAdapter.format_tool_result_message instead of a
hardcoded, behaviorally-diverged duplicate. The error-handling behavior
(apology-oriented prompt for dict/list results carrying an 'error' key)
is ported into the adapter so the single source of truth now lives in
the adapter layer, matching the pattern used elsewhere. Fully
backward-compatible: call sites are guarded by _is_ollama_provider(), so
Ollama formatting is always produced.

Co-authored-by: MervinPraison <[email protected]>
2026-07-21 07:24:54 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 2132be0236 fix: replace Literal sandbox type with Enum and add usage help category (fixes #3246)
Bug A: Typer does not support typing.Literal; replaced _SandboxType
Literal with a str/Enum SandboxBackend so grouped --help lazy-loading
of the sandbox command no longer raises RuntimeError. Handler receives
.value to preserve string API.

Bug B: Added missing 'usage' command to COMMAND_CATEGORIES so every
registered lazy command has a help category.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-21 06:50:59 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy abf0be4129 fix: use tmp_path instead of NamedTemporaryFile in browser server tests (fixes #3245)
Windows denies a second open of a NamedTemporaryFile while its handle is
still open, causing SQLite "unable to open database file" errors. Replace
the NamedTemporaryFile pattern with pytest tmp_path in the two affected
tests in test_server.py.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-21 06:50:48 +00:00
Mervin Praison 38aea8dc52 Merge pull request #3243 from Iyanuoluwa007/fix-test-syntax-check-path
Fix path resolution in test_syntax_check.py
2026-07-21 03:41:24 +01:00
MervinPraison 31adf322e1 Release v4.6.155 2026-07-21 00:43:57 +00:00
MervinPraison 8671bfaf99 Bump praisonai-sandbox to 0.0.5 2026-07-21 00:43:52 +00:00
MervinPraison 3b2a49e37c Bump praisonai-mcp to 0.0.7 2026-07-21 00:43:47 +00:00
MervinPraison dd6aeb9f32 Bump praisonai-browser to 0.0.7 2026-07-21 00:43:42 +00:00
MervinPraison 93c1c48cfa Bump praisonai-train to 0.0.10 2026-07-21 00:43:37 +00:00
MervinPraison c9d8436da8 Bump praisonai-bot to 0.0.39 2026-07-21 00:43:32 +00:00
MervinPraison e7348d3e54 Bump praisonai-code to 0.0.54 2026-07-21 00:42:56 +00:00
MervinPraison 8ac06ed003 Bump praisonaiagents to 1.6.158 2026-07-21 00:42:49 +00:00
praisonai-triage-agent[bot]andMervin Praison 406c897761 Fix test path resolution and dry-run env/strict handling
- test_syntax_check.py: resolve agent.py via pathlib relative to __file__
  so the check runs from any working directory (repo root or package dir)
- suite_runner/executor.py: run the dry-run branch before per-item env
  checks so a preview lists runnable items even when credentials are absent
- cli/commands/docs.py: do not fail strict mode on dry-run, since dry-run
  intentionally marks runnable items as not_run

Rebased onto current main; the dry-run feature already merged there, so
only the genuinely-missing path fix plus the two reviewer-flagged bug
fixes remain.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-21 00:42:07 +00:00
praisonai-triage-agent[bot]andMervin Praison 54dba703ad fix: preserve pass-through context for small fan-outs below 1500 tokens
Restores pre-gate behaviour where 1000-1500 token context was returned
unchanged for small branch counts, instead of being truncated.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 17:23:10 +00:00
praisonai-triage-agent[bot]andMervin Praison 0562c17849 fix: token-aware truncation in ContextAggregator for non-ASCII budgets
Partial-truncation in aggregate() used a fixed remaining*4 char estimate,
which over-retained dense non-ASCII (CJK) text and could exceed max_tokens.
Now selects the longest prefix whose canonical token estimate fits the
remaining budget via _truncate_to_tokens(). Adds regression tests.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 17:22:42 +00:00
praisonai-triage-agent[bot]andMervin Praison 8dd8156777 fix: guard knowledge_search/knowledge_add before ContextEvent allocation
Completes the disabled-path guard pattern for the two remaining trace
emit methods, matching the six methods fixed in this PR and their hotter
siblings. Byte-identical enabled behavior; only skips wasted allocation
when tracing is disabled.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 17:20:18 +00:00
praisonai-triage-agent[bot]andMervinPraison 791419ae1a fix: gate parallel LLM context summary behind branch-count threshold (fixes #3237)
Small parallel groups (e.g. 2 branches) no longer pay for an extra LLM
summarisation call whose token cost roughly matches what it saves. The
cheaper _truncate_context_for_branches fallback is used below the
MIN_BRANCHES_FOR_LLM_SUMMARY threshold; LLM summarisation stays unchanged
for larger fan-outs.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 17:18:14 +00:00
praisonai-triage-agent[bot]andMervinPraison 885bd0afb0 fix: delegate context aggregator token estimate to canonical heuristic (fixes #3238)
Replace the crude `len(text) // 4 + 1` estimate in
ContextAggregator._estimate_tokens with a delegation to the package's
canonical estimate_tokens_heuristic. ASCII-identical, but now correctly
weights non-ASCII (CJK) characters, preventing context-budget overruns
for non-English content. Single source of truth for token estimation.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 17:17:44 +00:00
praisonai-triage-agent[bot]andMervinPraison 6041fe2d12 fix: guard six trace emit methods before ContextEvent allocation (fixes #3236)
Add early `if not self._enabled: return` to session_start, session_end,
context_snapshot, agent_handoff, memory_store, and memory_search, matching
the existing pattern in hotter siblings. Avoids allocating a ContextEvent
(and slicing query strings) on every memory/session/handoff op when tracing
is disabled. Output is identical when tracing is enabled.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 17:16:25 +00:00
Leebana ea3dee45d2 Merge pull request #3164 from MervinPraison/claude/issue-3161-20260718-0914
fix: add gateway restart + consolidate reliability/hooks flags onto Typer surface
2026-07-20 13:13:15 +01:00
Leebana 4394c86459 Merge pull request #3234 from MervinPraison/claude/issue-3232-20260720-0949
fix: serialise turns on resolved session identity across adapters
2026-07-20 13:12:52 +01:00
Leebana a8789be8d3 Merge pull request #3233 from MervinPraison/claude/issue-3230-20260720-0948
fix: add atomic claim_due to default ConfigYamlScheduleStore
2026-07-20 13:12:36 +01:00
Leebana 64bf6fa9fa Merge pull request #3229 from MervinPraison/claude/issue-3215-20260720-0924
fix: browser extension unit tests pass without live bridge
2026-07-20 13:12:12 +01:00
Leebana 31c846b4a2 Merge pull request #3228 from MervinPraison/claude/issue-3213-20260720-0924
fix: make praisonai-mcp doctor cp1252-safe on Windows
2026-07-20 13:11:44 +01:00
Leebana d95abb62aa Merge pull request #3226 from MervinPraison/claude/issue-3217-20260720-0925
fix: close temp file/db handles on Windows in bot & train tests
2026-07-20 13:11:31 +01:00
Leebana 0637da856b Merge pull request #3225 from MervinPraison/claude/issue-3211-20260720-0923
fix: add committed E2E validation runner for praisonai-sandbox
2026-07-20 13:11:07 +01:00
Leebana f04a53aa6e Merge pull request #3224 from MervinPraison/claude/issue-3214-20260720-0924
fix: skip Windows-incompatible sandbox tests
2026-07-20 13:10:48 +01:00
Leebana 00c013b740 Merge pull request #3219 from MervinPraison/claude/issue-3206-20260720-0921
fix: declarative default-deny gateway method scope registry
2026-07-20 13:10:27 +01:00
Leebana 083c6d53f5 Merge pull request #3204 from MervinPraison/claude/issue-3200-20260720-0849
fix: keyless local-first first run — auto-detect a local model
2026-07-20 13:09:34 +01:00
Leebana 1a56243ca1 Merge pull request #3203 from MervinPraison/claude/issue-3201-20260720-0849
fix: single source of truth for canonical CLI session stores
2026-07-20 13:09:04 +01:00
Leebana c45a30a7bb Merge pull request #3202 from MervinPraison/claude/issue-3199-20260720-0848
fix: unify CLI home root on canonical ~/.praisonai
2026-07-20 13:08:35 +01:00
Leebana c1d7485187 Merge pull request #3198 from MervinPraison/claude/issue-3197-20260720-0822
fix: harden wrapper hot paths — stream timeout, async run_background, adapter reuse
2026-07-20 13:08:14 +01:00
Leebana c1bce27e76 Merge pull request #3196 from MervinPraison/claude/issue-3195-20260720-0715
fix: enforce async tool hooks, validate process, fix session restore
2026-07-20 13:07:48 +01:00
Leebana f5517eb957 Merge pull request #3194 from MervinPraison/claude/issue-3192-20260719-1715
fix: consolidate model context-window tables (close eval gpt-5/gpt-4.1 gap)
2026-07-20 13:07:17 +01:00
Leebana e80e9c4cfb Merge pull request #3193 from MervinPraison/claude/issue-3191-20260719-1714
fix: defer ToolSearchConfig import to avoid eager tools subsystem load
2026-07-20 13:06:46 +01:00
Leebana a8d359bddd Merge pull request #3190 from MervinPraison/claude/issue-3189-20260719-0944
fix: add per-route isolated tenant profile dimension to gateway routing
2026-07-20 13:06:17 +01:00
Leebana 84853b93c4 Merge pull request #3181 from MervinPraison/claude/issue-3179-20260719-0852
fix: show change preview before approving file-mutating tools in interactive CLI
2026-07-20 13:05:34 +01:00
Leebana a37bce5d74 Merge pull request #3188 from MervinPraison/claude/issue-3183-20260719-0912
fix: make chat approval backends durable across restart
2026-07-20 13:04:24 +01:00
Leebana 3840d46c1a Merge pull request #3187 from MervinPraison/claude/issue-3185-20260719-0914
fix: exactly-once delivery reconciliation on Slack adapter
2026-07-20 13:03:49 +01:00
Leebana 71de56df79 Merge pull request #3186 from MervinPraison/claude/issue-3184-20260719-0913
fix: give outbound media the same retry/backoff as text
2026-07-20 13:03:23 +01:00
Leebana 70eb68e4fe Merge pull request #3180 from MervinPraison/claude/issue-3177-20260719-0851
fix: capture denial reason in interactive CLI approvals (reject-with-correction)
2026-07-20 13:02:58 +01:00
Leebana ebf12c85ba Merge pull request #3176 from MervinPraison/claude/issue-3175-20260719-0817
fix: surface silent YAML/timeout collapses and unblock nested skill paths
2026-07-20 13:02:28 +01:00
praisonai-triage-agent[bot]andMervin Praison 8ec562018e fix: apply drain window to restart, resolve non-default endpoint, guard Windows restart (#3161)
Addresses reviewer (Greptile P1) findings on PR #3164:
- restart --drain-timeout now flows into stop()/graceful-stop so the OLD
  process gets the full drain window instead of a fixed 10s cut-off.
- pause/resume/reconnect + URL resolution now honour --host/--port /
  GATEWAY_PORT so a gateway on a non-default endpoint is located instead of
  always probing 127.0.0.1:8765.
- Windows daemon restart aborts if `schtasks /End` fails, preventing a
  duplicate/colliding gateway relaunch.
- Documented that the direct (non-service) restart fallback cannot recover
  CLI-only launch flags; service/YAML is the production path.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 12:02:20 +00:00
praisonai-triage-agent[bot]andMervinPraison ce7a0ed398 fix: add gateway restart + consolidate reliability/hooks flags onto Typer surface (fixes #3161)
- Add first-class `gateway restart` (daemon-aware graceful drain + relaunch)
- Surface reliability/admission/idle/drain/identity flags on Typer `gateway start`
- Add `gateway hooks {add,list,remove}` Typer sub-app reusing GatewayHandler.hooks
- Resolve pause/resume/reconnect target from the PID lock when --url omitted
- Add daemon restart() for systemd/launchd/windows + restart_daemon dispatcher

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 12:02:20 +00:00
Leebana 17a127552a Merge pull request #3174 from MervinPraison/claude/issue-3173-20260719-0708
fix: async lifecycle hooks + locked display-callback swap
2026-07-20 13:02:02 +01:00
Leebana 57870ac6cb Merge pull request #3172 from MervinPraison/claude/issue-3171-20260718-1713
fix: gate BEFORE_TOOL_DEFINITIONS deepcopy behind has_hooks
2026-07-20 13:01:15 +01:00
Leebana 005cdc27f7 Merge pull request #3170 from MervinPraison/claude/issue-3167-20260718-1615
fix: dedupe conversation-persistence session flow into one owner
2026-07-20 13:00:49 +01:00
Leebana f974ea11f6 Merge pull request #3169 from MervinPraison/claude/issue-3168-20260718-1616
fix: make call feature guard detect missing optional deps
2026-07-20 12:59:54 +01:00
Leebana 951a377d00 Merge pull request #3162 from MervinPraison/claude/issue-3160-20260718-0914
fix: honour gateway fatal-config exit code in installed daemons
2026-07-20 12:58:57 +01:00
Leebana 7616ed06bc Merge pull request #3158 from MervinPraison/claude/issue-3155-20260718-0851
feat: zero-config praisonai usage command for local spend/token reporting
2026-07-20 12:58:19 +01:00
Leebana fe86e28673 Merge pull request #3157 from MervinPraison/claude/issue-3154-20260718-0851
fix: workspace-aware default session identity (#3154)
2026-07-20 12:57:53 +01:00
Leebana 37625e52a7 Merge pull request #3156 from MervinPraison/claude/issue-3153-20260718-0850
fix: self-correcting tool resolution with suggestions and strict mode
2026-07-20 12:57:14 +01:00
MervinPraison 8ae29bd412 docs: auto-update documentation parity trackers [skip ci] 2026-07-20 11:56:54 +00:00
Leebana f412021cd7 Merge pull request #3150 from MervinPraison/claude/issue-3149-20260718-0716
fix: close $IFS permission bypass, litellm.callbacks overwrite, cross-agent memory reset
2026-07-20 12:56:20 +01:00
praisonai-triage-agent[bot] 6634f95463 Merge pull request #3235 from MervinPraison/claude/issue-3231-20260720-0948
fix: durable dedup for scheduled/proactive delivery (fixes #3231)
2026-07-20 10:58:36 +00:00
praisonai-triage-agent[bot] 86ce57e65b Merge pull request #3220 from MervinPraison/claude/issue-3209-20260720-0922
fix: register MCP components before list-resources/list-prompts
2026-07-20 10:56:48 +00:00
praisonai-triage-agent[bot] 15e0c5dd8c Merge pull request #3221 from MervinPraison/claude/issue-3210-20260720-0922
fix: config-generate emits standalone praisonai-mcp command
2026-07-20 10:50:07 +00:00
MervinPraison 34d8385ac6 Release v4.6.154 2026-07-20 10:46:23 +00:00
MervinPraison e78bdfbe6e Bump praisonai-sandbox to 0.0.4 2026-07-20 10:46:18 +00:00
MervinPraison 19115c2356 Bump praisonai-mcp to 0.0.6 2026-07-20 10:46:13 +00:00
MervinPraison 2d8c360ce4 Bump praisonai-browser to 0.0.6 2026-07-20 10:46:08 +00:00
MervinPraison a6c2b6b957 Bump praisonai-train to 0.0.9 2026-07-20 10:46:03 +00:00
MervinPraison d94986f0a6 Bump praisonai-bot to 0.0.38 2026-07-20 10:45:57 +00:00
MervinPraison 831b2d2952 Bump praisonai-code to 0.0.53 2026-07-20 10:45:51 +00:00
MervinPraison f8659e979e Bump praisonaiagents to 1.6.157 2026-07-20 10:45:44 +00:00
praisonai-triage-agent[bot] a9a59d202d Merge pull request #3222 from MervinPraison/claude/issue-3208-20260720-0922
fix: unify praisonai-mcp tool registration for list-tools parity
2026-07-20 10:45:34 +00:00
praisonai-triage-agent[bot] b00ff1fce2 Merge pull request #3223 from MervinPraison/claude/issue-3212-20260720-0923
fix: stop config walk-up at $HOME so legacy ~/.praison/config.toml isn't mislabelled as project
2026-07-20 10:37:21 +00:00
praisonai-triage-agent[bot] 23a3a99d13 Merge pull request #3227 from MervinPraison/claude/issue-3218-20260720-0925
fix: align Windows pytest CliRunner help tests with real terminal (#3218)
2026-07-20 10:34:30 +00:00
MervinPraison b2dbb04248 docs: auto-update feature parity trackers [skip ci] 2026-07-20 10:33:11 +00:00
praisonai-triage-agent[bot] 13a77109b1 Merge pull request #3216 from MervinPraison/claude/issue-3205-20260720-0921
fix: add MessagePresentation.question() builder for choice elicitation
2026-07-20 10:32:45 +00:00
praisonai-triage-agent[bot]andMervin Praison 1b2c11f773 fix: scope shared outbox drain to each row's own key (#3231)
Address Greptile P1 findings on the scheduled/proactive delivery path:
the shared scheduled_outbox is drained whole on every delivery, but the
sender captured a single idem and stamped it on every drained row, and
success was read from the aggregate drain count.

- _send now uses each entry's own idempotency key (carried in the
  payload) so a backlogged row is no longer sent under the current key,
  which previously poisoned the router LRU and suppressed the real row
  as a duplicate (message lost).
- Result for this delivery is resolved via status_for(idem) scoped to
  our own key, never the aggregate succeeded count, so an unrelated row
  succeeding no longer masks this row's failure.
- Drain-exception fallback checks status_for(idem) instead of a blind
  re-send, avoiding a duplicate against a still-pending durable row.
- Add regression test for the multi-eligible-row (backlog + fresh) case.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 10:06:44 +00:00
praisonai-triage-agent[bot]andMervin Praison 587d439617 fix: share per-turn LockMap across gateway channels on resolved identity (#3232)
The flagship WebSocketGateway is a separate startup path from BotOS and
stamped the identity resolver + admission gate onto each channel bot's
session but never a shared turn-lock map. Channels unifying to one session
therefore still held distinct LockMaps, leaving the concurrent-transcript
bug open on the gateway path. Add _stamp_turn_lock_map (mirroring
_stamp_identity_resolver / _stamp_admission_gate) and wire it into both
start_channels and _start_single_channel, gated on a configured resolver.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 10:01:53 +00:00
praisonai-triage-agent[bot]andMervin Praison 7eb5f480e2 fix: durable dedup for scheduled/proactive delivery (fixes #3231)
Route the gateway's scheduled/proactive delivery through the same durable
OutboundQueue the reply path uses, so its UNIQUE idempotency key — which
survives a restart — is the source of truth for "already sent" instead of the
per-process, in-memory LRU that dies with the process. A crash-and-refire after
a restart is now a no-op INSERT resolving to the already-sent row, so the
scheduler no longer double-posts the same proactive message.

The DeliveryRouter remains the sender, preserving its token-bucket throttle,
dead-target suppression, and LRU on top of durability. A genuinely failed
pre-crash send stays non-terminal and is re-delivered at-least-once after
restart. Falls back to the prior LRU-only router path if the durable store
cannot be built.

Adds a minimal OutboundQueue.status_for(key) read so a deduped re-fire is
reported as a suppressed success rather than a spurious failure.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:58:29 +00:00
praisonai-triage-agent[bot]andMervin Praison 89babd062e fix: abort claim_due when persistence fails to prevent duplicate fire
If _save() fails (full disk, permissions, failed replace), claim_due
previously still returned the claimed jobs even though the lease and
advanced last_run_at were never persisted. The runner would execute them
while the next poll re-read the unchanged file and re-fired duplicates —
defeating the at-most-once guarantee on the exact failure path it protects.

_save() now returns a bool; claim_due drops the claim (returns []) and
releases in-memory leases when the write did not persist, so the job is
retried cleanly. Applied identically to ConfigYamlScheduleStore and
FileScheduleStore for parity. Adds persist-failure tests for both stores.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:58:19 +00:00
praisonai-triage-agent[bot]andMervin Praison 01faba98ef fix: serialise turns on resolved session identity across adapters (fixes #3232)
Cross-platform continuity via the identity resolver unified distinct
platform users onto one persisted session, but each adapter's
BotSessionManager owned its own LockMap keyed on the resolved id. Two
adapters resolving to the same unified id held two distinct locks, so
near-simultaneous turns ran concurrently against one transcript,
interleaving read-modify-write and breaking strict alternation.

Fix reuses the existing LockMap + _get_lock (no new class): BotOS builds
one shared LockMap and injects it into every managed bot's session
manager (mirroring _wire_admission_gate / _wire_outbound_messenger), so
turns serialise on the resolved id regardless of which adapter a message
arrives on. Wired only when an identity resolver is configured, so the
single-adapter path is unchanged and fully backward-compatible.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:54:32 +00:00
praisonai-triage-agent[bot]andMervin Praison d8ac00a45c fix: add atomic claim_due to default ConfigYamlScheduleStore (fixes #3230)
The default schedule store lacked an atomic claim_due(), so ScheduleRunner
degraded to the non-atomic get_due_jobs() path — causing multi-process
gateways to double-fire every scheduled job. Implement claim_due()/complete()
on ConfigYamlScheduleStore, reusing the fcntl/msvcrt advisory-lock +
persisted-lease pattern already proven in FileScheduleStore, so the
at-most-once guarantee now holds out of the box on the default store.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:51:59 +00:00
praisonai-triage-agent[bot]andMervin Praison 58725f746c fix: parse browser extension skip flag explicitly; opt-in via test fixture
Address Greptile P1: PRAISONAI_BROWSER_SKIP_EXTENSION_WAIT now only bypasses
the readiness poll for explicit truthy values (1/true/yes/on), so "false" or
inherited values no longer disable the check. Removed the PYTEST_CURRENT_TEST
auto-skip that would suppress readiness polling for live integration tests and
test-launched subprocesses. Mocked unit tests now opt in via an autouse fixture.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:42:45 +00:00
praisonai-triage-agent[bot]andMervin Praison ef54601842 fix: harden praisonai-mcp doctor Rich fallback and JSON error path
- Escape ASCII status marker in _print_success via rich.markup.escape so
  "[OK]" renders literally instead of being parsed as (invalid) Rich markup.
- doctor --json now emits a JSON error object on failure instead of
  Rich-formatted text, keeping stdout machine-readable for automation.
- Add regression tests for both paths; make cp1252 marker assertion
  environment-agnostic.

Addresses greptile P1 review comments on #3228.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:40:55 +00:00
praisonai-triage-agent[bot]andMervin Praison 5cff88dc9a fix: harden gateway scope registry (immutable descriptor, incomparable scopes)
- Freeze escalate_fields/safe_fields in __post_init__ so directly-constructed
  descriptors are truly immutable authorisation records (no post-hoc mutation).
- Model APPROVALS/PAIRING as incomparable siblings: combining two distinct
  same-tier scopes escalates to ADMIN (fail closed) instead of silently
  picking one, closing a single-scope-check bypass.
- Add tests for incomparable-scope escalation and collection immutability.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:37:57 +00:00
praisonai-triage-agent[bot]andMervin Praison beacda45b0 fix: bound Docker E2E check with timeout and treat unavailable image as SKIP
- Wrap DockerSandbox.start()/execute() in asyncio.wait_for so image pull/startup
  can never hang the run (configurable via PRAISONAI_SANDBOX_E2E_DOCKER_TIMEOUT)
- Report unavailable Docker image/registry as SKIP instead of FAIL so the
  optional check no longer fails a required run
- Clarify in README that e2e-validation/ and tests/ require a repo checkout
  (not shipped in the published wheel)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:37:12 +00:00
praisonai-triage-agent[bot]andMervin Praison 7f026e2bd2 fix: config-generate-recipe emits standalone praisonai-mcp command
Apply the same STDIO entry-point resolution to cmd_config_generate_recipe
so standalone (pip install praisonai-mcp) users get a runnable command
instead of the umbrella-only "praisonai mcp serve-recipe" (fixes #3210).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:37:03 +00:00
praisonai-triage-agent[bot]andMervin Praison d7ff554e43 test: assert exact resource/prompt names in list registration regression
Strengthens the list-resources/list-prompts regression tests to verify the
full expected set of 7 resources and 7 prompts (by name/URI) rather than only
asserting non-empty output, per reviewer feedback.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:35:52 +00:00
praisonai-triage-agent[bot]andMervin Praison d0f13f2c14 fix: search $HOME for non-legacy project configs while skipping legacy global
Previously the walk-up broke before searching $HOME entirely, which also
suppressed legitimate project configs rooted at home (e.g. ~/praison.yaml,
~/praison.yml) that have no global loading path. Now $HOME is still searched
but only the legacy .praison/config.toml name is skipped there, since it is
owned by _load_global_config(). Resolves Greptile P1.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:35:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 291b43c320 fix: guard full symlink probe against filesystem errors during collection
Wrap tempfile/open in the symlink capability probe so any OSError skips
the test rather than failing module collection (Greptile feedback).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:35:00 +00:00
praisonai-triage-agent[bot]andMervin Praison 259c6d6015 test: strengthen list-tools parity test with name-set subset + registry isolation
Address reviewer feedback (Greptile):
- Assert partial tool names are a strict subset of the full set instead of
  comparing only registry sizes, so a dropped-but-count-masked tool is caught.
- Add an isolated_tool_registry fixture that snapshots and restores both
  _tools and _lazy_loaders, preventing singleton state leakage into later tests.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:31:44 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy f67c427db8 fix: make browser extension unit tests pass without live bridge (fixes #3215)
- server.py: skip/cap the pre-connect health-check loop under pytest or when
  PRAISONAI_BROWSER_SKIP_EXTENSION_WAIT is set, and bound the wait by timeout,
  so mocked websockets tests reach websockets.connect instead of timing out.
- sessions.py: create parent directories for custom SQLite db_path.
- test: use a dedicated event loop in test_extension_engine_value to avoid the
  deprecated get_event_loop() failing on Python 3.12.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:30:36 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 537e4a8819 fix: make praisonai-mcp doctor cp1252-safe on Windows (fixes #3213)
Detect legacy console encodings and fall back to ASCII status markers so
`praisonai-mcp doctor` no longer crashes with UnicodeEncodeError on default
Windows cp1252 consoles. Adds a `--json` mode with no Unicode symbols and a
regression test, mirroring the umbrella `praisonai doctor` fix (#2270).

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:29:31 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 97834b5386 fix: align Windows pytest CliRunner help tests with real terminal (fixes #3218)
Windows-only test failures: CliRunner captures --help into a cp1252 buffer,
so Rich raises UnicodeEncodeError and the command exits 1 (real shell exits 0
because Rich detects the terminal and downgrades to ASCII). The stub-scan test
also used read_text() which defaults to cp1252 on Windows, raising
UnicodeDecodeError on byte 0x81.

- Invoke --help via a utf-8, NO_COLOR CliRunner so the harness matches real
  terminal behaviour; surface the captured exception on failure.
- Read command modules with encoding="utf-8" in the legacy re-entry scan.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:29:13 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 05e3930bd9 fix: close temp file/db handles on Windows in bot & train tests (fixes #3217)
- praisonai-bot: close the NamedTemporaryFile handle before load/unlink so
  os.unlink no longer hits WinError 32 on Windows.
- praisonai-train: add TrainingStorage.close() + context-manager support that
  closes the underlying storage backend (e.g. SQLite), releasing the DB file
  handle to avoid WinError 32 and ResourceWarning: unclosed database.
- Update SQLite-backed storage tests to deterministically close backends.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:28:26 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 0909b8ff10 fix: add committed E2E validation runner for praisonai-sandbox (fixes #3211)
Add e2e-validation/ bundle with an orchestrated single-command runner
(run_e2e.py), a manual guide, and a README. The runner covers subprocess,
SandboxManager, backward-compat shim, optional Docker, and CLI smoke; exits
non-zero on any required failure and skips Docker/shim gracefully when
unavailable. Also link the runner from the package README.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:26:26 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy a66ba1cddb fix: skip Windows-incompatible sandbox tests (fixes #3214)
Add skipif guards to two tests that fail on default Windows configs:
- test_symbolic_link_resolution: skip when symlink privilege unavailable
- test_timeout_handling_posix: skip on Windows (os.killpg is POSIX-only)

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:26:05 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 819b625be7 fix: stop config walk-up at $HOME so legacy ~/.praison/config.toml isn't mislabelled as project (fixes #3212)
ConfigResolver._load_project_config walked filesystem parents of cwd
and, when cwd was under the user profile, reached $HOME and discovered
the legacy ~/.praison/config.toml as a `project:` source. That file is
already loaded separately by _load_global_config with a `global:` label,
causing a duplicate/mislabelled source and breaking isolated unit tests.

Walk-up now stops at (and never searches) Path.home(), leaving the legacy
global config to the global loader. Real project configs in subdirs and
git repos are still discovered via walk-up.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:25:58 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy d26dcdc7f8 fix: unify praisonai-mcp tool registration for list-tools parity (fixes #3208)
list-tools, tools search|info|schema now call register_all() instead of
register_all_tools(), so they expose the full 86-tool surface matching
serve and doctor instead of the partial 25.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:25:50 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy 0d66f9531a fix: config-generate emits standalone praisonai-mcp command (fixes #3210)
Auto-detect the available entry point via shutil.which so config-generate
emits `praisonai-mcp serve` for standalone installs and remains backward
compatible with `praisonai mcp serve` for umbrella installs. Applies to all
four STDIO client generators (claude-desktop, cursor, vscode, windsurf).

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:25:13 +00:00
praisonai-triage-agent[bot]andDhivya-Bharathy f34ae15fe0 fix: register MCP components before list-resources/list-prompts (fixes #3209)
list-resources and list-prompts read the resource/prompt registries without
calling register_all() first, so they always printed empty results on a fresh
process. Add register_all() to both commands, matching cmd_doctor and cmd_serve.

Co-authored-by: Dhivya-Bharathy <[email protected]>
2026-07-20 09:25:08 +00:00
praisonai-triage-agent[bot]andMervinPraison 825306837e fix: add declarative default-deny gateway method scope registry (fixes #3206)
Add a pure, dependency-free GatewayMethodDescriptor registry to
praisonaiagents/gateway/protocols.py with register_gateway_method and
resolve_required_scope(method, params). Unclassified methods fail closed
(default-deny -> ADMIN), core methods are classified once, and optional
per-payload-field escalation derives stricter scopes (fail-closed on
unknown structural fields).

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 09:24:40 +00:00
praisonai-triage-agent[bot]andMervinPraison 85ec0e7052 fix: add MessagePresentation.question() builder for choice elicitation (fixes #3205)
Add a symmetric counterpart to MessagePresentation.approval() so a prompt
plus options renders as typed reply-action buttons across channels, reusing
the existing quick_replies routing and byte-safe callback encoding. Closes
the 'no question(...) counterpart' gap without a parallel store/protocol.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 09:23:48 +00:00
praisonai-triage-agent[bot]andMervin Praison 38a7955411 fix: correct local endpoint probe URL + endpoint-keyed cache (#3200)
- Probe Ollama's native /api/tags at the server root so a base URL ending
  in /v1 is not mangled into /v1/api/tags; add an OpenAI /v1/models fallback
  so generic local servers (llama.cpp/LM Studio/vLLM) are detected.
- Prefix detected models by provider (ollama/ vs openai/) instead of always
  assuming Ollama.
- Key the probe cache by resolved endpoint so a mid-process OPENAI_BASE_URL /
  OLLAMA_HOST change never returns a stale positive/negative.
- Add regression tests for both fixes.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 09:02:10 +00:00
praisonai-triage-agent[bot]andMervin Praison 4c0b1bf202 fix: keep legacy config read-only and align PRAISONAI_HOME tilde expansion
Address two P1 review findings on the CLI home unification:

- Writes (config set/reset) always target the canonical ~/.praisonai via a
  new get_user_config_write_path(), migrating any existing legacy values
  forward while leaving ~/.praison read-only.
- setup's get_praison_home() now expands ~ in PRAISONAI_HOME so setup and the
  config resolver resolve the override to the same directory.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 08:59:46 +00:00
praisonai-triage-agent[bot]andMervinPraison c944bddfb2 fix: keyless local-first first run via local model auto-detection (fixes #3200)
Probe for a reachable local OpenAI-compatible endpoint (Ollama) and use it as
the zero-config default when no cloud key is configured, downgrading the
interactive API-key wall to a non-blocking suggestion. Non-TTY/CI still fails
fast when nothing is detected.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 08:55:12 +00:00
praisonai-triage-agent[bot]andMervinPraison d6f2966aae fix: single source of truth for canonical CLI session stores (fixes #3201)
Collapse the duplicated "which stores back a CLI session" enumeration onto
one helper so list/continue/resume and show/export/delete address the same
stores in the same order by construction, instead of two hand-kept copies.

- project_sessions.canonical_cli_stores(): single enumerator used by
  list_project_sessions, find_last_session (via _resolve_usage_store) and
  session_exists_anywhere.
- session_resolver._canonical_stores() now delegates to it, removing the
  parallel store list that caused repeated list-vs-resume drift.
- commands/session._create_backend defaults now anchor under the canonical
  data home (~/.praisonai) instead of the legacy ~/.praison root, so a
  backend-selected store no longer silently splits sessions across two homes.
- Regression test asserting the list-path and resolver-path enumerate
  identical store instances.

Kept minimal and backward-compatible: no public API/flag removed, protocol
unchanged, no store rewrite/migration (deferred to the home-unification
effort the issue references).

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 08:54:10 +00:00
praisonai-triage-agent[bot]andMervinPraison dd4339b640 fix: unify CLI home root on canonical ~/.praisonai (fixes #3199)
Re-root cli/configuration/paths.py on the core praisonaiagents.paths
canonical home (get_data_dir): PRAISONAI_HOME override, ~/.praisonai
default, ~/.praison legacy fallback. This makes the home every command
uses (sessions/traces/logs/cache/state/model-recency) the same directory
`setup` writes config into. Legacy ~/.praison/config.toml is kept as a
read-only fallback so existing installs keep resolving until migrated.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 08:52:36 +00:00
praisonai-triage-agent[bot]andMervin Praison 6d88f48b45 fix: cancel stderr reader on stream timeout; normalize availability cache keys
- integrations/base.py: on the stream_async timeout/early-exit path, cancel and
  await the concurrent stderr reader task so it cannot outlive the generator as
  a pending task or surface an uncollected exception on the caller's loop.
- framework_adapters/registry.py: key the availability cache by the lowercased
  name (matching PluginRegistry.resolve's case-insensitivity) so
  invalidate_availability("crewai") clears a prior is_available("CrewAI") result.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 08:38:47 +00:00
praisonai-triage-agent[bot]andMervinPraison ca5a0c4a36 fix: harden wrapper hot paths — stream timeout, async run_background, adapter reuse (fixes #3197)
- integrations/base.py: apply timeout to stream_async via deadline +
  asyncio.wait_for on each stdout read and the stderr/wait drain, so a
  stalled subprocess can no longer hang forever (timeout was dead code).
- recipe/operations.py: split run_background into async-native
  arun_background + a sync entry that routes through the _async_bridge,
  which raises a clear error when called from a running loop instead of
  deadlocking; export arun_background.
- framework_adapters/registry.py: memoise availability probes per process
  (with invalidate_availability test hook) and protocol validation per
  adapter class, eliminating repeated adapter construction + inspect on
  the run()/arun() hot path.
- _entrypoint.py/agents_generator.py: resolve the adapter once and thread
  it into AgentsGenerator so the winning adapter is not constructed twice.

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 08:30:38 +00:00
praisonai-triage-agent[bot]andMervin Praison e52b02cef9 fix: disambiguate session chat-history restore via explicit agent_key tag
Bulk agent chat-history restore parsed composite session ids by stripping
the "{session_id}_" prefix, so overlapping caller-supplied ids could load
another conversation under the wrong agent_key (Greptile P1/Security).

Save now tags each child session with parent_session_id + agent_key metadata;
list_sessions surfaces agent_key; bulk restore resolves the exact agent_key
from those tags and only falls back to prefix-stripping for legacy untagged
sessions. Backward compatible; no new params or exports.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-20 07:31:10 +00:00
praisonai-triage-agent[bot]andMervinPraison 6e6a49e3cf fix: enforce async tool hooks, validate process, fix session restore (fixes #3195)
Gap 1: execute_tool_async now runs BEFORE_TOOL/AFTER_TOOL security hooks so
the primary async path (achat -> _execute_unified_achat_completion) no longer
silently skips HookRegistry gating. Zero-overhead when no hooks are registered.

Gap 2: PraisonAIAgents.__init__ raises ValueError for unknown process values
instead of silently running zero tasks; docstring corrected (parallel fan-out
is async_execution=True on tasks, not process="parallel").

Gap 3: Session chat-history restore now reads SessionStore first, mirroring the
save path introduced by the G-2 refactor, so resumed sessions recover history.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2026-07-20 07:22:43 +00:00
praisonai-triage-agent[bot]andMervin Praison f378222a8f fix: order eval context table by key length and guard canonical overlap
Sort DEFAULT_CONTEXT_LENGTHS by descending key length so get_context_length's
partial matching checks specific model names (e.g. gpt-4-32k) before shorter
prefixes (e.g. gpt-4), fixing gpt-4-32k-0314 resolving to 8192 instead of 32768.
Add a module-load assertion so eval-only extras can never silently shadow
canonical MODEL_LIMITS entries.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 17:25:37 +00:00
praisonai-triage-agent[bot]andMervin Praison 79e921cfd7 fix: memoize ToolSearchConfig resolver to keep fallback class stable
Cache the resolved ToolSearchConfig (including the ImportError fallback)
in a module-level sentinel so _resolve_tool_search_config() returns a
single stable class object. Without this, the fallback path defined a
fresh dataclass per call, breaking isinstance() passthrough across
resolve_tool_search() invocations. This also converges the __getattr__
and resolve_tool_search resolution paths on the same cached class.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 17:24:34 +00:00
praisonai-triage-agent[bot]andMervinPraison a9cd7d986b fix: consolidate model context-window tables to close eval gpt-5/gpt-4.1 gap (fixes #3192)
Build eval/tokens DEFAULT_CONTEXT_LENGTHS from the canonical
context/budgeter.MODEL_LIMITS plus eval-specific extras, so gpt-5 and
gpt-4.1 resolve to their real 1M window in the eval path. All prior eval
keys (dated snapshots, o1/mistral/deepseek/groq) are preserved.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 17:17:58 +00:00
praisonai-triage-agent[bot]andMervinPraison 91fca04f8f fix: defer ToolSearchConfig import to avoid eager tools subsystem load (fixes #3191)
Replace the eager module-level ToolSearchConfig alias in
config/feature_configs.py with a PEP 562 __getattr__ so that
`from praisonaiagents import Agent` no longer initialises the entire
tools subsystem just to re-export a backward-compat alias.

- ToolSearchConfig is resolved (and tools.tool_search imported) only on
  first attribute access, then cached.
- ToolSearchParam uses a string forward reference.
- resolve_tool_search lazy-imports the config when tool search is used.
- ImportError fallback semantics and all import paths preserved.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 17:17:45 +00:00
MervinPraison 4bb3911874 Release v4.6.153 2026-07-19 10:35:20 +00:00
MervinPraison a59af708d7 Bump praisonai-sandbox to 0.0.3 2026-07-19 10:35:14 +00:00
MervinPraison 15d7c161a1 Bump praisonai-mcp to 0.0.5 2026-07-19 10:35:08 +00:00
MervinPraison ddf4a80080 Bump praisonai-browser to 0.0.5 2026-07-19 10:35:03 +00:00
MervinPraison e31588a8d3 Bump praisonai-train to 0.0.8 2026-07-19 10:34:57 +00:00
MervinPraison 90d5c1f7ec Bump praisonai-bot to 0.0.37 2026-07-19 10:34:51 +00:00
MervinPraison ecfdbc5b50 Bump praisonai-code to 0.0.52 2026-07-19 10:34:44 +00:00
MervinPraison 33a6ee2b8b Bump praisonaiagents to 1.6.156 2026-07-19 10:34:36 +00:00
praisonai-triage-agent[bot]andMervin Praison b076806626 fix: make Textual denial-reason contract honest and consistent
- tool_panel.py ApprovalResponse message now carries optional reason
  (backward-compatible default None), matching the interactive events
  ApprovalResponse contract for the live y/n approval path.
- Clarify ApprovalDialog.on_button_pressed docstring: the live Textual
  TUI approves/denies via the tool_panel y/n handler and does not yet
  collect a reason, so the param is not misleadingly presented as active.

Addresses Greptile P2 on PR #3180.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 10:29:25 +00:00
praisonai-triage-agent[bot]andMervinPraison d039bf3001 fix: capture denial reason in interactive CLI approvals to steer agent (fixes #3177)
Add an optional reason field to the interactive ApprovalResponse and prompt
for a one-line correction on Reject in the Rich and Textual frontends,
mirroring the console approval backend. Empty input preserves plain denial.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 10:29:25 +00:00
praisonai-triage-agent[bot]andMervin Praison 5f164d1b72 fix: escape rich markup in change preview and synthesise diff for edit
- rich_frontend/textual_frontend: escape preview via rich.markup.escape so
  diffs/content containing bracket chars no longer raise MarkupError and crash
  the approval dialog (Greptile P1)
- events.render_change_preview: synthesise a unified diff from old_string/
  new_string for edit calls lacking a precomputed diff (Greptile P2)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 10:29:24 +00:00
praisonai-triage-agent[bot]andMervinPraison 31f5a4c9fe fix: show change preview before approving file-mutating tools in interactive CLI (fixes #3179)
Render a unified diff (edit/apply_patch) or truncated new content (write)
before prompting for approval in the interactive Rich and Textual frontends,
so users approve the concrete change rather than just a tool label. Adds a
shared render_change_preview helper and ApprovalRequest.change_preview() in
the interactive events module, mirroring approval_backend._render_preview.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 10:29:24 +00:00
praisonai-triage-agent[bot] 7ef008ef6b Merge pull request #3182 from MervinPraison/claude/issue-3178-20260719-0852
fix: interactive approval defaults to narrow command-scoped grant
2026-07-19 10:26:40 +00:00
praisonai-triage-agent[bot]andMervin Praison 3a4b94beab fix: normalise blank route profile to None (fail-closed)
Empty/whitespace-only profile strings were passing through _as_opt_str
as non-None values, making them indistinguishable from a named scope
and violating the documented 'None means unscoped' fail-closed contract.
Mirror the existing trust normalisation in __post_init__ and add tests.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 09:52:41 +00:00
praisonai-triage-agent[bot]andMervinPraison 445f9f68f4 fix: add per-route isolated tenant profile dimension to gateway routing (fixes #3189)
Adds an optional `profile` field to the core RouteBinding routing contract
and surfaces the matched profile via RouteMatch/resolve_route. This gives
each route a named isolation scope the wrapper can key its memory namespace
/ secret scope off, so one gateway can multiplex tenants. Resolution is
most-specific-wins and fails closed: an unmatched route carries profile=None
and never inherits another tenant's profile.

Core-only, backward-compatible (all fields optional), no new deps/exports.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 09:46:40 +00:00
praisonai-triage-agent[bot]andMervin Praison 913122f106 fix: harden Slack effectively-once delivery (missing-scope fallback, threads, first-send key)
Addresses reviewer findings on PR #3187:
- Graceful at-least-once fallback when metadata.message:write scope is absent
  (was a permanent message-loss regression on apps without the scope).
- Reconcile threaded sends via conversations.replies (history excludes replies).
- Forward idempotency_key on the initial send path, not just crash-recovered drain.
- Gate key forwarding on an explicit idempotency_key param (drop **kwargs fallback).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 09:36:08 +00:00
praisonai-triage-agent[bot]andMervin Praison a9a4a8b0b9 fix: resolve durable pending row on all approval early-exit/exception paths
Slack, Telegram, Discord, and Webhook approval backends persisted the
pending approval before polling but skipped _resolve_pending on their
early-return guards (missing chat/channel id, failed send) and outer
except handlers. This left stale status='pending' rows that rehydrate()
surfaced as false-positive outstanding approvals after a restart.

Each missed exit path now records the fallback denial via _resolve_pending
before returning, matching the HTTP reference backend. Adds regression
tests for the early-exit and exception paths.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 09:29:23 +00:00
praisonai-triage-agent[bot]andMervin Praison 4a6f48d50f fix: propagate transient Discord media errors so retry applies (#3184)
The Discord native upload branch caught all exceptions and returned
False, so a transient blip bypassed deliver_with_retry entirely and the
file was silently dropped — the exact gap this PR set out to close, but
only Telegram/Slack got it. Let transport errors propagate (matching the
other transports) so the retry wrapper backs off and retries; only the
missing optional discord dependency is caught locally, and unresolved
channels still fall through to the no-primitive False return.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 09:25:09 +00:00
praisonai-triage-agent[bot]andMervinPraison db121c4923 fix: implement exactly-once delivery reconciliation on Slack adapter (fixes #3185)
The outbox's crash-reconciliation seam shipped unused: no channel adapter
implemented was_delivered() or declared reconciles_unknown_send, so every
built-in channel fell back to at-least-once (a duplicate on restart).

Slack can read back recent channel history and match a client-side idempotency
key stamped into the message metadata, so it now opts into effectively-once:
  - SlackBot declares reconciles_unknown_send=True and implements was_delivered()
    via conversations.history, matching the key in message metadata.
  - send_message stamps the idempotency key into Slack metadata when provided.
  - DurableDelivery carries the idempotency key in the outbox payload and
    forwards it to adapters whose send_message accepts it (backward-compatible).
  - _build_reconciler now passes the target channel to was_delivered when its
    signature accepts it (legacy single-arg form still supported).

Channels whose platform cannot confirm delivery stay at-least-once by design.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 09:20:27 +00:00
praisonai-triage-agent[bot]andMervinPraison 22213c663e fix: make chat approval backends durable across restart (fixes #3183)
Chat approval backends (Slack, Telegram, Discord, Webhook, HTTP) held the
pending approval only in an in-memory polling coroutine, so a gateway/bot
restart while an approval was outstanding stranded the blocked agent run.

Add an opt-in DurableApprovalMixin to the shared _approval_base module that
wraps the existing ApprovalStore: it persists the request before polling,
records the final decision, and exposes rehydrate() to recover outstanding
approvals on startup. Each chat backend now accepts an optional store= and a
shared DEFAULT_APPROVAL_TIMEOUT. When no store is given behaviour is unchanged
(fully backward-compatible); no new dependency is introduced.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 09:20:22 +00:00
praisonai-triage-agent[bot]andMervinPraison ba213c94ef fix: give outbound media the same retry/backoff as text (fixes #3184)
Media uploads via DeliveryRouter.send_media were attempted exactly once —
a transient transport blip (HTTP 5xx, rate limit, connection reset) silently
dropped the file while the accompanying text was delivered durably. Text gets
resilience because adapters wrap send_message in deliver_with_retry (bounded
exponential backoff honouring server Retry-After); the raw media upload path
reached none of it.

Wrap the media upload in the same deliver_with_retry helper, reusing the
adapter's already-configured backoff policy when present. Non-retryable
outcomes are preserved: an adapter with no upload primitive still returns
False without retrying, and a permanent error still surfaces as a failed send.

No new params, modules, exports, or schema — the minimal wiring that closes
the reliability gap.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 09:17:44 +00:00
praisonai-triage-agent[bot]andMervin Praison 0025b9dcee fix: address reviewer feedback on interactive approval scoping
- events.py: log at DEBUG on unexpected derive_pattern failure instead of
  silently swallowing (ImportError still falls back cleanly)
- rich_frontend.py / textual_frontend.py: drop extraneous f-string prefixes (Ruff F541)
- textual_frontend.py: Session Only button now shows the narrow pattern it
  persists; derive both patterns once in __init__ so displayed and stored
  patterns are guaranteed identical

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 09:10:46 +00:00
praisonai-triage-agent[bot]andMervinPraison 799db08546 fix: interactive approval defaults to narrow command-scoped grant (fixes #3178)
Interactive Rich/Textual frontends persisted a blanket action_type:* pattern
on "Always allow", silently whitelisting every use of a tool from a single
benign approval. Add a shared derive_permission_pattern helper (mirroring the
console backend's _create_pattern) that scopes shell commands to a reusable
command-prefix and other tools to the concrete path, never emitting the blanket
grant unless the user picks the explicit "allow all uses of this tool" option.

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 08:56:51 +00:00
praisonai-triage-agent[bot]andMervin Praison deac48c837 fix: guard None roles/agents in timeout+cli-backend resolvers, drop redundant os import
- _resolve_effective_tool_timeout and _validate_cli_backend_compatibility now
  fall back to {} when roles/agents are explicit YAML nulls, preventing a
  TypeError on dict unpacking (CodeRabbit).
- Remove redundant inner `import os` in _strict_validation_enabled; os is
  already imported at module top (Greptile).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 08:33:37 +00:00
praisonai-triage-agent[bot]andMervinPraison 2d71956ec5 fix: surface silent YAML/timeout collapses and unblock nested skill paths (fixes #3175)
- _normalize_yaml_config: detect duplicate agent/task names and unknown
  task agent refs; raise under PRAISONAI_VALIDATE_STRICT or warn loudly and
  preserve both entries by suffixing, instead of silently dropping.
- _resolve_effective_tool_timeout: apply the tightest (min) declared
  tool_timeout to the shared tool dict and warn on any overridden agent,
  so a fast agent is never silently forced to wait a slower agent's budget.
- BasicSkillMutator._is_safe_path: allow nested skill files (references/,
  scripts/, assets/) while still rejecting absolute paths and parent
  traversal; real containment stays enforced by the caller's resolve().

Co-authored-by: MervinPraison <[email protected]>
2026-07-19 08:22:37 +00:00
praisonai-triage-agent[bot]andMervin Praison 175cf281a9 fix: guard callback restore under identity check + async-aware task hooks
- execution_mixin: nest sync_display_callbacks restore fully under the
  status_tool_callback identity check so a finishing agent can't clobber a
  concurrent agent's live callback (3+ verbose-TTY agents race).
- agents: shallow-copy self.variables into task.variables so tasks can't
  mutate shared AgentTeam state.
- agents: add async-aware _arun_task_start_hook/_arun_task_complete_hook that
  await coroutine lifecycle callbacks and offload sync ones to the executor,
  so arun_task never blocks the loop or silently drops an async hook.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 07:23:33 +00:00
praisonai-triage-agent[bot]andMervin Praison c804d93e31 fix: async lifecycle hooks + locked display-callback swap (fixes #3173)
Gap 1: arun_task() now fires on_task_start/on_task_complete and propagates
self.variables, matching run_task(). Extracted _run_task_start_hook and
_run_task_complete_hook shared helpers so both sync and async paths stay in
sync (mirrors the _apply_task_guardrail helper pattern).

Gap 3: verbose+TTY status animation now swaps and restores the shared
sync_display_callbacks['tool_call'] entry under main.py's existing
_callbacks_lock, with an identity check on restore so concurrent verbose
agents don't clobber each other's entry.

Gap 2 (Memory adapter-protocol bypass) intentionally deferred: routing 34
vendor-specific call sites through the protocol is a large architectural
refactor with high regression risk, out of scope for a minimal fix.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-19 07:15:39 +00:00
praisonai-triage-agent[bot]andMervinPraison 26900f45ff fix: gate BEFORE_TOOL_DEFINITIONS deepcopy behind has_hooks (fixes #3171)
Deep-copy of formatted tool schemas now only runs when a
BEFORE_TOOL_DEFINITIONS hook is actually registered, matching the
has_hooks fast-path idiom used by every other hook event.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 17:14:36 +00:00
praisonai-triage-agent[bot]andMervin Praison 61ae7aaae9 fix: build orchestrator session lazily so resume path never touches agent identity
Addresses Greptile review: on_agent_start/aon_agent_start constructed a
ConversationSession eagerly on every call, reading agent.name/agent.agent_id
and building an object discarded on resume. Move construction into the
build_session factory (create-branch only) while capturing the created
instance for identical cache identity/timestamps.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 16:28:14 +00:00
praisonai-triage-agent[bot]andMervinPraison 17702d422c fix: extract shared conversation-store session flow to one owner (fixes #3167)
Deduplicate the create-or-resume session logic that PraisonAIDB and
PersistenceOrchestrator each reimplemented across their sync and async
surfaces. A new internal helper persistence/conversation/_ops.py owns the
store-level flow; both classes call it while keeping their distinct
return-type contracts (DbMessage vs ConversationMessage), caching, and
lock/cooldown machinery. Behaviour-preserving.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 16:21:19 +00:00
praisonai-triage-agent[bot]andMervinPraison a531d4368e fix: make call feature guard detect missing optional deps (fixes #3168)
Co-authored-by: MervinPraison <[email protected]>
2026-07-18 16:17:03 +00:00
MervinPraison 882143d7a4 docs: auto-update feature parity trackers [skip ci] 2026-07-18 10:47:22 +00:00
praisonai-triage-agent[bot] cc4593b4cd Merge pull request #3166 from MervinPraison/claude/issue-3165-20260718-0944
fix: verify webhook signatures, filter events & deliver-only hooks
2026-07-18 10:46:57 +00:00
praisonai-triage-agent[bot] 2901c32413 Merge pull request #3163 from MervinPraison/claude/issue-3159-20260718-0913
fix: isolate degraded channel on unavailable secret instead of aborting gateway boot
2026-07-18 10:07:16 +00:00
praisonai-triage-agent[bot]andMervin Praison d03662c006 fix: fail-closed subtype filter, default sig header, skip empty deliver_only
Address final-review findings on #3166:
- event_allowed: namespaced sub-type (issues.opened) now requires the
  payload to carry a matching action; a missing action no longer admits a
  bare base event (fail-closed).
- HookConfig: a secret with no explicit signature_header defaults to
  X-Hub-Signature-256 instead of rejecting every request.
- gateway server: deliver_only with an empty rendered message is a no-op
  and never hits the delivery backend (avoids 500/retry loops).
- Add unit tests for the fail-closed subtype filter and default header.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:58:24 +00:00
praisonai-triage-agent[bot]andMervinPraison 97199f5a23 fix: verify webhook signatures, filter events & deliver-only hooks (fixes #3165)
Extend the generic inbound trigger (POST /hooks/<path>) so a hook can
verify a provider HMAC signature over the raw body, filter by event
type, and deliver a rendered message with no LLM turn — all additive
and backward compatible.

- core (gateway/hooks.py): add pure verify_webhook_signature() helper and
  additive HookConfig fields (secret/signature_header/signature_algo/
  signature_prefix/events/event_header/deliver_only) plus verify_signature/
  resolve_event/event_allowed; round-trip via to_dict/from_dict (secret
  redacted); export the helper.
- wrapper (gateway/server.py): read the raw body once, reject invalid/
  missing signatures with 401 before any agent runs, 200 no-op on
  filtered-out events, and short-circuit deliver_only straight to delivery.
- wrapper (bots/_config_schema.py): mirror the new fields on HookSchema.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 09:53:00 +00:00
MervinPraison 345f15fda2 Release v4.6.152 2026-07-18 09:38:25 +00:00
MervinPraison df407273c2 Bump praisonai-sandbox to 0.0.2 2026-07-18 09:38:19 +00:00
MervinPraison 5cda323c79 Bump praisonai-mcp to 0.0.4 2026-07-18 09:38:13 +00:00
MervinPraison 536d0946a8 Bump praisonai-browser to 0.0.4 2026-07-18 09:38:07 +00:00
MervinPraison ace52b0fa5 Bump praisonai-train to 0.0.7 2026-07-18 09:38:01 +00:00
MervinPraison a4f0187ba5 Bump praisonai-bot to 0.0.36 2026-07-18 09:37:55 +00:00
MervinPraison 8220d4c745 Bump praisonai-code to 0.0.51 2026-07-18 09:37:18 +00:00
MervinPraison 8c93f2ce2a Bump praisonaiagents to 1.6.155 2026-07-18 09:37:10 +00:00
praisonai-triage-agent[bot]andMervin Praison a203b075ce test: align windows scheduled-task test with wrapper /TR command
The pre-existing test_windows_scheduled_task_command_is_well_formed asserted
`--config` appeared inline in the /TR value. This PR intentionally routes the
scheduled task at the generated .cmd wrapper (single, well-formed quoting) to
avoid the nested-quote hazard for paths with spaces, so /TR now points at the
wrapper path and the wrapper owns the --config invocation. Assert the new,
intended contract instead of the outdated implementation detail.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:32:08 +00:00
praisonai-triage-agent[bot] dd97109d2f Merge pull request #3152 from MervinPraison/claude/issue-3151-20260718-0821
fix: generator-owned observability lifecycle + DI-aware framework validation
2026-07-18 09:29:00 +00:00
praisonai-triage-agent[bot]andMervin Praison 724e65ca46 fix: surface credential-degraded channels in gateway health() (#3159)
Close the observability gap flagged in review: a channel skipped at
startup because its credential was unavailable was never added to
_channel_bots, so health() omitted it entirely — indistinguishable
from a channel that was never configured. Track skipped channels in
_degraded_channels (cleared on recovery in both start_channels and the
hot-reload single-channel path) and report them as `degraded` in
health(). No new config keys, params, or API surface.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:27:11 +00:00
praisonai-triage-agent[bot]andMervin Praison 6600790f80 fix: propagate gateway exit code from praisonai_bot daemon command; harden Windows task quoting (#3160)
The installed daemons run python -m praisonai_bot gateway start, whose Typer command discarded GatewayHandler.start()'s int return. Typer ignores a returned int, so the process always exited 0 - the generated units' Restart=on-failure / RestartPreventExitStatus=78 / KeepAlive.SuccessfulExit directives never saw the real fatal-config (78) / transient (75) code, making the whole feature inert. Surface it via typer.Exit.

Also replace the Windows scheduled-task's fragile inline cmd /c string (nested quotes that misparse paths under C:\Program Files) with a single quoted path to the generated .cmd wrapper, which already owns the exit-78 translation.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:24:05 +00:00
praisonai-triage-agent[bot]andMervinPraison 8f94c605d0 fix: isolate degraded channel on unavailable secret instead of aborting gateway boot (fixes #3159)
A gateway fronting several channels no longer fails closed for the whole
process when a single channel credential is temporarily unavailable
(rotation, expiry, unset env var, secret-store blip). The channel token
validator now returns an empty (degraded) token instead of raising, so the
runtime's existing "no token -> skip channel" path isolates just that
channel while every healthy channel keeps serving. gateway status/doctor
already report per-channel availability, so the degraded state stays
queryable. Fail-closed remains for structurally invalid config and the
gateway's own ingress/auth secret.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 09:20:04 +00:00
praisonai-triage-agent[bot]andMervinPraison 66b27eff12 fix: honour gateway fatal-config exit code in installed daemons (fixes #3160)
Installed supervisor units restarted the gateway unconditionally, so the
runtime's fatal-config exit (78, EX_CONFIG) was discarded and a broken
config crash-looped forever. Map the existing core exit-code contract to
per-OS restart directives:

- systemd: Restart=on-failure + RestartPreventExitStatus=78 +
  StartLimitBurst=5 (bounded restarts).
- launchd: KeepAlive dict (SuccessfulExit=false, Crashed=true) +
  ThrottleInterval so a clean/fatal exit is not relaunched every few
  seconds.
- windows: wrap the scheduled task / startup script so exit 78 maps to a
  clean stop instead of a relaunch.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 09:16:42 +00:00
praisonai-triage-agent[bot]andMervin Praison c1830d32ec fix: preserve project identity, raise scan limit, surface store-read failures in usage
Addresses reviewer P1 findings on `praisonai usage`:
- Read current-project and global stores separately so `--by project`
  no longer collapses both sources into a single `current` bucket.
- Raise per-store scan limit (1000 -> 100_000) so large stores are not
  silently truncated (also affects `--days 0`).
- Surface store-open/read failures via warnings (table) and an `errors`
  field (JSON) instead of reporting them as empty usage.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:01:53 +00:00
praisonai-triage-agent[bot]andMervin Praison a752c3c01a fix: harden workspace session isolation (PR #3157 review)
- Honor PRAISONAI_HOME in legacy-session migration lookup via
  get_sessions_dir() instead of a hardcoded ~/.praisonai/sessions path.
- Gate legacy name-only fallback to global scope only, so a workspace-scoped
  run never silently adopts another project's history (isolation, #3154).
- Resolve workspace identity per-directory (cache keyed by cwd) so a
  long-lived process that changes directory gets the correct identity while
  still avoiding repeated git calls per directory.
- Add tests for directory-change identity and global-scoped legacy fallback.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 09:01:38 +00:00
praisonai-triage-agent[bot]andMervin Praison 89fe6c6eef fix: preserve typed ToolResolutionError through Agent toolset path
Strict-mode toolset resolution flattened ToolResolutionError (a ValueError
subclass) into a plain ValueError, dropping .unknown/.suggestions. Re-raise
the typed error before the generic handler and export the resolver API from
praisonaiagents.tools so strict callers can catch it.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 08:59:24 +00:00
praisonai-triage-agent[bot]andMervinPraison 5b74461d69 feat: add zero-config praisonai usage command for local spend/token reporting (fixes #3155)
Aggregates already-persisted per-session total_tokens/cost from the local
session store(s) and reports by day/model/project with --days/--project/--json
filters. Wrapper-only reporting surface; no core change, no new deps.

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 08:55:34 +00:00
praisonai-triage-agent[bot]andMervinPraison 0b951a05c4 fix: workspace-aware default session identity (fixes #3154)
Same-named agents in different projects no longer share conversation
history by default. The auto-derived session id now folds in a stable
workspace/project component (git root-commit, else resolved cwd, else
global) instead of being a function of the agent name alone.

- Add praisonaiagents/session/workspace.py with workspace_id() resolver
- Derive auto id as history_<sha256("{workspace}:{name}")[:8]>
- Keep name-only sha256 + md5 fallbacks so prior sessions still resolve
- Add PRAISONAI_GLOBAL_SESSIONS=true opt-out for name-only continuity

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 08:55:01 +00:00
praisonai-triage-agent[bot]andMervinPraison 6028acc674 fix: self-correcting tool resolution with suggestions and strict mode (fixes #3153)
Unknown/mistyped tool names now surface near-name suggestions via difflib
over the available-tool catalogue (registry + TOOL_MAPPINGS + praisonai-tools).
Adds opt-in strict mode (strict= arg / PRAISONAI_STRICT_TOOLS env) that raises
ToolResolutionError carrying unknown names and suggestions. Default stays
backward-compatible (warn + suggest, no raise).

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 08:53:37 +00:00
praisonai-triage-agent[bot]andMervin Praison 42e498bfe6 fix: close observability setup gap + DI-aware validation fallback (PR #3152 review)
Address the two Greptile findings on PR #3152:

P1 (resolved name not a scoped-registry key): assert_framework_available now
falls back to the process-default registry when an injected/scoped registry
does not recognise a name. A router/alias that resolves to a concrete built-in
(e.g. autogen -> autogen_v2) is no longer falsely rejected, while the DI seam
for genuinely scoped adapters is preserved.

P2 (setup ran outside observability): adapter.setup() moved out of
_prepare_for_run into a small _run_adapter_setup seam invoked INSIDE the
observability_session on both the sync and async kickoff paths, so setup events
and any setup/import failure are recorded and finalized instead of slipping
outside observability.

Tests: added DI fallback coverage and a regression guard that setup runs inside
the session on both paths.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 08:42:27 +00:00
praisonai-triage-agent[bot]andMervinPraison 38bb3d1f04 fix: generator-owned observability lifecycle + DI-aware framework validation (fixes #3151)
Gap 3 from the wrapper-architecture review:

3a. assert_framework_available / get_install_hint now accept an optional
    registry and AgentsGenerator threads its injected _adapter_registry
    through them, so a scoped/per-tenant adapter is no longer rejected just
    because it is absent from the process-default registry.

3b. Observability init+finalize is now owned by AgentsGenerator via the
    existing observability_session context manager (bracketing both the sync
    and async kickoff paths). The by-convention per-adapter finalize calls in
    the CrewAI and PraisonAI adapters are removed. This closes the AutoGen
    leak, where the adapter never called finalize_observability and left an
    ObservabilityRun / emitter swap alive on every invocation.

Tests updated to assert the new invariant (generator owns the lifecycle;
adapters do not finalize) and to cover the DI seam end to end.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2026-07-18 08:33:13 +00:00
praisonai-triage-agent[bot]andMervin Praison 1d48f681ca fix: escalate bare $VAR expansion to ASK, raise on failed Chroma reset
Address two greptile P1 findings on PR #3150:
- command_parser: broaden unsafe-expansion detector to match bare $VAR
  (e.g. `rm -rf $HOME`) in addition to $IFS/${...}; $(...) and backticks
  remain excluded so command substitution stays on the deny-checked
  decomposition path.
- memory.reset_long_term: re-raise on Chroma delete_collection failure so
  a failed reset is not silently reported as success while long-term
  memories remain available.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 07:31:31 +00:00
praisonai-triage-agent[bot]andMervin Praison 87eb8510af fix: close $IFS permission bypass, litellm.callbacks overwrite, cross-agent memory reset (fixes #3149)
- permissions: escalate shell commands containing unresolvable parameter
  expansion ($IFS / ${...}) to ASK instead of letting a broad allow rule
  short-circuit a specific deny. Command substitution ($()/backticks) is
  left to the existing per-op decomposition.
- llm: _setup_event_tracking now no-ops on empty events and merges into the
  process-global litellm.callbacks (tracking per-instance ownership) instead
  of overwriting it, so unrelated agents' callbacks are preserved.
- memory: reset_long_term() deletes only this instance's own Chroma
  collection rather than resetting the entire shared client; collection name
  is now an opt-in config override (default unchanged).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-18 07:24:47 +00:00
MervinPraison 74b5f0f890 docs: auto-update documentation parity trackers [skip ci] 2026-07-17 13:01:50 +00:00
Leebana 7d90c2b020 Merge pull request #3147 from MervinPraison/claude/issue-3021-20260717-1031
fix: wire idle/scale-to-zero, epoch-aware drain, crash-loop guard into gateway server
2026-07-17 14:01:15 +01:00
Leebana 573daf0e7d Merge pull request #3145 from MervinPraison/claude/issue-3022-20260717-1031
fix: add streaming 'auto' mode with logged degradation
2026-07-17 14:00:16 +01:00
praisonai-triage-agent[bot]andMervin Praison e2d84c4f4c fix: wire gateway lifecycle runtime paths (wake, arm, guard, reload)
Address reviewer-found gaps so the opt-in gateway lifecycle policies from
#3021 actually take effect at runtime:

- Wake tracking: notify_inbound()/wake() now fire from the single client
  frame entry point (_handle_client_message) so a live handshake can never
  be quiesced mid-flight.
- CLI scale-to-zero arming: treat the open listening socket as an inherent
  self-wake path so --scale-to-zero (no wake_url) still arms and quiesces;
  an external wake_url is only required when an on_quiesce host-suspend hook
  is configured.
- Idle clock: reset _last_inbound_ts when the idle loop arms so serving,
  not construction, starts the idle interval.
- Crash-loop breaker: consult RestartLoopGuard around the supervised channel
  run so a channel crash-looping within the window stops auto-resuming.
- Reload reconciliation: _reconcile_lifecycle rebuilds policies and cancels/
  relaunches idle + drain-marker loops on hot-reload; unchanged blocks leave
  running tasks untouched.

All opt-in and off by default; always-on gateways are unaffected.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 11:30:37 +00:00
praisonai-triage-agent[bot]andMervin Praison ef04975b0e fix: wire idle/scale-to-zero, epoch-aware drain, crash-loop guard into gateway server (fixes #3021)
Wire the existing pure core lifecycle policies into the primary gateway
runtime (WebSocketGateway), reusing them rather than duplicating BotOS's
machinery:

- ScaleToZeroPolicy: opt-in idle-quiesce loop that quiesces the gateway
  (dormant + optional host-suspend hook) when idle for N minutes with no
  in-flight turn / queued inbound, and wakes on inbound.
- DrainMarkerPolicy + current_epoch: a port-less external drain marker
  watcher checked against the process instantiation epoch, so a stale
  marker left on a durable volume by a machine restart is ignored.
- RestartLoopGuard: a new pure, dependency-free rolling-window predicate
  in core (beside classify_exit_reason) so the crash-loop breaker is
  protocol-driven and reusable by both runtimes.

Exposed via a 3-way surface (YAML `lifecycle:` block, CLI flags
--scale-to-zero/--idle-minutes/--drain-marker, and Python), all opt-in so
always-on gateways are unchanged and fully backward-compatible. Lifecycle
state is surfaced in health() for observability.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 11:30:37 +00:00
praisonai-triage-agent[bot] 2fa527dc9b Merge pull request #3146 from MervinPraison/claude/issue-3020-20260717-1031
fix: wire cross-platform identity resolver through gateway runtime
2026-07-17 11:27:35 +00:00
praisonai-triage-agent[bot]andMervin Praison 77ce9cb059 fix: reconcile gateway identity resolver on hot-reload (#3020)
Greptile P1: the identity resolver was only built at startup, so a changed
top-level identity: block (which triggers a full channel restart) never
rebuilt or cleared _identity_resolver — enabling stayed a no-op and
disabling/re-pointing the store kept the stale resolver.

Route startup and hot-reload through _reconcile_identity_resolver, run
before channels (re)start. Explicit constructor/CLI resolvers always win;
an unchanged block preserves the live resolver (link cache/store handle);
enable installs, disable/remove clears back to per-platform keys.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 10:47:17 +00:00
praisonai-triage-agent[bot]andMervin Praison e030a0e896 fix: log auto->off streaming degradation at warning level
Resolve the Greptile review finding: when 'auto' resolved to 'off' on a
non-editable channel the reason was logged at info, and the explicit
warning branch below was skipped (mode already OFF), so operators
filtering info logs couldn't see why streaming was disabled. Log the
auto->off degradation at warning; auto->draft stays at info. Adds a test.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 10:39:56 +00:00
praisonai-triage-agent[bot]andMervin Praison 5e2ff8655f fix: wire cross-platform identity resolver through gateway runtime (fixes #3020)
The flagship WebSocketGateway never injected an identity_resolver into the
channel bots it created, so each platform fell back to a per-platform session
key (bot_{platform}_{user_id}) and cross-platform conversation continuity
silently broke. Mirror BotOS by stamping a shared resolver onto every channel
bot's session manager.

- WebSocketGateway.__init__ gains an optional identity_resolver (Python override)
- _stamp_identity_resolver() mirrors _stamp_admission_gate; called from
  start_channels and _start_single_channel (hot-reload)
- start_with_config builds a StoreBackedIdentityResolver from a declarative
  top-level identity: block (constructor value wins); degrades gracefully
- CLI gains --identity-store to enable continuity without a YAML block

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 10:39:36 +00:00
praisonai-triage-agent[bot]andMervin Praison ddb8021348 fix: add streaming 'auto' mode with logged degradation (fixes #3022)
Adds StreamingMode.AUTO which resolves to DRAFT where the channel can
edit and OFF otherwise, so streaming turns on where supported instead of
every platform silently sitting on OFF. Degradation is now logged at
warning level, and mode resolution preserves user-set config fields via
dataclasses.replace() instead of resetting to defaults.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 10:35:38 +00:00
Leebana 8baebe5575 Merge pull request #3144 from MervinPraison/claude/issue-3141-20260717-0942
fix: preserve thread_id in DeliveryRouter for threaded outbound delivery
2026-07-17 11:20:21 +01:00
Leebana 894242d4a4 Merge pull request #3143 from MervinPraison/claude/issue-3142-20260717-0943
fix: resolve scheduler 'origin' delivery from persisted target
2026-07-17 11:20:04 +01:00
Leebana c3fda05ada Merge pull request #3140 from MervinPraison/claude/issue-3139-20260717-0914
fix: back gateway dead-target registry with canonical SQLite store
2026-07-17 11:19:51 +01:00
Leebana dace36c315 Merge pull request #3137 from MervinPraison/claude/issue-3135-20260717-0854
fix: retry transient LLM errors by default on native path
2026-07-17 11:19:36 +01:00
Leebana 0507b09fbf Merge pull request #3136 from MervinPraison/claude/issue-3133-20260717-0853
fix: unify CLI session identity across session sub-commands
2026-07-17 11:19:21 +01:00
Leebana 35e5230187 Merge pull request #3132 from MervinPraison/feat/c13-gap-closure
fix: close C13 post-merge gaps — CLI, Daytona, live tests
2026-07-17 11:19:01 +01:00
Leebana 4157eed374 Merge pull request #3131 from MervinPraison/claude/issue-3130-20260717-0714
fix: MCP client leaks, cross-agent circuit-breaker bleed, dead llm getattr fallback
2026-07-17 11:18:39 +01:00
Leebana dcfd52fefc Merge pull request #3128 from MervinPraison/claude/issue-3125-20260716-1713
fix: dedupe tool schema build in tools/base.py
2026-07-17 11:18:11 +01:00
Leebana c437501672 Merge pull request #3127 from MervinPraison/claude/issue-3126-20260716-1713
fix: merge duplicated streaming tool-call accumulation logic
2026-07-17 11:17:59 +01:00
Leebana 7024dcba4a Merge pull request #3124 from MervinPraison/claude/issue-3122-20260716-1616
fix: stop re-implementing praisonai-tools discovery in tool_override (#3122)
2026-07-17 11:17:47 +01:00
Leebana 8b11d60d39 Merge pull request #3123 from MervinPraison/claude/issue-3121-20260716-1616
fix: memoise ToolResolver in resolve_tools to avoid per-agent rebuild
2026-07-17 11:17:31 +01:00
Leebana c0ec3330dc Merge pull request #3119 from MervinPraison/claude/issue-3095-20260716-1136
fix: prevent dual-session stale-lock deadlock in praisonai-browser
2026-07-17 11:16:34 +01:00
praisonai-triage-agent[bot]andMervin Praison 3f49093892 fix: correct session delete/resolve store-boundary and failure handling (#3133)
Address reviewer P1s in the CLI session resolver:
- Honor DefaultSessionStore.delete_session() return value so an I/O
  failure is no longer reported as a successful deletion.
- Delete against the single store resolve_session() selected instead of
  every canonical store, so a project-scoped delete can't remove an
  unrelated same-id session living only in the global store.
- Always sweep the legacy SessionManager store on delete so a duplicate
  legacy record can't resurface a session the CLI reported as deleted.
- On a read failure of the owning canonical store, report not-found for
  that record instead of silently falling through to a different same-id
  session or the legacy store.

Adds regression tests for the failed-delete, legacy-duplicate sweep, and
read-failure cases.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 10:05:20 +00:00
praisonai-triage-agent[bot]andMervin Praison cd48dc8210 fix: route outbound media into resolved thread (parity with text path)
DeliveryRouter.send_media discarded the resolved thread_id, so a threaded
target (Slack thread_ts, Telegram forum topic, Discord thread) delivered
text into the thread but attachments to the parent chat. Thread the
thread_id through deliver_media_to_adapter, forwarded via each transport's
native keyword (Telegram message_thread_id, Slack thread_ts, Discord thread
channel) only when the primitive accepts it, so adapters lacking thread
support are unaffected. Mirrors the text path's _accepts_thread_id guard.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 09:55:26 +00:00
praisonai-triage-agent[bot]andMervin Praison 5130df9ee8 fix: wire persisted scheduler origin into delivery path (#3142)
Both AgentScheduler and AsyncAgentScheduler constructed SchedulerDelivery
without the persisted origin, so deliver="origin" silently no-op'd in
production despite the resolution logic existing. Add
SchedulerDelivery.origin_from_config to normalise the origin carried in
the job config (DeliveryTarget or serialised dict) and pass it through at
both call sites, so origin delivery actually activates on the lightweight
path.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 09:54:37 +00:00
MervinPraison 06657eec9b docs: auto-update documentation parity trackers [skip ci] 2026-07-17 09:53:06 +00:00
praisonai-triage-agent[bot] ea920599b6 Merge pull request #3138 from MervinPraison/claude/issue-3134-20260717-0854
fix: activate path-scoped (glob) rules during agentic runs
2026-07-17 09:52:36 +00:00
praisonai-triage-agent[bot]andMervinPraison f0c3b415d6 fix: resolve scheduler 'origin' delivery from persisted target (fixes #3142)
The lightweight scheduler delivery path silently no-op'd for the symbolic
'origin' token because it required a live gateway session. ScheduleJob.origin
already persists a concrete DeliveryTarget at creation, so SchedulerDelivery
now accepts it and rewrites 'origin' to a concrete channel:channel_id[:thread_id]
route — delivering back to the point of origin without the full gateway. 'all'
and the absent-origin case still degrade with a clear warning.

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 09:48:22 +00:00
praisonai-triage-agent[bot]andMervinPraison ac45cad9e6 fix: preserve thread_id in DeliveryRouter for threaded outbound delivery (fixes #3141)
DeliveryRouter.resolve() now returns (platform, channel_id, thread_id) and
deliver() threads thread_id into the adapter's send_message so proactive/
scheduled/agent-initiated messages targeting a Slack thread, Telegram forum
topic, or Discord thread land in the intended thread instead of the parent
channel. Adapters lacking a thread_id parameter are introspected and left
untouched (no behaviour change). The lightweight scheduler route and the
gateway scheduled-delivery path now build platform:channel:thread routes and
drop the _ThreadBindingBot workaround, routing through the shared resilient
router directly.

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 09:48:14 +00:00
praisonai-triage-agent[bot]andMervinPraison 74c86749a2 fix: back gateway dead-target registry with canonical SQLite store (fixes #3139)
The gateway server constructed DeadTargetRegistry() with no store, so it
persisted dead targets to the node-local dead_targets.json sidecar even
though a canonical SQLite dead_targets table already exists in the shared
DeliveryControlStore. This retires the duplicate JSON store for the gateway
path, making the SQLite table the single, cross-worker source of truth.
Falls back to the JSON default only if the SQLite store cannot be built.

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 09:17:49 +00:00
praisonai-triage-agent[bot]andMervinPraison d8e867d91b fix: activate path-scoped (glob) rules during agentic runs (fixes #3134)
Path-scoped rules (activation: glob) never fired at runtime because the
single rule-injection point built the system prompt with no file path.
Now _build_system_prompt scans the conversation for touched file paths
and appends matching glob rules per-turn, deduped against always/manual
rules and appended after the cache so it is never baked in. Gated on
RulesManager.has_glob_rules() so glob-free workspaces pay nothing. Also
fixes matches_file so a recursive pattern like **/*.py matches a bare
filename (foo.py).

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 09:02:35 +00:00
praisonai-triage-agent[bot]andMervinPraison 33614eaa2f fix: retry transient LLM errors by default on native path (fixes #3135)
Give the native OpenAI-client path the same default retry contract as the
LiteLLM path. A default Agent now applies RetryBackoffConfig() (max_retries=3)
so transient errors (429/overload/5xx) are retried consistently regardless of
which internal LLM path executes the turn. retry=False disables; retry=True/
dict/RetryBackoffConfig remain fully overridable. Reuses the existing native
retry loop (is_retryable classification, jittered backoff, ON_RETRY hook).

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 08:59:51 +00:00
praisonai-triage-agent[bot]andMervinPraison 4bdd7c216c fix: unify CLI session identity across session sub-commands (fixes #3133)
Route `session show`/`delete`/`export` through a single `resolve_session`
resolver that searches the same project-scoped + global stores used by
`session list`/`resume`/`run --continue`, so any id a user can list or
resume is fully manageable. Keeps a best-effort fallback to the legacy
SessionManager store during a deprecation window.

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 08:59:30 +00:00
praisonai-triage-agent[bot]andMervin Praison 0b8af8bf8d fix: Daytona memory GiB, upload_file arg order, execute_file args, CLI daytona type
- Convert ResourceLimits.memory_mb (MiB) to GiB for Daytona Resources.memory
- Fix fs.upload_file argument order to (content, remote_path)
- Forward args in execute_file local-file branch via remote upload
- Accept --type daytona in Typer and legacy argparse sandbox CLI

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 08:55:17 +00:00
MervinPraison f030660579 feat(mcp): add comprehensive documentation for praisonai-mcp
Introduced new HTML documents outlining the praisonai-mcp server host features, installation instructions, and usage guidelines. This enhances the understanding of the MCP server's capabilities and integration with other packages.
2026-07-17 09:48:38 +01:00
praisonai-triage-agent[bot]andMervin Praison 797c4127dc fix: Daytona backend manager construction, env/cwd context, execute_file
- Accept config= kwarg so SandboxManager can construct DaytonaSandbox
  (mirrors sibling backends); derive image/timeout/cpu/memory from config
  while keeping legacy direct kwargs backward-compatible
- Combine cd/export/command into a single process.exec call so env vars
  and working_dir actually apply to the executed command
- execute_file now reads local file content and dispatches by language
  (mirrors E2B), falling back to remote path execution when not local

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 08:42:27 +00:00
MervinPraisonandCursor bca7e9aa09 fix: close C13 post-merge gaps — CLI unify, Daytona backend, live tests
Wire Typer run/shell/backends to SandboxHandler, implement daytona-sdk
DaytonaSandbox, expand live Docker/manager tests and backward-compat gates,
and refresh praisonai-sandbox and praisonai-agents lockfiles.

Co-authored-by: Cursor <[email protected]>
2026-07-17 09:33:52 +01:00
MervinPraison 6737311ab5 docs: auto-update feature parity trackers [skip ci] 2026-07-17 08:27:08 +00:00
Mervin Praison 030c16041a Merge pull request #3129 from MervinPraison/feat/c13-praisonai-sandbox
feat: extract praisonai-sandbox as C13 standalone package
2026-07-17 09:26:44 +01:00
praisonai-triage-agent[bot]andMervin Praison 021d193e99 fix: async MCP transport cleanup + circuit-breaker registry leak
- MCP.shutdown(): fall back to close() for HTTPStreamMCPClient/
  WebSocketMCPClient, which expose close()/aclose() but not shutdown().
  Previously these transports leaked on shutdown; also fixes Agent.aclose()
  fallback path.
- Agent.close()/aclose(): remove this agent's id(self)-scoped tool circuit
  breakers via new _cleanup_circuit_breakers(), preventing a reused object
  id from inheriting a stale OPEN breaker and keeping the registry bounded.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 07:26:59 +00:00
praisonai-triage-agent[bot]andMervinPraison 48d51f1a01 fix: MCP client leaks, cross-agent circuit-breaker bleed, dead llm getattr fallback (fixes #3130)
- close()/aclose(): shut down MCP clients passed via tools=[MCP(...)] by
  walking self.tools (mirrors remove_mcp_server) instead of the always-empty
  self._mcp_clients check, so subprocesses/threads are cleaned up deterministically.
- circuit breaker: scope the registry key to the Agent instance
  (tool_{id(self)}_{name}) so one agent's failing tool no longer trips the
  breaker for another agent's same-named tool.
- llm resolution: prefer llm_instance (the real LLM object) over the always-truthy
  llm model-name string in the token-tracking, token-metrics and guardrail paths,
  restoring set_current_agent/last_token_metrics wiring and configured-instance reuse.

Co-authored-by: MervinPraison <[email protected]>
2026-07-17 07:20:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 05ecd1fbe2 fix: C13 manager availability coercion + registry loader safety + realign backend tests
- manager.get_available_types(): invoke callable is_available before bool();
  ImportError path no longer advertises subprocess as available
- _plugin_registry fallback: translate non-ImportError loader failures to
  ValueError; raise AttributeError from None in lazy __getattr__
- Realign E2B tests to the real to_thread-based implementation (25 active,
  was 20 skipped); rewrite Daytona tests to the fail-loud stub contract

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 07:06:27 +00:00
praisonai-triage-agent[bot]andMervin Praison c527ecc652 fix: C13 sandbox standalone registry, e2b is_available, path & shell safety
- e2b: use importlib.import_module in is_available (aligns with tests, fixes CI)
- e2b: run_command list uses shlex.join to avoid shell reinterpretation
- _plugin_registry: self-contained fallback so praisonai-sandbox works without praisonai-code
- subprocess: guard sys.executable None/empty for PATH and cmd
- sandlock: allow sandbox root in _safe_sandbox_path so list_files("/") works

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 06:28:18 +00:00
MervinPraisonandCursor 78bdc9c1a5 feat: extract praisonai-sandbox as C13 standalone package
Move sandbox backend implementations out of the wrapper into praisonai-sandbox,
preserve praisonai.sandbox shims, wire agents bridge/registry dispatch, and add
CI gates, publish slot, and backward-compat tests for the eight-package model.

Co-authored-by: Cursor <[email protected]>
2026-07-17 07:18:30 +01:00
MervinPraison 6958bd1025 Release v4.6.151 2026-07-17 00:44:12 +00:00
MervinPraison 6c70212cfd Bump praisonai-mcp to 0.0.3 2026-07-17 00:44:06 +00:00
MervinPraison b68282d225 Bump praisonai-browser to 0.0.3 2026-07-17 00:44:01 +00:00
MervinPraison c97b9380d2 Bump praisonai-train to 0.0.6 2026-07-17 00:43:56 +00:00
MervinPraison bae876c595 Bump praisonai-bot to 0.0.35 2026-07-17 00:43:51 +00:00
MervinPraison 83e43da12c Bump praisonai-code to 0.0.50 2026-07-17 00:43:45 +00:00
MervinPraison 31855988bd Bump praisonaiagents to 1.6.154 2026-07-17 00:43:38 +00:00
praisonai-triage-agent[bot]andMervin Praison 29d87ef1ac fix: correct extension delivery targeting and cancelled-session cleanup
- Never deliver start_automation to an idle CLI connection (filter is_cli
  in the send + retry loops, not just the caller).
- Allow the side panel (extension) to start its own session without being
  self-excluded as NO_EXTENSION.
- Claim the extension's session_id before awaiting send_text so concurrent
  start_session calls cannot both pass the busy guard; release on failure.
- Stamp ended_at when a session is finalized as "cancelled".
- Add tests for side-panel start, idle-CLI exclusion, cancel_session
  routing, and cancelled ended_at.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 00:27:34 +00:00
praisonai-triage-agent[bot]andMervin Praison f1cf91b6fa fix: prevent dual-session stale-lock deadlock in praisonai-browser (fixes #3095)
Reject concurrent start_session when the extension is busy or absent,
avoid reporting "running" when start_automation was never delivered, and
release/finalize session locks on disconnect so /health returns to
sessions:0. Adds extension_busy/active_session_id to /health.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-17 00:26:09 +00:00
praisonai-triage-agent[bot]andMervinPraison f449c75d0b fix: dedupe tool schema build in tools/base.py (fixes #3125)
Extract shared _extract_schema helper and let validate_tool_schema_consistency
optionally return built schemas so get_sorted_tool_schemas reuses them instead
of rebuilding every tool schema a second time. No behaviour change.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 17:16:19 +00:00
praisonai-triage-agent[bot]andMervinPraison 0f4cf1f421 fix: merge duplicated streaming tool-call accumulation logic (fixes #3126)
Delegate the delta-accumulation loop in _process_stream_delta() to the
existing _process_tool_calls_from_stream() method, removing the byte-for-byte
duplicate accumulator. The outer guard in _process_stream_delta() is unchanged,
so whether/when accumulation runs is unaffected.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 17:15:26 +00:00
praisonai-triage-agent[bot]andMervin Praison 43027c0b7c fix: bound resolver memo cache and skip caching default registry
Addresses reviewer feedback on the ToolResolver memoisation:
- Cap the resolver cache as a small LRU (OrderedDict) so a long-running
  process that builds many workflows no longer retains every registry,
  its tool callables/modules and resolver caches for the process life.
- Skip caching entirely when registry is None: a fresh registry is built
  per call so its id() is never stable, meaning caching it only leaked
  memory and never produced a hit.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 16:23:46 +00:00
praisonai-triage-agent[bot]andMervinPraison 9be1149b15 fix: stop re-implementing praisonai-tools discovery in tool_override (fixes #3122)
create_tool_registry_with_overrides re-implemented praisonai-tools package
discovery that ToolResolver._resolve_from_praisonai_tools already owns and that
resolve_tools() already consults via the canonical resolver. Remove the
duplicate so external-tool discovery has a single implementation.

The template/cwd tools.py autoload is intentionally kept in the wrapper because
it carries the distinct PRAISONAI_ALLOW_TEMPLATE_TOOLS gate (with a
skip-on-error contract and explicit-template-dir-outside-CWD support) that the
resolver's PRAISONAI_ALLOW_LOCAL_TOOLS + CWD-boundary gate does not provide, so
delegating it would change the security gate.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 16:22:15 +00:00
praisonai-triage-agent[bot]andMervinPraison 0a2298371b fix: memoise ToolResolver in resolve_tools to avoid per-agent rebuild (fixes #3121)
Callers invoke resolve_tools() once per agent/step over the same registry
object, and each call rebuilt a fresh ToolRegistry + ToolResolver, discarding
per-instance caches and re-executing local tools.py once per agent. Extract
resolver construction into _get_resolver(), memoised on
(id(registry), template_dir, autoload_enabled), so one resolver is reused
across a workflow build. Resolution order, results, and the security gate are
unchanged.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 16:18:10 +00:00
Leebana 254f1ef7e4 Merge pull request #3118 from MervinPraison/claude/issue-3096-20260716-1136
fix: fail fast on silent stall in browser CLI run
2026-07-16 14:03:23 +01:00
praisonai-triage-agent[bot]andMervin Praison 6fae262213 fix: enforce extension dispatch, fix watchdog, harden health check
- server: only deliver start_automation to is_extension peers (initial + retry)
- cli: honour --timeout for confirmed-delivery runs; watchdog only when
  delivery unconfirmed; read persisted steps before evaluating deadline
- cli: guard _require_bridge against malformed/non-object/invalid-count health
- cli: shared _exit_for_status mapping applied to debug mode too
- tests: non-extension skip, malformed health responses

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 12:24:03 +00:00
praisonai-triage-agent[bot]andMervin Praison d9d66721fc fix: fail fast on silent stall in browser CLI run (fixes #3096)
Add pre-flight bridge health check, step watchdog, and explicit
start_automation delivery signalling so the extension-mode CLI run
no longer hangs silently on keepalive PING/PONG until timeout.

- server.py: /health now reports extension_connections; start_session
  response includes start_automation_sent so the CLI knows whether the
  task actually reached an extension.
- browser.py: _require_bridge() pre-flight check (exit 2 fast); handle
  server error messages; 30s first-step watchdog; verbose automation
  delivery status; infra/timeout/task exit codes (2/3/1).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 12:24:03 +00:00
Leebana cdc786af37 Merge pull request #3117 from MervinPraison/claude/issue-3111-20260716-1138
fix: emit JSON Schema-compliant tool required field for strict MCP clients
2026-07-16 13:22:37 +01:00
Leebana 7ef4ab8d78 Merge pull request #3116 from MervinPraison/claude/issue-3110-20260716-1137
fix: Windows STDIO transport crash on Python 3.13 (WinError 6)
2026-07-16 13:22:22 +01:00
Leebana d75d9dccc2 Merge pull request #3115 from MervinPraison/claude/issue-3098-20260716-1136
fix: guide manual extension load & fix doctor false negative (#3098)
2026-07-16 13:22:04 +01:00
Leebana 5d9fbe0008 Merge pull request #3114 from MervinPraison/claude/issue-3094-20260716-1136
fix: harden praisonai-browser Windows server startup (encoding + port-in-use UX)
2026-07-16 13:21:40 +01:00
Leebana f06e19a6f1 Merge pull request #3113 from MervinPraison/claude/issue-3097-20260716-1136
fix: friendly bridge-not-running error in praisonai-browser run
2026-07-16 13:21:24 +01:00
Leebana 18cc6dceb3 Merge pull request #3112 from MervinPraison/fix/claude-package-title-prefix
fix: accept bracket-prefixed titles for Claude auto-triage
2026-07-16 13:16:32 +01:00
praisonai-triage-agent[bot]andLeebana 78cdb34093 fix: exclude question issues from Claude auto-triage
Prioritize [question] title detection before the bug substring check and
guard autoClaude against the question label, so bracket-prefixed titles
like "[QUESTION] Is this a bug?" no longer auto-trigger Claude analysis.

Co-authored-by: Leebana <[email protected]>
2026-07-16 11:51:25 +00:00
praisonai-triage-agent[bot]andMervin Praison ed9bac1db8 fix: make extension health signal extension-specific & fix --no-server guidance (#3098)
Address reviewer findings on PR #3115:

- P1: /health counted all WebSocket clients, so a stray CLI connection could
  produce a false-positive extension check. Track chrome-extension origin
  connections server-side and expose extension_connections in /health; doctor
  and launch polling prefer it (fallback to connections for older servers).
- P2: launch --no-server failure guidance pointed to a dead /health endpoint.
  Guidance is now conditional: with --no-server it tells the user to start the
  bridge first, otherwise it shows the curl verification step.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:51:12 +00:00
praisonai-triage-agent[bot]andMervin Praison 5995010da3 test: use explicit Optional in schema compat test (PEP 484)
Addresses CodeRabbit nitpick on implicit Optional in the mock tool
helper; no behavior change.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:50:04 +00:00
praisonai-triage-agent[bot]andMervin Praison 76fd3d5d10 fix: harden MCP stdio transport (utf-8 parse, bounded queue, stop wake)
- Treat malformed UTF-8 as JSON-RPC -32700 parse error instead of
  terminating the transport (CodeRabbit)
- Bound the stdin queue and apply backpressure via timeout-based put so a
  fast/malicious client cannot grow memory without limit (CodeRabbit)
- stop() now enqueues the EOF sentinel to wake a blocked line_queue.get so
  shutdown exits cleanly even when stdin stays open (Greptile, CodeRabbit)
- Add regression test for invalid UTF-8 input

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:50:01 +00:00
praisonai-triage-agent[bot]andMervin Praison f2f26154f1 fix: restore server.start() blocking contract + IPv6-aware port probe
- Remove early-return from BrowserServer.start() so programmatic callers
  retain the documented blocking contract (CodeRabbit Major)
- Move proactive _port_in_use pre-check into the CLI, reusing the rich
  'already running' message and exiting 0
- Make _port_in_use family-agnostic via getaddrinfo so IPv6 (::1) hosts
  are probed correctly (Greptile P1)
- Use errno.EADDRINUSE instead of magic numbers; drop redundant f-prefixes

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:47:58 +00:00
praisonai-triage-agent[bot]andMervin Praison 9b9c949062 fix: align bridge-unreachable message host with actual connect target
The friendly error reported ws://127.0.0.1 but the run command actually
connects to ws://localhost and the health checks elsewhere use localhost.
Align the message (and its test) to localhost for accuracy.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:47:25 +00:00
praisonai-triage-agent[bot]andMervin Praison 1cbab02aca fix: emit JSON Schema-compliant tool required field for strict MCP clients (fixes #3111)
Zero-arg / all-optional tools serialized inputSchema.required as JSON null,
which strict MCP clients (Cursor's Zod validation) reject, discarding the
entire tools/list batch so only mcp_auth appeared. Omit the required key when
empty and defensively normalize any legacy required:null at the export
boundary.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:40:06 +00:00
praisonai-triage-agent[bot]andMervin Praison 0ae393476c fix: use threaded stdin reader for MCP STDIO transport (fixes #3110)
Replaces loop.connect_read_pipe(sys.stdin) which crashes on Windows
ProactorEventLoop + Python 3.13 with WinError 6. Reads stdin in a daemon
thread and hands lines to the asyncio loop via run_in_executor; writes
responses to sys.stdout.buffer with flush. Portable across platforms.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:39:30 +00:00
praisonai-triage-agent[bot]andMervin Praison 1df8cc448f fix: guide manual extension load & fix doctor false negative (fixes #3098)
- launch: on auto-load failure, print exact 'Load unpacked' dist path and
  bridge verification steps (Chrome 137+/Windows blocks automated load)
- doctor extension: check bridge /health connection (ground truth) and treat
  CDP :9222 as optional, so it no longer reports a false negative when the
  extension works in the user's daily Work Chrome profile

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:39:20 +00:00
praisonai-triage-agent[bot]andMervin Praison 6f8451b178 fix: harden praisonai-browser Windows server startup (fixes #3094)
- Remove emoji from server.py start() banner and CLI run banners to avoid charmap crashes on cp1252 Windows consoles
- Reconfigure stdout/stderr to UTF-8 in __main__ before console import
- Add pre-bind port probe so a duplicate start reports "already listening" instead of raising a bind error
- Map WinError 10048 / EADDRINUSE to a friendly "already running" message with exit code 0 in the start command

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:39:03 +00:00
praisonai-triage-agent[bot]andMervin Praison 42ea45ca90 fix: friendly bridge-not-running error in praisonai-browser run (fixes #3097)
Translate cross-platform connection-refused errors (WinError 1225,
ECONNREFUSED 111/61) into an actionable message naming the bridge URL,
the `praisonai browser start` command, and the health-check URL.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 11:38:51 +00:00
MervinPraison 9ae5cf266e fix: accept bracket-prefixed titles for Claude auto-triage
External bug reports like [praisonai-mcp] and [praisonai-browser] were
skipped because only [bug] matched the title gate. Match any leading
[...] prefix when the issue has bug or enhancement labels.
2026-07-16 12:34:04 +01:00
MervinPraison 748e4ae3ab docs: auto-update feature parity trackers [skip ci] 2026-07-16 11:29:59 +00:00
Leebana 8db31d71e0 Merge pull request #3101 from fazalpsinfo-cmyk/fix/sync-async-process-observation
fix: use async aprocess_observation in async event loop (#3093)
2026-07-16 12:29:25 +01:00
Leebana 2cd9129826 Merge pull request #3092 from MervinPraison/claude/issue-3090-20260716-0849
fix: add turn-level rewind for checkpoints
2026-07-16 12:28:56 +01:00
Leebana 4328de04d2 Merge pull request #3082 from MervinPraison/claude/issue-3061-20260716-0304
fix: per-task git worktree isolation for parallel kanban workers
2026-07-16 12:28:31 +01:00
MervinPraison 2bc56af3e4 docs: auto-update feature parity trackers [skip ci] 2026-07-16 11:28:26 +00:00
Leebana 650f245df8 Merge pull request #3076 from MervinPraison/claude/issue-3048-20260716-0304
fix: step-indexed checkpoint save/restore (rewind-to-step)
2026-07-16 12:27:45 +01:00
Leebana 3e66942b56 Merge pull request #3109 from MervinPraison/claude/issue-3107-20260716-0946
fix: merge .praisonai/tools/ @tool functions into YAML tool resolution
2026-07-16 12:26:59 +01:00
Leebana a2dbe4e281 Merge pull request #3108 from MervinPraison/claude/issue-3105-20260716-0945
fix: isolate agent-invoke sessions per session_id
2026-07-16 12:26:31 +01:00
Leebana cb7f50a3de Merge pull request #3103 from MervinPraison/claude/issue-3102-20260716-0920
fix: add first-class secret references for gateway credentials
2026-07-16 12:26:06 +01:00
MervinPraison 8143b29abe docs: auto-update feature parity trackers [skip ci] 2026-07-16 11:25:47 +00:00
Leebana 9549d730e6 Merge pull request #3099 from MervinPraison/claude/issue-3089-20260716-0849
fix: persist tool-call/result turns in default session store
2026-07-16 12:25:23 +01:00
Leebana aaefbac269 Merge pull request #3086 from MervinPraison/claude/issue-3085-20260716-0715
fix: wire tool middleware hooks, propagate nested-step policies, guard concurrent Workflow runs
2026-07-16 12:25:01 +01:00
Leebana 5617b0a5b1 Merge pull request #3084 from MervinPraison/claude/issue-3039-20260716-0304
fix: enforce tool-call policy/guardrails, fix Memory reset/delete/store, honor Workflow on_error
2026-07-16 12:24:37 +01:00
MervinPraison 2f09eeb9c6 docs: auto-update feature parity trackers [skip ci] 2026-07-16 11:23:51 +00:00
Leebana 4b8f115fe5 Merge pull request #3081 from MervinPraison/claude/issue-3062-20260716-0305
fix: persist compaction summary by populating CompactionResult.summary
2026-07-16 12:23:02 +01:00
Leebana 8c3672ec9c Merge pull request #3080 from MervinPraison/claude/issue-3073-20260716-0305
fix: make loop-guard no-progress detection result-aware
2026-07-16 12:22:39 +01:00
Leebana c314ae1d1b Merge pull request #3079 from MervinPraison/claude/issue-3050-20260716-0304
fix: validate gateway server-config block field-by-field
2026-07-16 12:22:14 +01:00
Leebana a78786a380 Merge pull request #3078 from MervinPraison/claude/issue-3047-20260716-0304
fix: auto-load project-local tools on --agent run path
2026-07-16 12:21:46 +01:00
Leebana 37a5fac2e4 Merge pull request #3077 from MervinPraison/claude/issue-3063-20260716-0305
fix: add addressed agent-to-agent mailbox primitive (#3063)
2026-07-16 12:21:23 +01:00
MervinPraison 4ed4d01cef docs: auto-update documentation parity trackers [skip ci] 2026-07-16 11:20:49 +00:00
Leebana da5588499a Merge pull request #3072 from MervinPraison/claude/issue-3071-20260715-1713
fix: remove dead StepResult branch and orphaned structured_execution.py
2026-07-16 12:20:17 +01:00
Leebana 6e38569afc Merge pull request #3070 from MervinPraison/claude/issue-3067-20260715-1622
fix: single-source tool inventory and share ToolResolver in wrapper generators
2026-07-16 12:19:57 +01:00
Leebana 188e4beab9 Merge pull request #3069 from MervinPraison/claude/issue-3068-20260715-1622
fix: remove verified-unused legacy UI modules from praisonai wrapper
2026-07-16 12:19:30 +01:00
Leebana 4ead830a43 Merge pull request #3074 from MervinPraison/fix/claude-title-bracket-bug
fix(ci): accept [BUG] title prefix for external Claude auto-trigger
2026-07-16 12:18:27 +01:00
MervinPraison 9d1c2c7c12 docs: auto-update feature parity trackers [skip ci] 2026-07-16 10:38:20 +00:00
praisonai-triage-agent[bot] 3b4330fb4e Merge pull request #3106 from MervinPraison/claude/issue-3104-20260716-0940
fix: add PromptOptimizer + keep-best eval loop with numeric metric
2026-07-16 10:37:53 +00:00
praisonai-triage-agent[bot]andMervin Praison 857ced034b fix: recognise Agent subclasses and fail closed on clone errors
Address session-isolation gaps in agent-invoke:
- _supports_session_isolation now uses isinstance(Agent) so application
  Agent subclasses are cloned per session instead of sharing state.
- resolve_session_agent raises on clone failure instead of falling back
  to the shared template, preventing cross-session history leaks.
- Handlers surface isolation failures as clean errors.
- Add tests for subclass isolation and clone-failure behaviour.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:58:15 +00:00
praisonai-triage-agent[bot]andMervin Praison 12df267b85 perf: gate .praisonai/tools discovery before git subprocess in YAML resolution
Short-circuit resolve_all_from_yaml's project-tool discovery with the cheap
local_tools_enabled() opt-in check before walking directories and shelling out
to `git rev-parse`. Loading is gated anyway, so the git subprocess added no
value when PRAISONAI_ALLOW_LOCAL_TOOLS is off (the default). Also narrow the
import guard to ImportError.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:57:05 +00:00
praisonai-triage-agent[bot]andMervin Praison bb73e211a8 fix: make PromptOptimizer candidates actually change agent behaviour
- Optimizer now swaps goal/backstory (which drive the cached system prompt),
  not just instructions, and clears the system-prompt cache, so each candidate
  is scored with its own effective prompt instead of the original.
- Isolate eval chats via agent.ephemeral() to stop history pollution.
- Parse multiline candidates as complete blocks (delimiter + blank-line
  fallback) instead of per-line fragments.
- Floor non-finite metric scores (NaN/inf) to 0.0 in both optimizer and loop.
- Move EvaluationLoopResult.best after metadata to avoid positional shift.
- Add tests for goal/backstory swap, apply, multiline parsing, non-finite scores.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:52:51 +00:00
praisonai-triage-agent[bot]andMervinPraison 882bd00836 fix: merge .praisonai/tools/ @tool functions into YAML tool resolution (fixes #3107)
Wire the existing gated .praisonai/tools/ discovery into resolve_all_from_yaml
so @tool-decorated functions dropped into the convention are available to
YAML-defined agents by their tool name. Additive and backward compatible with
the cwd tools.py / tools/ paths.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 09:51:36 +00:00
praisonai-triage-agent[bot]andMervinPraison a57ded0d17 fix: isolate agent-invoke sessions per session_id (fixes #3105)
The agent-serving endpoint dispatched every request against a single
shared Agent instance and ignored session_id, leaking mutable
chat_history across concurrent callers and making the advertised
"conversation continuity" a no-op.

Introduce resolve_session_agent() in the wrapper: the registry now holds
a template, and each request gets an isolated clone (via the existing
clone_for_channel safe-copy path). A provided session_id binds the clone
to the shared, file-locked DefaultSessionStore for continuity + cross-
session isolation; its absence yields an ephemeral conversation. Non-
Agent objects (e.g. mocks) fall back to the shared instance for backward
compatibility. Composes existing core primitives only — no new core
surface.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 09:50:30 +00:00
praisonai-triage-agent[bot]andMervinPraison 797388c9bd fix: add PromptOptimizer + keep-best eval loop with numeric metric (fixes #3104)
- EvaluationLoop now keeps and returns the highest-scoring iteration
  (best/best_score/best_output) instead of the last one, and supports an
  optional numeric metric to drive scoring instead of the LLM Judge.
- New PromptOptimizer (eval/prompt_optimizer.py) generates instruction
  variants, scores each over an eval set, keeps the best, and optionally
  writes it back to agent.instructions.
- Agent.optimize_instructions / aoptimize_instructions convenience methods.
- Lazy exports for PromptOptimizer/OptimizeResult.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 09:45:07 +00:00
praisonai-triage-agent[bot] 90e5602ffe Merge pull request #3100 from MervinPraison/claude/issue-3091-20260716-0850
fix: surface opt-in for project-local tools instead of silent no-op
2026-07-16 09:44:37 +00:00
praisonai-triage-agent[bot]andMervin Praison db5c984d43 fix: resolve secret-ref merge, single JSON doctor output, no double exec (#3102)
- server.py: resolved secret string now wins over a raw {source,id} reference
  dict in the runtime channel merge, so adapters (e.g. WhatsApp verify_token)
  never receive an unresolved reference.
- gateway doctor --json: emit a single combined JSON document ({probes,secrets})
  instead of two top-level documents so json.load(s) can parse the output.
- gateway doctor: exec-sourced credentials are reported as "configured" without
  running their command, so a one-shot/rate-limited/rotating secret command is
  not executed twice (availability report + probe).

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:35:43 +00:00
praisonai-triage-agent[bot]andMervinPraison 53f8091d11 fix: add first-class secret references for gateway credentials (fixes #3102)
Add a lightweight, protocol-first secret-reference contract so credential
fields (token, app_token, verify_token) can be sourced from an env var, a
mounted secret file, or a command/secret-manager, with resolved values
registered for log redaction.

- core: praisonaiagents/secrets.py — SecretRef, SecretResolver protocol,
  stdlib DefaultSecretResolver (env/file/exec), resolver registry, and a
  redaction registry (register_secret_for_redaction / redact_secrets).
- config schema: credential fields accept the additive {source, id} form;
  plaintext and ${ENV} stay fully backward compatible; resolved values are
  registered for redaction.
- gateway doctor: reports each credential as available |
  configured-but-unavailable | missing without printing the value.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 09:26:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 1adf4ae97d fix: align local-tools opt-in with loader semantics and scope the grant
Addresses reviewer feedback on PR #3100:
- Add local_tools_enabled() mirroring the loader's exact acceptance
  (lower() == "true") so false/0 no longer suppress the hint while the
  loader still denies (no silent no-op). Used by both the auto-discovery
  hint and the --tools file path.
- Make --allow-local-tools a strictly per-invocation grant: set the env
  gate for the run and restore the prior value in a finally, so a later
  in-process run never inherits authorization to exec local Python.
- count_project_tool_files() now returns (project_count, user_count) so
  the hint names the correct source (.praisonai/tools/ vs
  ~/.praisonai/tools/) instead of mislabelling user-global files.
- Tests: local_tools_enabled semantics (incl. false/0), tuple counts,
  and false-value hint coverage.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:07:25 +00:00
Muhamed Fazal PS b182b19cdf fix: use async aprocess_observation in async event loop (#3093)
Playwright and CDP automation engines call agent.process_observation()
synchronously from inside async methods that run via asyncio.run().
The praisonaiagents runner rejects execute_sync() when an event loop
is already active, causing RuntimeError on every LLM observation
step and blocking all headless browser automation.

Changed to await agent.aprocess_observation() in both engines,
matching the async pattern already used by server.py.

Fixes #3093
2026-07-16 14:32:18 +05:30
praisonai-triage-agent[bot]andMervin Praison 17fbac9a73 fix: tolerate tool-field kwargs on legacy stores and keep tool exchanges intact on trim (#3089)
- memory_mixin: feature-detect whether a session store's add_message accepts
  tool_calls/tool_call_id; fall back to a plain-text turn for legacy protocol
  stores so tool turns are never silently dropped by a swallowed TypeError.
- hierarchy: HierarchicalSessionStore.add_message now accepts and preserves the
  optional tool fields so hierarchical stores also resume faithfully.
- store: count-based history slicing (get_chat_history / get_working_history)
  no longer begins on an orphaned role="tool" result, avoiding invalid
  transcripts on resume when the boundary lands mid tool-exchange.
- tests: cover legacy-store fallback, hierarchical store tool fields, and
  the trim boundary skipping orphaned tool results.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 09:01:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 6460fc5355 fix: rewind reaches commits older than max_checkpoints; native step validation
- service.rewind: query steps+1 commits instead of capping at max_checkpoints
  so valid older shadow-git commits stay reachable (pruning only trims memory)
- Typer rewind: enforce min=1 natively for early, structured validation
- soften "turn" wording to "checkpoint" (checkpoints != agent turns 1:1)
- add regression test for rewind beyond max_checkpoints

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 08:59:18 +00:00
praisonai-triage-agent[bot]andMervinPraison b0700a7082 fix: surface opt-in for project-local tools instead of silent no-op (fixes #3091)
When .praisonai/tools/*.py files are present but PRAISONAI_ALLOW_LOCAL_TOOLS
is unset, run now prints a concise hint on the default path explaining how to
enable them, instead of silently skipping. Adds a discoverable
--allow-local-tools flag and aligns the init scaffold copy so the enable step
is stated up front.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 08:54:54 +00:00
praisonai-triage-agent[bot]andMervinPraison 484aeb5d84 fix: persist tool-call/result turns in default session store (fixes #3089)
The zero-config JSON session store only round-tripped role/content text,
so resuming a tool-using agent via --continue / session resume silently
dropped its tool calls and results. Add optional, additive tool_calls /
tool_call_id fields to SessionMessage (tolerant of absence for old files),
preserve them through get_chat_history / get_working_history / set_chat_history,
and teach _persist_message to forward assistant tool-call and tool-result
turns so resume reconstructs the same message list the model saw before.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 08:53:55 +00:00
praisonai-triage-agent[bot]andMervinPraison 4c0f11eafc fix: add turn-level rewind for checkpoints (fixes #3090)
Checkpoints already form an ordered shadow-git sequence, so a "turn" is an
index into it. Add a lightweight CheckpointService.rewind(steps) helper over
the existing list_checkpoints + restore, and surface it as
`praisonai checkpoint rewind [steps]` (default 1 = undo the last turn's file
changes). No changes to agent.py, the tool loop, or the session store.

Co-authored-by: MervinPraison <[email protected]>
2026-07-16 08:52:46 +00:00
praisonai-triage-agent[bot]andMervin Praison 05f12f378f fix: close async tool-hook bypass and lazy-lock first-run race
- execute_tool_async now routes through the tool MiddlewareManager (parity
  with sync execute_tool): before_tool/after_tool/wrap_tool_call gate async
  tool calls too, so security/audit hooks are no longer bypassed. Fast path
  (no hooks) unchanged. Core retry loop extracted to
  _execute_tool_async_with_retry.
- Workflow._execution_lock uses module-level double-checked locking so two
  threads first entering run()/astart() concurrently share one lock object
  instead of each minting and acquiring its own, closing the run-guard race.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 07:36:02 +00:00
praisonai-triage-agent[bot]andMervin Praison 2d7a2263e7 fix: wire tool middleware hooks, propagate nested-step policies, guard concurrent Workflow runs (fixes #3085)
Gap 1: Route Agent(hooks=[...]) tool middleware (before_tool/after_tool/
wrap_tool_call) through execute_tool via a lazily-built MiddlewareManager.
Zero overhead when no hooks are registered.

Gap 2: Apply the same retry / guardrail-retry / output_file policies used by
the top-level run() loop to nested-pattern steps (Parallel/Loop/Route/If/
Repeat) and hierarchical mode via a shared _apply_step_policies helper.

Gap 3: Guard run()/astart() against concurrent re-entrancy on a shared
Workflow instance with a lazily-created lock, raising a clear error instead
of silently corrupting per-run state.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 07:24:54 +00:00
praisonai-triage-agent[bot]andMervin Praison e459e3790d fix: close async policy bypass, scope tier delete, fail-closed guardrails, honor guardrail-exhaustion on_error
- execution_mixin: async tool path now runs the same policy/guardrail gate as
  sync (_check_tool_policy_and_guardrails), closing the async bypass.
- sqlite/in_memory adapters + memory.py: delete_memory takes an optional tier
  so delete_short_term/delete_long_term only touch their own tier — prevents a
  short-term delete from erasing an unrelated long-term row with the same id.
- tool_execution: policy check_tool and guardrail validate_tool_call exceptions
  now fail closed (deny) instead of silently executing the tool.
- workflows: a step whose guardrail never validates after exhausting retries is
  now treated as failed, honoring on_error='stop' and the final workflow status;
  on_step_complete is fired on a stopped failure.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:24:54 +00:00
praisonai-triage-agent[bot]andMervin Praison 350ead64d6 fix(loop-guard): make count-based guard result-aware + fix falsy/marker/streak edge cases
Addresses reviewer feedback on #3080:
- Falsy tool results (""/[]/{}/0/False) were dropped by the upstream
  detector's truthiness check, disabling no-progress detection; now wrapped
  so they remain fingerprintable.
- Identical-result streak now requires the same tool, so unrelated tools
  returning a common value (e.g. "ok"/True) are not lumped into one run.
- Progress markers now record an action-index boundary so mark_progress()
  actually resets the streak.
- Count-based idempotent/mutating BLOCK/HALT is now gated on an actual
  stuck (identical-result) streak, preventing false halts on legitimate
  high-frequency-but-progressing tool use (fixes wiring-test regression).
- Post-execution loop-guard BLOCK/HALT decisions are now surfaced to the
  model instead of being silently discarded.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:24:45 +00:00
praisonai-triage-agent[bot]andMervin Praison 7bb86bbb72 fix(kanban): harden worktree integration against data loss & fail-open
Address reviewer-flagged P0/P1 issues in per-task worktree isolation:
- Anchor all git ops to a fixed repo dir (env override / resolved cwd)
  instead of the mutable process cwd.
- Validate caller-supplied task ids before using them as path/ref
  components (reject traversal, invalid ref chars); refuse worktree
  creation on unsafe ids instead of failing open to the shared cwd.
- Commit uncommitted worker edits before integrating so a clean-but-empty
  merge no longer discards work on teardown.
- Honor the integration `git commit` return code and abort on failure so a
  rejected commit blocks the task rather than reporting success.
- Route non-conflict merge failures and integration exceptions to 'blocked'
  so a task is never marked 'done' with an unmerged branch.
- Add `workspace_kind` to the public update allowlist so opting an existing
  task into 'worktree' actually persists.

Adds tests for uncommitted-edit preservation, failed integration commit,
integration exception blocking, and unsafe-id rejection.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:21:47 +00:00
praisonai-triage-agent[bot]andMervin Praison 349b29803d fix(compaction): prevent stale-summary leak + offload async checkpoint I/O
Address reviewer findings on PR #3081:
- _extract_summary_text no longer falls back to instance _previous_summary,
  so a reused compactor cannot persist an outdated summary on a later
  non-summarizing pass (drops intervening turns on resume).
- async compaction persists the checkpoint via asyncio.to_thread so the
  locked JSON read/modify/write disk I/O no longer stalls the event loop.
- add regression test for the stale-summary leak.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:21:37 +00:00
praisonai-triage-agent[bot]andMervin Praison b236c94cf4 fix: harden step-indexed checkpoints (explicit step precedence, fail-fast, legacy CLI --step)
- save(): explicit step now overrides any existing [step-N] tag in the message
- save(): reject negative step indexes (previously unrecoverable)
- restore(): fail fast when both checkpoint_id and step are provided
- restore(): result checkpoint now carries the step metadata
- CLI (typer + legacy handler): validate id+step conflict; legacy path parses --step
- tests: cover step precedence, negative step, mutual-exclusion, restore step metadata

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:21:19 +00:00
praisonai-triage-agent[bot]andMervin Praison 27ffc36903 fix(gateway): align health-monitor schema with runtime consumer (#3050)
HealthMonitorSchema used invented keys (check_interval, failure_threshold,
etc.) that the runtime never reads. server.py passes gateway.health straight
to HealthMonitorConfig.from_dict, which only consumes interval/startup_grace/
stale_after/stuck_after/max_restarts_per_hour/enabled. As written the PR would
reject a valid `interval: 60` (extra="forbid") and silently accept ignored
keys. Fixes the schema to mirror the real runtime keys and adds a regression
guard test.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:17:50 +00:00
praisonai-triage-agent[bot]andMervin Praison 46cf16eb22 fix: dedupe internal duplicates in custom-agent extra tools
Update the seen set while merging extra_tools so duplicates within the
resolved --tools/--toolset/discovered set are removed (not just against
frontmatter), matching _auto_discover_project_tools. Adds a regression test.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:15:39 +00:00
praisonai-triage-agent[bot]andMervin Praison a4abc2d57a fix: reject non-positive max_inbox, rename max->limit, structured logging
- Reject max_inbox <= 0 (prevents silent message loss on zero-capacity inbox)
- Rename receive(max=) -> receive(limit=) to avoid shadowing builtin (Ruff A002)
- Include message_id/correlation_id in subscriber-error logs
- Sort __all__ alphabetically (RUF022)
- Add test for non-positive max_inbox rejection

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:14:51 +00:00
praisonai-triage-agent[bot]andMervin Praison ce3fa29153 fix: enforce tool-call policy/guardrails, fix Memory reset/delete/store, honor Workflow on_error (fixes #3039)
- tool_execution: gate resolved tool calls through the attached PolicyEngine
  (check_tool) and tool-call guardrails (validate_tool_call) before dispatch;
  denials are non-retryable and bypass the circuit breaker
- memory: delegate reset_/delete_short_term/long_term to the active adapter
  (sqlite/in_memory) to avoid the legacy short_mem/long_mem schema mismatch,
  and return the memory id from store_short_term/store_long_term
- memory adapters: add delete_memory/reset_short_term/reset_long_term to the
  sqlite and in-memory adapters
- workflows: AgentFlow.run() honors step.on_error="stop" (aborts + marks
  failed) and the final status reflects any unresolved step failure instead
  of always reporting "completed"

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:12:57 +00:00
praisonai-triage-agent[bot]andMervin Praison 0c8ee4308c fix: add per-task git worktree isolation for parallel kanban workers (fixes #3061)
Opt-in worktree isolation (workspace_kind="worktree") gives each parallel
worker a dedicated git worktree/branch (kanban/<task_id>) as its cwd, and
integrates the branch back on completion with conflict-on-merge detection —
routing conflicts to 'blocked' instead of silently overwriting. Default
"default" keeps today's shared-cwd behaviour.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:11:29 +00:00
praisonai-triage-agent[bot]andMervin Praison 4dfc909fd0 fix: populate CompactionResult.summary so compaction summaries persist (fixes #3062)
The durable persist+resume machinery (Issue #2741) already existed, but
CompactionResult.summary was always "", so the persister received nothing
and every summary was lost on process exit. Populate it from the produced
summary (LLM/naive/fallback) and persist in the async proactive path too.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:10:56 +00:00
praisonai-triage-agent[bot]andMervin Praison c5d2759295 fix: make loop-guard no-progress detection result-aware (fixes #3073)
The LoopGuard "no progress" heuristic counted every tool call as no-progress
because its progress counter was never updated (mark_progress is not called in
the tool loop), so any turn with 8+ tool calls halted regardless of results.
This broke legitimate async / long-running MCP tool workflows that poll a job
status (IN_PROGRESS -> COMPLETE) or pace with a wait tool.

Now no-progress is measured by the trailing run of identical tool-result
fingerprints: distinct/changing results reset the streak (progress), while a
genuinely stuck loop of identical results still halts. The real tool result is
passed through record() so the fingerprint reflects actual output.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:09:31 +00:00
praisonai-triage-agent[bot]andMervin Praison 318e05fd2b fix: validate gateway server-config block field-by-field (fixes #3050)
Replace the opaque `gateway: Optional[Dict[str, Any]]` in GatewayConfigSchema
with load-time validation via a typed GatewayServerSchema (extra="forbid",
ranges mirroring core's GatewayConfig) plus HookSchema/HealthMonitorSchema, so
a misspelled or mistyped server knob (drain_timout, "quick") now fails closed
with a friendly, field-named error instead of being silently dropped at
runtime. Blocks stay stored as dicts for backward-compatible downstream access.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:09:18 +00:00
praisonai-triage-agent[bot]andMervin Praison 908f12034a fix: auto-load project-local tools on --agent run path (fixes #3047)
_run_custom_agent ignored --tools/--toolset and never auto-discovered
.praisonai/tools/*.py, so the "auto-loaded on every run" promise only held
for the default and actions paths. Wire explicit tools/toolsets plus
project-local auto-discovery into the --agent path, unioned with the
frontmatter tools: list (dedup by callable identity), still gated by
PRAISONAI_ALLOW_LOCAL_TOOLS.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:08:36 +00:00
praisonai-triage-agent[bot]andMervin Praison ad978cfc62 fix: add addressed agent-to-agent mailbox primitive (fixes #3063)
Adds a protocol-first messaging module giving agents a first-class
sender->named-recipient channel that the bus (type-filtered, no target),
kanban comments (task-scoped, pull-based board) and handoff (sync
parent->child) all lack.

- messaging/protocols.py: AgentMessage + AgentMailboxProtocol
- messaging/inprocess.py: light in-process default impl (InProcessMailbox)
- messaging/__init__.py: lazy exports (zero overhead unless used)

Scoped minimal per AGENTS.md: core protocol + in-process default only.
No Agent param, no agent.py changes, no heavy deps. The wrapper can add
a Redis-backed impl of the same protocol for cross-host fleets.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:08:22 +00:00
praisonai-triage-agent[bot]andMervin Praison 1f44007eda fix: add step-indexed checkpoint save/restore for rewind-to-step (fixes #3048)
Adds the core primitive for per-step workspace checkpoints by encoding a
step index into the shadow-git commit message (zero extra storage):
- CheckpointService.save(..., step=N) tags a per-step checkpoint
- CheckpointService.restore(step=N) + get_checkpoint_by_step() rewind to a step
- Checkpoint.step field surfaced in list/to_dict
- CLI: `praisonai checkpoint restore --step N`

Backward-compatible and opt-in; no new Agent params or config modules.

Co-authored-by: Mervin Praison <[email protected]>
2026-07-16 03:08:21 +00:00
MervinPraison 1417166b4b fix(ci): accept [BUG] title prefix for external Claude auto-trigger 2026-07-16 04:03:57 +01:00
praisonai-triage-agent[bot]andMervinPraison 0c7ef71589 fix: remove dead StepResult branch and orphaned structured_execution.py (fixes #3071)
- Remove unreachable StepResult lazy branch in workflows/__init__.py
  (StepResult is bound at module top and in __all__, so __getattr__ never
  fires for it; the branch also returned a different results.py class,
  masking a latent class-identity mismatch)
- Remove orphaned structured_execution.py and its lazy branch
  (StructuredWorkflowExecutor/execute_step_structured had zero consumers)

Live branches (StepError, WorkflowResult, StepStatus, ErrorStrategy),
results.py, and the memory/workflows shim are untouched.

Co-authored-by: MervinPraison <[email protected]>
2026-07-15 17:16:31 +00:00
praisonai-triage-agent[bot]andMervinPraison 9ee012ffcd fix: single-source tool inventory and share ToolResolver in wrapper generators (fixes #3067)
Route get_available_tools() through the canonical ToolResolver (single
source of truth) and demote the frozen AVAILABLE_TOOLS list to a
last-resort fallback, so all three auto-generators advertise the
actually-installed tools instead of the drifting legacy CrewAI list.

Move the resolver helpers to BaseAutoGenerator and use the shared
context-local _get_default_resolver() so the auto phase and
AgentsGenerator reuse one warm cache per run instead of repeating full
tool discovery. AgentsGenerator now accepts an optional tool_resolver
for DI.

Co-authored-by: MervinPraison <[email protected]>
2026-07-15 16:30:13 +00:00
praisonai-triage-agent[bot]andMervinPraison c24015a9c5 fix: remove verified-unused legacy UI modules from praisonai wrapper (fixes #3068)
Remove dead-code Chainlit-era UI modules with zero importers anywhere in
the codebase:
- ui/callbacks.py (CallbackManager)
- ui/components/aicoder.py (AICoder)

Neither module is imported, re-exported, or in any __all__. The live
`praisonai ui` loader resolves bundled presets from ui_*/default_app.py,
which are unaffected.

Co-authored-by: MervinPraison <[email protected]>
2026-07-15 16:23:30 +00:00
665 changed files with 35655 additions and 10322 deletions

No files matched your search

+330
View File
@@ -0,0 +1,330 @@
<!-- wp:paragraph -->
<p>praisonai-mcp is Tier 2e — the heavy MCP server host: full <code>MCPServer</code>, tool/resource/prompt registries, recipe bridge, HTTP-stream auth, and MCP client config management. Depends only on <code>praisonaiagents</code>. v0.0.2. Protocol: MCP 2025-11-25.</p>
<!-- /wp:paragraph -->
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
flowchart TB
CLIENT[Cursor Claude Desktop]
subgraph T1 [praisonaiagents]
SDK[MCP client ToolsMCPServer]
SEC[mcp_security shared]
end
subgraph T2e [praisonai-mcp]
HOST[MCPServer]
REG[tool resource prompt registry]
TR[stdio http-stream]
AUTH[api-key oauth scopes]
CFG[mcp list add sync]
end
subgraph T2a [praisonai-code optional]
LIGHT[serve mcp light]
BRIDGE[_mcp_bridge]
end
subgraph T3 [praisonai wrapper optional]
CAP[capabilities recipe]
end
CLIENT --> TR
TR --> HOST
HOST --> REG
REG -.->|adapters| CAP
CFG -.->|_code_bridge| LIGHT
BRIDGE --> CFG
SDK --> LIGHT
SEC --> TR
classDef agent fill:#8B0000,color:#fff
classDef tool fill:#189AB4,color:#fff
class CLIENT agent
class SDK agent
class HOST agent
class REG tool
class TR tool
class AUTH tool
class CFG tool
class LIGHT tool
class SEC tool
</pre></div>
<!-- /wp:merpress/mermaidjs -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Three MCP layers (do not conflate)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Layer</th><th>Package</th><th>Role</th><th>Entry</th></tr></thead><tbody><tr><td>Client</td><td><code>praisonaiagents/mcp/</code></td><td>Connect agents to external MCP servers; OAuth storage</td><td><code>pip install "praisonaiagents[mcp]"</code></td></tr><tr><td>Light server</td><td><code>praisonai-code</code></td><td>Config-driven basic tool hosting</td><td><code>praisonai serve mcp</code></td></tr><tr><td>Heavy host</td><td><code>praisonai-mcp</code></td><td>Full server, adapters, recipe bridge, HTTP auth</td><td><code>praisonai mcp serve</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Install matrix</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Install</th><th><code>praisonai mcp</code></th><th><code>praisonai serve mcp</code></th><th><code>praisonai-mcp</code> script</th></tr></thead><tbody><tr><td><code>pip install praisonai-mcp</code></td><td>—</td><td>—</td><td>✅</td></tr><tr><td><code>pip install "praisonai-mcp[all]"</code></td><td>—</td><td>—</td><td>✅ HTTP + auth</td></tr><tr><td><code>pip install praisonai-code</code> only</td><td>hidden</td><td>✅ light</td><td>—</td></tr><tr><td><code>pip install "praisonai[mcp]"</code></td><td>✅</td><td>✅</td><td>✅</td></tr><tr><td><code>pip install praisonai</code></td><td>✅</td><td>✅</td><td>✅</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>1. Standalone heavy host</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai-mcp[all]"
export OPENAI_API_KEY=sk-...
praisonai-mcp --version
praisonai-mcp serve --transport stdio
praisonai-mcp list-tools
praisonai-mcp doctor</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>2. Full stack (same commands via <code>praisonai mcp …</code>)</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install praisonai
# or MCP-only extra
pip install "praisonai[mcp]"
praisonai mcp serve --transport stdio
praisonai mcp list-tools
praisonai mcp doctor</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>3. Light server only (no praisonai-mcp required)</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install praisonai-code "praisonaiagents[mcp]"
praisonai serve mcp --port 8080
# Uses agents ToolsMCPServer — not the heavy MCPServer</code></pre>
<!-- /wp:code -->
<!-- wp:separator -->
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<!-- /wp:separator -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 1 — STDIO host (Cursor / Claude Desktop)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Heavy host — full PraisonAI tool registry
praisonai-mcp serve --transport stdio
# or
praisonai mcp serve --transport stdio
# Generate client config
praisonai mcp config-generate --client cursor --transport stdio
praisonai mcp config-generate --client claude-desktop --transport stdio</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>STDIO uses JSON-RPC over stdin/stdout. Logs go to stderr only — never corrupt the protocol stream.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 2 — HTTP Stream host</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Streamable HTTP (MCP 2025-11-25) — not legacy standalone SSE. Requires <code>[server]</code> extra (starlette + uvicorn).</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonai mcp serve \
--transport http-stream \
--host 127.0.0.1 \
--port 8080 \
--endpoint /mcp \
--api-key my-secret-key \
--response-mode batch
# Endpoints: POST/GET/DELETE /mcp, plus /health</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Non-localhost binds require <code>--api-key</code> or <code>--keys-file</code>. Origin validation uses shared helpers from <code>praisonaiagents.mcp.mcp_security</code>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 3 — Recipe → MCP bridge</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Turn any PraisonAI recipe into a scoped MCP server with allow/deny lists and safe mode.</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonai mcp serve-recipe support-reply --transport stdio
praisonai mcp validate-recipe support-reply
praisonai mcp inspect-recipe support-reply
praisonai mcp config-generate-recipe support-reply --client claude-desktop</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Default denied tools include <code>shell.exec</code>, <code>file.delete</code>, <code>eval</code>, and similar destructive operations.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 4 — MCP client config management</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Config subcommands (<code>list</code>, <code>add</code>, <code>remove</code>, <code>sync</code>, <code>test</code>) require <code>praisonai-code</code> via <code>_code_bridge</code>.</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonai mcp list
praisonai mcp add filesystem \
--command npx \
--args "-y @modelcontextprotocol/server-filesystem ."
praisonai mcp test filesystem
praisonai mcp sync
praisonai mcp tools
praisonai mcp status</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 5 — Built-in registry (tools, resources, prompts)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Type</th><th>Examples</th><th>Adapter</th></tr></thead><tbody><tr><td>Tools</td><td><code>praisonai.chat.*</code>, <code>praisonai.workflow.*</code>, agent run helpers</td><td><code>mcp_server/adapters/capabilities.py</code>, <code>cli_tools.py</code></td></tr><tr><td>Resources</td><td><code>praisonai://memory/sessions</code>, <code>praisonai://workflows</code>, <code>praisonai://agents</code></td><td><code>adapters/resources.py</code></td></tr><tr><td>Prompts</td><td><code>deep-research</code>, <code>code-review</code>, <code>workflow-auto</code></td><td><code>adapters/prompts.py</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Inspect what the host exposes
praisonai-mcp list-tools
praisonai-mcp list-resources
praisonai-mcp list-prompts
# Host tool search (MCPServerCLI)
praisonai-mcp tools search "workflow"</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 6 — Security &amp; auth</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Concern</th><th>Package</th><th>Module</th></tr></thead><tbody><tr><td>Origin validation, session IDs</td><td><code>praisonaiagents</code></td><td><code>mcp/mcp_security.py</code></td></tr><tr><td>API keys, scoped keys file</td><td><code>praisonai-mcp</code></td><td><code>mcp_server/auth/api_key.py</code></td></tr><tr><td>OAuth 2.1 + PKCE</td><td><code>praisonai-mcp</code></td><td><code>mcp_server/auth/oauth.py</code></td></tr><tr><td>OIDC discovery</td><td><code>praisonai-mcp</code></td><td><code>mcp_server/auth/oidc.py</code></td></tr><tr><td>Scope enforcement</td><td><code>praisonai-mcp</code></td><td><code>mcp_server/auth/scopes.py</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Scoped keys file (--keys-file)
[
{"key": "monitor-key", "name": "monitor", "scopes": ["tools:read", "resources:read"]},
{"key": "admin-key", "name": "admin", "scopes": ["*"]}
]
# Env vars
export MCP_API_KEY=your-key
export PRAISONAI_MCP_MAX_SESSIONS=1000</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 7 — CLI routing (lazy load)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Registry</th><th>Commands</th><th>Gate</th></tr></thead><tbody><tr><td>MCP-resident Typer</td><td>list, add, remove, sync, test, serve, doctor</td><td><code>mcp_package_available()</code></td></tr><tr><td>MCPServerCLI host</td><td>serve, list-tools, list-resources, config-generate, tasks, auth</td><td>Direct via <code>praisonai-mcp &lt;cmd&gt;</code></td></tr><tr><td>Code-resident light</td><td><code>serve mcp</code></td><td>Always available with code + agents</td></tr><tr><td>Wrapper-resident</td><td>dashboard, schedule, langfuse</td><td><code>wrapper_package_available()</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>Standalone <code>praisonai-code</code> hides <code>mcp</code> from <code>--help</code> when <code>praisonai-mcp</code> is not installed. Host commands like <code>praisonai-mcp serve</code> skip the <code>mcp</code> prefix; <code>praisonai mcp serve</code> goes through the Typer group.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 8 — Python API</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>import praisonai_mcp
from praisonai_mcp.mcp_server import MCPServer
from praisonai_mcp.mcp_server.registry import register_tool
from praisonai_mcp.mcp_server.adapters import register_all
@register_tool("custom.greet")
def greet(name: str) -> str:
"""Greet a person by name."""
return f"Hello, {name}!"
register_all()
server = MCPServer(name="praisonai")
server.run(transport="stdio")</code></pre>
<!-- /wp:code -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Recipe host
from praisonai_mcp.mcp_server import RecipeMCPAdapter
adapter = RecipeMCPAdapter("support-reply")
adapter.load()
adapter.to_mcp_server().run(transport="stdio")
# Shim path still works
from praisonai.mcp_server import MCPServer</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 9 — Standalone (no wrapper)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install praisonaiagents "praisonai-mcp[all]"
export OPENAI_API_KEY=sk-...
praisonai-mcp serve --transport stdio
praisonai-mcp list-tools
praisonai-mcp doctor
praisonai-mcp --help</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Heavy MCP hosting needs only <code>praisonaiagents</code> + <code>praisonai-mcp</code>. Full capability registry (workflows, deploy, extended tools) activates when the wrapper is co-installed via <code>_wrapper_bridge</code>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Bridges (no PyPI cycles)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Bridge</th><th>Direction</th><th>Use</th></tr></thead><tbody><tr><td><code>_mcp_bridge</code></td><td>code → mcp</td><td>Route <code>praisonai mcp</code> into Typer group</td></tr><tr><td><code>_code_bridge</code></td><td>mcp → code</td><td>Config loader, paths, output controller</td></tr><tr><td><code>_wrapper_bridge</code></td><td>mcp → wrapper</td><td>Capabilities, recipe, deploy adapters</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Backward-compat shims</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Old path</th><th>Still works via</th></tr></thead><tbody><tr><td><code>praisonai.mcp_server.*</code></td><td><code>alias_package</code> → <code>praisonai_mcp.mcp_server</code></td></tr><tr><td><code>praisonai.cli.commands.mcp</code></td><td><code>sys.modules</code> shim → mcp Typer group</td></tr><tr><td><code>from praisonai.mcp_server import MCPServer</code></td><td>Lazy re-export through shim</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Seven-package publish order</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonaiagents → praisonai-code → praisonai-bot → praisonai-train → praisonai-browser → praisonai-mcp → praisonai (wrapper)</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Wrapper pins <code>praisonai-mcp&gt;=X</code> after mcp is on PyPI. CI: <code>.github/workflows/pypi-release.yml</code>. Import gate: <code>scripts/check_c12_mcp_imports.sh</code>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Summary</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Item</th><th>Value</th></tr></thead><tbody><tr><td>Tier</td><td>2e</td></tr><tr><td>PyPI</td><td><code>praisonai-mcp</code> v0.0.2</td></tr><tr><td>Runtime deps</td><td><code>praisonaiagents</code>, <code>mcp</code>, rich, typer</td></tr><tr><td>HTTP extra</td><td><code>[server]</code> — starlette, uvicorn</td></tr><tr><td>Auth extra</td><td><code>[auth]</code> — httpx</td></tr><tr><td>Transports</td><td><code>stdio</code>, <code>http-stream</code></td></tr><tr><td>Light alternative</td><td><code>praisonai serve mcp</code> (code tier)</td></tr><tr><td>CLI entry</td><td><code>praisonai-mcp</code> or <code>praisonai mcp</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>Previous: <a href="https://mer.vin/2026/07/praisonai-train-praisonai-train-fine-tuning-agent-training-in-depth/">praisonai-train</a> · Next: praisonai wrapper</p>
<!-- /wp:paragraph -->
+460
View File
@@ -0,0 +1,460 @@
<!-- wp:paragraph -->
<p>praisonai is Tier 3 — the integration wrapper that wires <code>praisonaiagents</code> + five Tier-2 packages (<code>praisonai-code</code>, <code>praisonai-bot</code>, <code>praisonai-train</code>, <code>praisonai-browser</code>, <code>praisonai-mcp</code>) into one install, with dashboard, framework adapters, jobs API, serve orchestration, and backward-compat shims. v4.6.150.</p>
<!-- /wp:paragraph -->
<!-- wp:merpress/mermaidjs {"align":"full"} -->
<div class="wp-block-merpress-mermaidjs diagram-source-mermaid alignfull"><pre class="mermaid">%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "lineColor": "#000000"}}}%%
flowchart TB
subgraph T1 [Tier 1 praisonaiagents]
A[Agent tools memory MCP client]
end
subgraph T2 [Tier 2 packages]
C[praisonai-code run chat code]
B[praisonai-bot gateway channels]
TR[praisonai-train fine-tune agents]
BR[praisonai-browser CDP Playwright]
MCP[praisonai-mcp server host]
end
subgraph T3 [Tier 3 praisonai wrapper]
W[dashboard jobs frameworks serve shims]
end
A --> C
A --> B
A --> TR
A --> BR
A --> MCP
W --> C
W --> B
W --> TR
W --> BR
W --> MCP
W --> A
classDef agent fill:#8B0000,color:#fff
classDef tool fill:#189AB4,color:#fff
class A agent
class W agent
class C tool
class B tool
class TR tool
class BR tool
class MCP tool
</pre></div>
<!-- /wp:merpress/mermaidjs -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Seven-package stack</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonaiagents → praisonai-code + praisonai-bot + praisonai-train + praisonai-browser + praisonai-mcp → praisonai (wrapper)</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Each Tier-2 package is installable standalone with its own console script. The wrapper pins all of them and preserves every old import path via shims. Use the wrapper when you need several surfaces together — HTTP serve, dashboard, framework YAML, jobs/recipe — without managing tier pins yourself.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Product catalog (C0–C12 shipped)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Package</th><th>Epic</th><th>Choose this when…</th><th>Standalone install</th></tr></thead><tbody><tr><td><code>praisonaiagents</code></td><td>Tier 1</td><td>Building or embedding agents in code — Agent, tools, memory, hooks</td><td><code>pip install praisonaiagents</code></td></tr><tr><td><code>praisonai-code</code></td><td>C0–C8</td><td>Terminal agentic CLI — run, chat, code, warm daemon</td><td><code>pip install praisonai-code</code></td></tr><tr><td><code>praisonai-bot</code></td><td>C9</td><td>Messaging bots + WebSocket gateway</td><td><code>pip install "praisonai-bot[gateway,bot]"</code></td></tr><tr><td><code>praisonai-train</code></td><td>C10</td><td>Agent training loops + GPU LLM fine-tuning</td><td><code>pip install praisonai-train</code> or <code>[llm]</code></td></tr><tr><td><code>praisonai-browser</code></td><td>C11</td><td>Chrome extension bridge, CDP, Playwright agents</td><td><code>pip install "praisonai-browser[all]"</code></td></tr><tr><td><code>praisonai-mcp</code></td><td>C12</td><td>MCP server for Cursor, Claude Desktop, Windsurf</td><td><code>pip install "praisonai-mcp[all]"</code></td></tr><tr><td><code>praisonai</code></td><td>Tier 3</td><td>Full product / umbrella — serve, dashboard, frameworks, jobs</td><td><code>pip install praisonai</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Three-layer products (do not conflate)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Product</th><th>Layer 1 (agents)</th><th>Layer 2 (dedicated pkg)</th><th>Layer 3 (wrapper)</th></tr></thead><tbody><tr><td>Browser</td><td><code>tools/protocols/browser.py</code></td><td><code>praisonai-browser</code></td><td>shims + optional full stack</td></tr><tr><td>MCP</td><td><code>praisonaiagents/mcp</code> client + light server</td><td><code>praisonai-mcp</code> heavy host</td><td>capability bodies via <code>_wrapper_bridge</code></td></tr><tr><td>Bots</td><td>bots/gateway protocols</td><td><code>praisonai-bot</code></td><td>shims only</td></tr><tr><td>Train</td><td>Agent + hooks in agents</td><td><code>praisonai-train</code></td><td>shims + <code>setup-conda-env</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Install matrix</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>1. Base install (full seven-package stack)</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install praisonai
export OPENAI_API_KEY=sk-...
praisonai doctor
praisonai version show</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>2. Targeted extras</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai[claw]" # dashboard + bots + gateway
pip install "praisonai[all]" # onboarding + messaging + search stack
pip install "praisonai[train]" # LLM fine-tuning (Unsloth stack)
pip install "praisonai[mcp]" # full MCP server host
pip install "praisonai[browser]" # extension bridge + CDP + Playwright
pip install "praisonai[crewai]" # multi-framework YAML</code></pre>
<!-- /wp:code -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Package</th><th>Min version (wrapper pin)</th><th>Console script</th></tr></thead><tbody><tr><td><code>praisonaiagents</code></td><td>≥ 1.6.153</td><td>—</td></tr><tr><td><code>praisonai-code</code></td><td>≥ 0.0.49</td><td><code>praisonai-code</code></td></tr><tr><td><code>praisonai-bot</code></td><td>≥ 0.0.34</td><td><code>praisonai-bot</code></td></tr><tr><td><code>praisonai-train</code></td><td>≥ 0.0.5</td><td><code>praisonai-train</code></td></tr><tr><td><code>praisonai-browser</code></td><td>≥ 0.0.2</td><td><code>praisonai-browser</code></td></tr><tr><td><code>praisonai-mcp</code></td><td>≥ 0.0.2</td><td><code>praisonai-mcp</code></td></tr><tr><td><code>praisonai</code></td><td>4.6.150</td><td><code>praisonai</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:separator -->
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<!-- /wp:separator -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 1 — What wrapper adds (not in Tier-2 alone)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Feature</th><th>Command / path</th><th>Owner</th><th>Extracted?</th></tr></thead><tbody><tr><td>Unified CLI router</td><td><code>praisonai …</code></td><td>code Typer + 6 resident registries</td><td>—</td></tr><tr><td>HTTP serve orchestration</td><td><code>praisonai serve agents|recipe|a2a|…</code></td><td>wrapper <code>cli/features/serve.py</code></td><td>Deferred (C15 epic)</td></tr><tr><td>Dashboard launcher</td><td><code>praisonai dashboard</code></td><td>wrapper</td><td>Stay wrapper</td></tr><tr><td>Framework adapters</td><td><code>praisonai --framework crewai</code></td><td>wrapper <code>framework_adapters/</code></td><td>Stay wrapper (impls in external PraisonAI-Frameworks)</td></tr><tr><td>Jobs API</td><td><code>praisonai.jobs</code> · port 8005</td><td>wrapper</td><td>Deferred (with serve/recipe)</td></tr><tr><td>Recipe NL → YAML</td><td><code>praisonai recipe …</code></td><td>wrapper</td><td>Deferred</td></tr><tr><td>Scheduler CLI</td><td><code>praisonai schedule …</code></td><td>wrapper</td><td>Stay wrapper (3-layer split with bot)</td></tr><tr><td>Sandbox execution</td><td><code>praisonai sandbox …</code></td><td>wrapper <code>sandbox/</code></td><td>C13 candidate</td></tr><tr><td>Cloud deploy</td><td><code>praisonai deploy …</code></td><td>wrapper <code>deploy/</code></td><td>C13 candidate</td></tr><tr><td>Langfuse / Langflow / n8n</td><td><code>langfuse</code>, <code>flow</code>, <code>n8n</code></td><td>wrapper</td><td>Stay wrapper</td></tr><tr><td>Backward-compat shims</td><td><code>praisonai.bots</code> → <code>praisonai_bot</code></td><td>wrapper <code>cli/_shim.py</code></td><td>Permanent</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>Tier-2 packages own their domains; the wrapper owns integration surfaces that span multiple tiers.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 2 — Terminal hot path (via code tier)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install praisonai
export OPENAI_API_KEY=sk-...
praisonai run "Summarise the latest AI agent trends"
praisonai chat
praisonai code
praisonai daemon start --background
praisonai run "Hello" # auto-forwards to warm runtime</code></pre>
<!-- /wp:code -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Python SDK (Tier 1 — same everywhere)
from praisonaiagents import Agent
agent = Agent(instructions="You are a helpful AI assistant")
agent.start("Write a movie script about a robot on Mars")</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Deep dive: <a href="https://mer.vin/2026/07/praisonai-code-praisonai-code-terminal-cli-in-depth/">praisonai-code in-depth</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 3 — Train (via praisonai-train tier)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code># LLM fine-tuning (Unsloth) — lazy ML deps
praisonai train llm dataset.json
praisonai train llm --model llama-3.1 dataset.json
# Agent training — LLM-as-judge
praisonai train agents --input "What is Python?" --iterations 3
# Human feedback loop
praisonai train agents --input "Explain quantum computing" --human
# Session management
praisonai train list
praisonai train apply train-abc123 --run "And Germany?"
# Standalone script (no wrapper prefix)
praisonai-train agents --input "Hello" --iterations 2</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Deep dive: <a href="https://mer.vin/2026/07/praisonai-train-praisonai-train-fine-tuning-agent-training-in-depth/">praisonai-train in-depth</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 4 — Bots &amp; gateway (via bot tier)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai[bot]"
export OPENAI_API_KEY=sk-...
export TELEGRAM_BOT_TOKEN=...
praisonai onboard
praisonai bot start --platform telegram
praisonai gateway start --config ~/.praisonai/bot.yaml
praisonai gateway install --config ~/.praisonai/bot.yaml
praisonai pairing approve telegram ABC12345</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Deep dive: <a href="https://mer.vin/2026/07/praisonai-bot-praisonai-bot-gateway-channels-in-depth/">praisonai-bot in-depth</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 5 — MCP server host (via mcp tier)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Command</th><th>Layer</th><th>Package</th></tr></thead><tbody><tr><td><code>praisonai serve mcp</code></td><td>Light server</td><td><code>praisonai-code</code> + agents</td></tr><tr><td><code>praisonai mcp serve</code></td><td>Heavy host</td><td><code>praisonai-mcp</code></td></tr><tr><td><code>praisonai-mcp serve</code></td><td>Heavy host (direct)</td><td><code>praisonai-mcp</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Heavy MCP host — full tool/resource/prompt registry
praisonai mcp serve --transport stdio
praisonai mcp serve --transport http-stream --port 8080 --api-key secret
# Recipe → scoped MCP server
praisonai mcp serve-recipe support-reply --transport stdio
# Client config management (needs praisonai-code co-installed)
praisonai mcp list
praisonai mcp add filesystem --command npx --args "-y @modelcontextprotocol/server-filesystem ."
# Generate Cursor / Claude Desktop config
praisonai mcp config-generate --client cursor --transport stdio</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Deep dive: <a href="https://mer.vin/2026/07/praisonai-mcp-praisonai-mcp-server-host-client-config-in-depth/">praisonai-mcp in-depth</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 6 — Browser automation (via browser tier)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai[browser]"
# Extension bridge server + LLM browser agent
praisonai browser start
praisonai browser run "Find the latest Python release notes"
# Diagnostics
praisonai browser doctor
# Lightweight tool shim (code tier — no praisonai-browser required)
praisonai browser-tool snapshot https://example.com
# Standalone script
praisonai-browser start
praisonai-browser run "Click the login button"</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Three layers: agents protocols → <code>praisonai browser-tool</code> (praisonai-tools) → <code>praisonai browser</code> (extension bridge, CDP, Playwright).</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Deep dive: <a href="https://mer.vin/2026/07/praisonai-browser-praisonai-browser-browser-automation-in-depth/">praisonai-browser in-depth</a></p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 7 — Dashboard stack</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai[claw,flow,ui]"
# Individual services
praisonai claw # :8082 — ops dashboard
praisonai flow # :7861 — Langflow
praisonai ui # :8081 — clean chat
# Unified launcher (wrapper-only)
praisonai dashboard # :3000
praisonai dashboard --port 9000 --no-auto-start</code></pre>
<!-- /wp:code -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Port</th><th>Service</th></tr></thead><tbody><tr><td>3000</td><td>Dashboard hub</td></tr><tr><td>7860/7861</td><td>Langflow</td></tr><tr><td>8081</td><td>UI chat</td></tr><tr><td>8082</td><td>Claw</td></tr><tr><td>8765</td><td>Gateway WebSocket</td></tr><tr><td>8005</td><td>Jobs API</td></tr><tr><td>8080</td><td>MCP HTTP stream (optional)</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 8 — Multi-framework YAML</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>pip install "praisonai[crewai]"
export OPENAI_API_KEY=sk-...
praisonai --framework crewai --auto "Create a movie script"
praisonai run --file agents.yaml --framework crewai
pip install "praisonai[autogen]"
praisonai --framework autogen agents.yaml</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Protocols live in <code>praisonaiagents/frameworks/</code>; adapter implementations in wrapper <code>framework_adapters/</code>. Entry-point group: <code>praisonai.framework_adapters</code>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 9 — Scheduler (24/7 agents)</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonai schedule add --agent my_agent.yaml --expr "hourly"
praisonai schedule list
praisonai schedule start</code></pre>
<!-- /wp:code -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Python
from praisonai.scheduler import AgentScheduler
from praisonaiagents import Agent
agent = Agent(name="NewsChecker", instructions="Check latest AI news")
scheduler = AgentScheduler(agent=agent, task="Summarise top 3 AI stories")
scheduler.start("hourly", run_immediately=True)</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Three scheduler layers: job store (<code>praisonaiagents.scheduler</code>) → CLI (<code>praisonai schedule</code>, wrapper) → gateway tick delivery (<code>praisonai_bot.scheduler.executor</code>).</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 10 — Jobs API &amp; wrapper-only surfaces</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Jobs, recipe, serve, sandbox, and deploy remain wrapper-owned today (deferred or C13 candidates).</p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code># Jobs API (wrapper — port 8005)
python -m uvicorn praisonai.jobs.server:create_app --port 8005 --factory
praisonai run submit "Analyse AI trends"
praisonai run submit "Analyse news" --recipe news-analyzer --wait
export PRAISONAI_JOBS_API_KEY=your-secret
# HTTP serve (wrapper orchestration — Typer shell in code tier)
praisonai serve agents --port 8080
praisonai serve recipe support-reply
# Sandbox / deploy (wrapper today — C13 extraction candidates)
praisonai sandbox run "print hello" --backend docker
praisonai deploy agents.yaml --provider aws</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 11 — Lazy CLI routing (six resident registries)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Registry</th><th>Count</th><th>Examples</th><th>Loaded from</th><th>Gate</th></tr></thead><tbody><tr><td>Code-resident</td><td>~40</td><td>run, chat, code, daemon, serve, config</td><td><code>praisonai_code.cli.commands.*</code></td><td>always</td></tr><tr><td>Bot-resident</td><td>8</td><td>bot, gateway, onboard, kanban, claw</td><td><code>praisonai_bot.cli.commands.*</code></td><td><code>bot_package_available()</code></td></tr><tr><td>Train-resident</td><td>1</td><td>train</td><td><code>praisonai_train.cli.commands.*</code></td><td><code>train_package_available()</code></td></tr><tr><td>Browser-resident</td><td>1</td><td>browser</td><td><code>praisonai_browser.cli.commands.*</code></td><td><code>browser_package_available()</code></td></tr><tr><td>MCP-resident</td><td>1</td><td>mcp</td><td><code>praisonai_mcp.cli.commands.*</code></td><td><code>mcp_package_available()</code></td></tr><tr><td>Wrapper-resident</td><td>22</td><td>dashboard, schedule, flow, langfuse, recipe</td><td><code>praisonai.cli.commands.*</code></td><td><code>wrapper_available()</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonai --help # 70+ commands, lazy-loaded
praisonai doctor
praisonai train --help
praisonai mcp --help
praisonai browser --help
praisonai dashboard --help</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>Standalone <code>praisonai-code</code> hides bot/train/browser/mcp/wrapper commands from <code>--help</code> when those packages are absent.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 12 — Shim map (backward compat)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Old import / path</th><th>Canonical target</th></tr></thead><tbody><tr><td><code>praisonai.cli.main</code></td><td><code>praisonai_code.cli.main</code></td></tr><tr><td><code>praisonai.runtime.*</code></td><td><code>praisonai_code.runtime.*</code></td></tr><tr><td><code>praisonai.bots.*</code></td><td><code>praisonai_bot.bots.*</code></td></tr><tr><td><code>praisonai.gateway.*</code></td><td><code>praisonai_bot.gateway.*</code></td></tr><tr><td><code>praisonai.train.*</code></td><td><code>praisonai_train.train.*</code></td></tr><tr><td><code>praisonai.browser.*</code></td><td><code>praisonai_browser.*</code></td></tr><tr><td><code>praisonai.mcp_server.*</code></td><td><code>praisonai_mcp.mcp_server.*</code></td></tr><tr><td><code>praisonai.scheduler.executor</code></td><td><code>praisonai_bot.scheduler.executor</code></td></tr><tr><td><code>setup-conda-env</code></td><td><code>praisonai_train.setup.setup_conda_env</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:code -->
<pre class="wp-block-code"><code># These must keep working
from praisonai.cli.main import PraisonAI
from praisonai.bots import Bot
from praisonai.gateway import WebSocketGateway
from praisonai.train.agents import AgentTrainer
from praisonai.mcp_server import MCPServer
python -m praisonai run "hello"
python -m praisonai.runtime</code></pre>
<!-- /wp:code -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Section 13 — Bridges (no PyPI cycles)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Bridge</th><th>Direction</th><th>Use</th></tr></thead><tbody><tr><td><code>_wrapper_bridge</code></td><td>code → wrapper</td><td>serve handlers, frameworks, jobs</td></tr><tr><td><code>_bot_bridge</code></td><td>code → bot</td><td>bot/gateway CLI routing</td></tr><tr><td><code>_train_bridge</code></td><td>code → train</td><td>train CLI routing</td></tr><tr><td><code>_browser_bridge</code></td><td>code → browser</td><td>browser CLI routing</td></tr><tr><td><code>_mcp_bridge</code></td><td>code → mcp</td><td>mcp CLI routing</td></tr><tr><td><code>_code_bridge</code></td><td>tier-2 → code</td><td>config kernel, legacy dispatch</td></tr><tr><td><code>_wrapper_bridge</code></td><td>tier-2 → wrapper</td><td>capabilities, recipe, jobs/UI</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">When to use wrapper vs a Tier-2 package alone</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Your goal</th><th>Install</th></tr></thead><tbody><tr><td>Only terminal agents</td><td><code>praisonai-code</code> (+ optional <code>praisonaiagents</code>)</td></tr><tr><td>Only bots on Telegram/Slack</td><td><code>praisonai-bot</code></td></tr><tr><td>Only train / fine-tune</td><td><code>praisonai-train</code></td></tr><tr><td>Only automate browser</td><td><code>praisonai-browser</code></td></tr><tr><td>Only MCP server for IDE</td><td><code>praisonai-mcp</code></td></tr><tr><td>Several of the above + serve / dashboard / framework YAML</td><td><code>pip install praisonai</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">What stays in wrapper (not extracted)</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Surface</th><th>Why it stays</th></tr></thead><tbody><tr><td><code>dashboard</code> / <code>flow</code> / <code>ui</code></td><td>Langflow extra + launcher glue — not a standalone PyPI product</td></tr><tr><td><code>claw</code></td><td>Default app lives in <code>praisonai-bot</code>; wrapper is a thin shim</td></tr><tr><td><code>framework_adapters/</code></td><td>Thin registry; heavy impls in external PraisonAI-Frameworks</td></tr><tr><td><code>schedule</code> CLI</td><td>Three-layer split: agents store + wrapper CLI + bot executor</td></tr><tr><td><code>serve</code> / <code>recipe</code> / <code>jobs</code></td><td>~14k LOC deferred epic — high coupling (C15)</td></tr><tr><td><code>sandbox</code> / <code>deploy</code></td><td>Still in wrapper today; C13 extraction candidates</td></tr><tr><td><code>standardise</code> / suite runner</td><td>Maintainer/docs tooling — internal only</td></tr><tr><td><code>persist</code> / enterprise adapters</td><td><strong>Rejected</strong> — agents already ship File/SQLite defaults; no crisp standalone story</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Roadmap — C13+ candidates</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Package</th><th>Status</th><th>Choose when…</th><th>Standalone install (planned)</th></tr></thead><tbody><tr><td><code>praisonai-sandbox</code></td><td><strong>C13 preferred</strong> (execution goal)</td><td>Isolated agent code execution — Docker/E2B/Modal/Daytona/Sandlock</td><td><code>pip install praisonai-sandbox[docker]</code></td></tr><tr><td><code>praisonai-deploy</code></td><td><strong>C13 alt</strong> (deploy goal)</td><td>Ship <code>agents.yaml</code> to Docker/AWS/GCP/Azure</td><td><code>pip install praisonai-deploy</code></td></tr><tr><td><code>praisonai-replay</code></td><td>Conditional C14+</td><td>Deterministic replay from run ledger / traces</td><td>After product sign-off</td></tr><tr><td><code>praisonai-serve</code></td><td>Deferred C15</td><td>HTTP API hosting without full umbrella (~14k LOC)</td><td>With recipe/jobs decision</td></tr><tr><td><code>praisonai-recipe</code></td><td>Deferred</td><td>NL → agent YAML without jobs UI</td><td>Tied to jobs + serve</td></tr><tr><td><code>praisonai-jobs</code></td><td>Deferred</td><td>Async long-running agent jobs API</td><td>Extract with serve or stay wrapper</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>C13 decision rule: <strong>sandbox</strong> = where code runs; <strong>deploy</strong> = where the agent service lives. Ship one first after product sign-off.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Standalone extraction litmus test</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Criterion</th><th>Pass (browser/MCP)</th><th>Fail (example)</th></tr></thead><tbody><tr><td>Named user goal without full <code>praisonai</code></td><td><code>pip install praisonai-browser</code> → automate Chrome</td><td><code>pip install praisonai-persist</code> → ???</td></tr><tr><td>Coherent product boundary</td><td>One Typer group / one console script</td><td>Whole <code>cli/features/</code> orchestration layer</td></tr><tr><td>PyPI deps: <code>praisonaiagents</code> only</td><td>Tier-2 + lazy <code>_wrapper_bridge</code></td><td>Hard <code>import praisonai</code> at module level</td></tr><tr><td>Worth a separate install</td><td>User who never wants dashboard/serve/bots</td><td>Internal docs tooling</td></tr><tr><td>Extraction shape</td><td>C10 single PR (~3–11k LOC)</td><td>Mega-epic without product sign-off</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">When to use which tier</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Scenario</th><th>Install</th></tr></thead><tbody><tr><td>Pure Python agents, minimal deps</td><td><code>pip install praisonaiagents</code></td></tr><tr><td>Terminal coding agent, CI, headless</td><td><code>pip install praisonai-code</code></td></tr><tr><td>Telegram/Discord gateway only</td><td><code>pip install "praisonai-bot[gateway,bot]"</code></td></tr><tr><td>Agent training (no GPU)</td><td><code>pip install praisonai-train</code></td></tr><tr><td>LLM fine-tuning (GPU)</td><td><code>pip install "praisonai-train[llm]"</code></td></tr><tr><td>MCP server for Cursor/Claude</td><td><code>pip install "praisonai-mcp[all]"</code></td></tr><tr><td>Browser automation (extension/CDP)</td><td><code>pip install "praisonai-browser[all]"</code></td></tr><tr><td>CrewAI/AutoGen YAML</td><td><code>pip install "praisonai[crewai]"</code></td></tr><tr><td>Full ops + channels + dashboard</td><td><code>pip install "praisonai[claw]"</code></td></tr><tr><td>Everything in one install</td><td><code>pip install praisonai</code></td></tr><tr><td>Library author / embedding</td><td><code>praisonaiagents</code> only</td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Seven-package publish order</h2>
<!-- /wp:heading -->
<!-- wp:code -->
<pre class="wp-block-code"><code>praisonaiagents
→ praisonai-code + praisonai-bot + praisonai-train + praisonai-browser + praisonai-mcp
→ praisonai (wrapper pins all tier-2 deps last)</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p>CI: <code>.github/workflows/pypi-release.yml</code> · selective publish: <code>publish_all.py --changed-only</code> (default). Playbook per package: manifest → TDD compat tests → git mv → shims → <code>_X_RESIDENT_COMMANDS</code> → CI shard → PyPI.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2 class="wp-block-heading">Summary</h2>
<!-- /wp:heading -->
<!-- wp:table -->
<figure class="wp-block-table"><table><thead><tr><th>Item</th><th>Value</th></tr></thead><tbody><tr><td>Tier</td><td>3 (integration wrapper)</td></tr><tr><td>PyPI</td><td><code>praisonai</code> v4.6.150</td></tr><tr><td>Shipped tier-2 deps</td><td>code, bot, train, browser, mcp (C0–C12)</td></tr><tr><td>Resident registries</td><td>6 (code + bot + train + browser + mcp + wrapper)</td></tr><tr><td>Wrapper-only (~140k LOC)</td><td>serve, recipe, jobs, dashboard, sandbox, deploy, frameworks</td></tr><tr><td>Next extraction</td><td>C13: sandbox or deploy (product sign-off)</td></tr><tr><td>One-liner still works</td><td><code>pip install praisonai</code></td></tr></tbody></table></figure>
<!-- /wp:table -->
<!-- wp:paragraph -->
<p>Architecture overview: Seven-package C7–C12 extraction · Post-C12 roadmap (C13+)</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Series: <a href="https://mer.vin/2026/07/praisonai-code-praisonai-code-terminal-cli-in-depth/">praisonai-code</a> · <a href="https://mer.vin/2026/07/praisonai-bot-praisonai-bot-gateway-channels-in-depth/">praisonai-bot</a> · <a href="https://mer.vin/2026/07/praisonai-train-praisonai-train-fine-tuning-agent-training-in-depth/">praisonai-train</a> · <a href="https://mer.vin/2026/07/praisonai-browser-praisonai-browser-browser-automation-in-depth/">praisonai-browser</a> · <a href="https://mer.vin/2026/07/praisonai-mcp-praisonai-mcp-server-host-client-config-in-depth/">praisonai-mcp</a> · praisonai wrapper</p>
<!-- /wp:paragraph -->
@@ -1,5 +1,5 @@
name: Install PraisonAI monorepo packages
description: Install praisonai-agents, praisonai-code, praisonai-bot, praisonai-train, praisonai-browser, praisonai-mcp, and praisonai wrapper from local paths (mirrors PyPI seven-package install order).
description: Install praisonai-agents, praisonai-code, praisonai-bot, praisonai-train, praisonai-browser, praisonai-mcp, praisonai-sandbox, and praisonai wrapper from local paths (mirrors PyPI eight-package install order).
inputs:
repo-root:
@@ -39,6 +39,7 @@ runs:
TRAIN_PKG="${BASE}src/praisonai-train"
BROWSER_PKG="${BASE}src/praisonai-browser"
MCP_PKG="${BASE}src/praisonai-mcp"
SANDBOX_PKG="${BASE}src/praisonai-sandbox"
WRAPPER_PKG="${BASE}src/praisonai"
normalise_extras() {
@@ -66,6 +67,8 @@ runs:
uv pip install --system -e .
cd "$MCP_PKG"
uv pip install --system -e .
cd "$SANDBOX_PKG"
uv pip install --system -e .
cd "$WRAPPER_PKG"
uv pip install --system "${WRAPPER_SUFFIX}"
else
@@ -81,6 +84,8 @@ runs:
pip install -e .
cd "$MCP_PKG"
pip install -e .
cd "$SANDBOX_PKG"
pip install -e .
cd "$WRAPPER_PKG"
pip install -e "${WRAPPER_SUFFIX}"
fi
+56
View File
@@ -40,6 +40,62 @@ assert('claude final reply detected', mg.isClaudeFinalReplyComment(withClaudeRep
assert('cancelled detect-and-trigger does not block', mg.OPTIONAL_CANCELLED_CHECKS.has('detect-and-trigger'));
const coreGreenRuns = [
{ name: 'test-core', status: 'completed', conclusion: 'success' },
{ name: 'test-core (cli)', status: 'completed', conclusion: 'success' },
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
{ name: 'test-windows', status: 'completed', conclusion: 'cancelled' },
];
assert('core green allows cancelled smoke', mg.isAcceptableCheckConclusion(
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
coreGreenRuns
));
assert('core green allows cancelled test-windows', mg.isAcceptableCheckConclusion(
{ name: 'test-windows', status: 'completed', conclusion: 'cancelled' },
coreGreenRuns
));
assert('cancelled smoke blocks when core missing', !mg.isAcceptableCheckConclusion(
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
[{ name: 'smoke', status: 'completed', conclusion: 'cancelled' }]
));
assert('cancelled smoke blocks when core failed', !mg.isAcceptableCheckConclusion(
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
[
{ name: 'test-core', status: 'completed', conclusion: 'failure' },
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
]
));
assert('bestRunsByName prefers success over cancelled', (() => {
const best = mg.bestRunsByName([
{ name: 'smoke', conclusion: 'cancelled' },
{ name: 'smoke', conclusion: 'success' },
]);
return best.length === 1 && best[0].conclusion === 'success';
})());
assert('bestRunsByName prefers pending over completed cancelled', (() => {
const best = mg.bestRunsByName([
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
{ name: 'smoke', status: 'in_progress', conclusion: null },
]);
return best.length === 1 && best[0].status === 'in_progress';
})());
assert('bestRunsByName keeps pending regardless of order', (() => {
const best = mg.bestRunsByName([
{ name: 'smoke', status: 'in_progress', conclusion: null },
{ name: 'smoke', status: 'completed', conclusion: 'success' },
]);
return best.length === 1 && best[0].status === 'in_progress';
})());
assert('allChecksGreenOnSha style: pending re-run blocks despite core green', (() => {
const runs = mg.bestRunsByName([
{ name: 'test-core', status: 'completed', conclusion: 'success' },
{ name: 'smoke', status: 'completed', conclusion: 'cancelled' },
{ name: 'smoke', status: 'queued', conclusion: null },
]);
const smoke = runs.find((r) => r.name === 'smoke');
return smoke.status !== 'completed';
})());
// Stale-FINAL recovery guards (PR #2560 push loop)
const nowMs = Date.now();
const iso = (ms) => new Date(ms).toISOString();
+79 -5
View File
@@ -44,6 +44,8 @@ const BLOCK_LABELS = new Set([
const MERGE_READY_LABEL = 'pipeline/merge-ready';
/** Superseded concurrency runs; must not block merge when real tests passed. */
const OPTIONAL_CANCELLED_CHECKS = new Set(['detect-and-trigger']);
/** Cancelled smoke/windows after timeout are non-blocking when core shards passed on HEAD. */
const OPTIONAL_CANCELLED_WHEN_CORE_GREEN = new Set(['smoke', 'test-windows']);
const BOT_REVIEWER_PATTERNS = [
'coderabbit',
'qodo',
@@ -325,8 +327,70 @@ function listFailedChecksOnSha(runs) {
});
}
function isCoreTestRun(run) {
const name = run?.name || '';
return name === 'test-core' || name.startsWith('test-core ') || name === 'test-core-collect';
}
function coreTestsGreenOnRuns(runs) {
const coreRuns = (runs || []).filter(isCoreTestRun);
if (coreRuns.length === 0) return false;
return coreRuns.every(
(run) =>
run.status === 'completed' &&
['success', 'neutral', 'skipped'].includes(run.conclusion)
);
}
function checkConclusionRank(conclusion) {
if (conclusion === 'success') return 4;
if (conclusion === 'neutral') return 3;
if (conclusion === 'skipped') return 2;
if (conclusion === 'cancelled') return 1;
return 0;
}
function isPendingRun(run) {
return !!(run && run.status && run.status !== 'completed');
}
function bestRunsByName(runs) {
const byName = new Map();
for (const run of runs || []) {
if (!run) continue;
const existing = byName.get(run.name);
if (!existing) {
byName.set(run.name, run);
continue;
}
const runPending = isPendingRun(run);
const existingPending = isPendingRun(existing);
if (existingPending) continue;
if (
runPending ||
checkConclusionRank(run.conclusion) > checkConclusionRank(existing.conclusion)
) {
byName.set(run.name, run);
}
}
return [...byName.values()];
}
function isAcceptableCheckConclusion(run, runs) {
if (['success', 'neutral', 'skipped'].includes(run.conclusion)) return true;
if (run.conclusion === 'cancelled' && OPTIONAL_CANCELLED_CHECKS.has(run.name)) return true;
if (
run.conclusion === 'cancelled' &&
OPTIONAL_CANCELLED_WHEN_CORE_GREEN.has(run.name) &&
coreTestsGreenOnRuns(runs)
) {
return true;
}
return false;
}
async function allChecksGreenOnSha(github, owner, repo, sha, core) {
const runs = await listChecksOnSha(github, owner, repo, sha);
const runs = bestRunsByName(await listChecksOnSha(github, owner, repo, sha));
if (runs.length === 0) {
core?.info?.(`No check runs on ${sha.slice(0, 7)} — allowing (e.g. docs-only PR)`);
return true;
@@ -336,13 +400,17 @@ async function allChecksGreenOnSha(github, owner, repo, sha, core) {
core?.info?.(`Check pending: ${run.name} (${run.status})`);
return false;
}
const ok =
['success', 'neutral', 'skipped'].includes(run.conclusion) ||
(run.conclusion === 'cancelled' && OPTIONAL_CANCELLED_CHECKS.has(run.name));
if (!ok) {
if (!isAcceptableCheckConclusion(run, runs)) {
core?.info?.(`Check failed: ${run.name} (${run.conclusion})`);
return false;
}
if (
run.conclusion === 'cancelled' &&
OPTIONAL_CANCELLED_WHEN_CORE_GREEN.has(run.name) &&
coreTestsGreenOnRuns(runs)
) {
core?.info?.(`Ignoring cancelled ${run.name} — test-core green on HEAD`);
}
}
return true;
}
@@ -855,6 +923,12 @@ module.exports = {
finalClaudeCompletedOnSha,
getMergeState,
OPTIONAL_CANCELLED_CHECKS,
OPTIONAL_CANCELLED_WHEN_CORE_GREEN,
isCoreTestRun,
coreTestsGreenOnRuns,
isPendingRun,
bestRunsByName,
isAcceptableCheckConclusion,
listChecksOnSha,
listFailedChecksOnSha,
allChecksGreenOnSha,
+10 -5
View File
@@ -49,12 +49,14 @@ jobs:
// --- Label triage ---
const labels = [];
// Kind labels
// Kind labels (bug before "how to" — bug reports often include "## How to fix")
if (content.includes('feature request') || content.includes('[feature')) {
labels.push('enhancement');
} else if (content.includes('bug') || content.includes('error') || content.includes('crash') || content.includes('traceback')) {
} else if (!title.includes('[question]') && (content.includes('bug') || content.includes('error') || content.includes('crash') || content.includes('traceback'))) {
labels.push('bug');
} else if (content.includes('question') || content.includes('how do i') || content.includes('how to')) {
} else if (title.includes('[question]') || content.includes('how do i') || (content.includes('how to') && !content.includes('how to fix'))) {
labels.push('question');
} else if (content.includes('question')) {
labels.push('question');
}
@@ -105,8 +107,11 @@ jobs:
// --- Auto-trigger Claude for owner issues and actionable external bug/enhancement reports ---
const titleLower = (issue.title || '').toLowerCase();
const hasActionableTitle = /^(bug:|fix[:(]|feat:|ux:|enhancement:)/.test(titleLower);
const autoClaude = isOwner || (hasActionableTitle && (labels.includes('bug') || labels.includes('enhancement')));
const hasActionableTitle = /^(\[[^\]]+\]|bug:|fix[:(]|feat:|ux:|enhancement:)/i.test(titleLower);
const autoClaude = isOwner || (hasActionableTitle && (
labels.includes('bug') ||
(labels.includes('enhancement') && !labels.includes('question'))
));
if (autoClaude) {
await github.rest.issues.addLabels({
issue_number: issue.number,
+119 -1
View File
@@ -56,6 +56,11 @@ on:
required: false
default: false
type: boolean
skip_sandbox:
description: 'Skip praisonai-sandbox publish (recovery if already on PyPI)'
required: false
default: false
type: boolean
agents_version:
description: 'Override agents version (empty = auto bump from pyproject.toml)'
required: false
@@ -91,6 +96,11 @@ on:
required: false
default: ''
type: string
sandbox_version:
description: 'Override praisonai-sandbox version (empty = auto bump from pyproject.toml)'
required: false
default: ''
type: string
source:
description: 'Trigger source (audit trail)'
required: false
@@ -167,12 +177,14 @@ jobs:
TRAIN_OVERRIDE: ${{ inputs.train_version }}
BROWSER_OVERRIDE: ${{ inputs.browser_version }}
MCP_OVERRIDE: ${{ inputs.mcp_version }}
SANDBOX_OVERRIDE: ${{ inputs.sandbox_version }}
SKIP_AGENTS: ${{ inputs.skip_agents }}
SKIP_CODE: ${{ inputs.skip_code }}
SKIP_BOT: ${{ inputs.skip_bot }}
SKIP_TRAIN: ${{ inputs.skip_train }}
SKIP_BROWSER: ${{ inputs.skip_browser }}
SKIP_MCP: ${{ inputs.skip_mcp }}
SKIP_SANDBOX: ${{ inputs.skip_sandbox }}
run: |
python <<'PY'
import os
@@ -208,6 +220,7 @@ jobs:
train_override = os.environ.get("TRAIN_OVERRIDE", "").strip()
browser_override = os.environ.get("BROWSER_OVERRIDE", "").strip()
mcp_override = os.environ.get("MCP_OVERRIDE", "").strip()
sandbox_override = os.environ.get("SANDBOX_OVERRIDE", "").strip()
validate_version("agents_version", agents_override)
validate_version("wrapper_version", wrapper_override)
validate_version("code_version", code_override)
@@ -215,6 +228,7 @@ jobs:
validate_version("train_version", train_override)
validate_version("browser_version", browser_override)
validate_version("mcp_version", mcp_override)
validate_version("sandbox_version", sandbox_override)
agents_pyproject = root / "src/praisonai-agents/pyproject.toml"
agents_content = agents_pyproject.read_text()
@@ -264,6 +278,14 @@ jobs:
sys.exit(1)
current_mcp = mcp_match.group(1)
sandbox_pyproject = root / "src/praisonai-sandbox/pyproject.toml"
sandbox_content = sandbox_pyproject.read_text()
sandbox_match = re.search(r'^version\s*=\s*"([^"]+)"', sandbox_content, re.MULTILINE)
if not sandbox_match:
print("Could not read praisonai-sandbox version from pyproject.toml", file=sys.stderr)
sys.exit(1)
current_sandbox = sandbox_match.group(1)
wrapper_version_py = root / "src/praisonai/praisonai/version.py"
wrapper_content = wrapper_version_py.read_text()
wrapper_match = re.search(r'__version__ = "([^"]+)"', wrapper_content)
@@ -279,6 +301,7 @@ jobs:
("train", current_train),
("browser", current_browser),
("mcp", current_mcp),
("sandbox", current_sandbox),
("wrapper", current_wrapper),
):
if not SEMVER.match(value):
@@ -291,6 +314,7 @@ jobs:
skip_train = os.environ.get("SKIP_TRAIN", "false").lower() == "true"
skip_browser = os.environ.get("SKIP_BROWSER", "false").lower() == "true"
skip_mcp = os.environ.get("SKIP_MCP", "false").lower() == "true"
skip_sandbox = os.environ.get("SKIP_SANDBOX", "false").lower() == "true"
if agents_override:
agents_version = agents_override
@@ -334,6 +358,13 @@ jobs:
else:
mcp_version = bump_version(current_mcp)
if sandbox_override:
sandbox_version = sandbox_override
elif skip_sandbox:
sandbox_version = current_sandbox
else:
sandbox_version = bump_version(current_sandbox)
if wrapper_override:
wrapper_version = wrapper_override
else:
@@ -347,6 +378,7 @@ jobs:
fh.write(f"train_version={train_version}\n")
fh.write(f"browser_version={browser_version}\n")
fh.write(f"mcp_version={mcp_version}\n")
fh.write(f"sandbox_version={sandbox_version}\n")
fh.write(f"wrapper_version={wrapper_version}\n")
fh.write(f"current_agents={current_agents}\n")
fh.write(f"current_code={current_code}\n")
@@ -354,6 +386,7 @@ jobs:
fh.write(f"current_train={current_train}\n")
fh.write(f"current_browser={current_browser}\n")
fh.write(f"current_mcp={current_mcp}\n")
fh.write(f"current_sandbox={current_sandbox}\n")
fh.write(f"current_wrapper={current_wrapper}\n")
print(f"Agents: {current_agents} -> {agents_version}")
@@ -362,6 +395,7 @@ jobs:
print(f"Train: {current_train} -> {train_version}")
print(f"Browser: {current_browser} -> {browser_version}")
print(f"MCP: {current_mcp} -> {mcp_version}")
print(f"Sandbox: {current_sandbox} -> {sandbox_version}")
print(f"Wrapper: {current_wrapper} -> {wrapper_version}")
PY
@@ -375,6 +409,7 @@ jobs:
TRAIN_VERSION: ${{ steps.versions.outputs.train_version }}
BROWSER_VERSION: ${{ steps.versions.outputs.browser_version }}
MCP_VERSION: ${{ steps.versions.outputs.mcp_version }}
SANDBOX_VERSION: ${{ steps.versions.outputs.sandbox_version }}
WRAPPER_VERSION: ${{ steps.versions.outputs.wrapper_version }}
INPUT_SKIP_AGENTS: ${{ inputs.skip_agents }}
INPUT_SKIP_CODE: ${{ inputs.skip_code }}
@@ -382,6 +417,7 @@ jobs:
INPUT_SKIP_TRAIN: ${{ inputs.skip_train }}
INPUT_SKIP_BROWSER: ${{ inputs.skip_browser }}
INPUT_SKIP_MCP: ${{ inputs.skip_mcp }}
INPUT_SKIP_SANDBOX: ${{ inputs.skip_sandbox }}
INPUT_SKIP_WRAPPER: ${{ inputs.skip_wrapper }}
run: |
set -euo pipefail
@@ -391,6 +427,7 @@ jobs:
skip_train="${INPUT_SKIP_TRAIN}"
skip_browser="${INPUT_SKIP_BROWSER}"
skip_mcp="${INPUT_SKIP_MCP}"
skip_sandbox="${INPUT_SKIP_SANDBOX}"
skip_wrapper="${INPUT_SKIP_WRAPPER}"
if [ "$skip_agents" != "true" ]; then
curl -fsSL "https://pypi.org/pypi/praisonaiagents/${AGENTS_VERSION}/json" >/dev/null && skip_agents=true || true
@@ -410,6 +447,9 @@ jobs:
if [ "$skip_mcp" != "true" ]; then
curl -fsSL "https://pypi.org/pypi/praisonai-mcp/${MCP_VERSION}/json" >/dev/null && skip_mcp=true || true
fi
if [ "$skip_sandbox" != "true" ]; then
curl -fsSL "https://pypi.org/pypi/praisonai-sandbox/${SANDBOX_VERSION}/json" >/dev/null && skip_sandbox=true || true
fi
if [ "$skip_wrapper" != "true" ]; then
curl -fsSL "https://pypi.org/pypi/praisonai/${WRAPPER_VERSION}/json" >/dev/null && skip_wrapper=true || true
fi
@@ -419,8 +459,9 @@ jobs:
echo "skip_train=${skip_train}" >> "$GITHUB_OUTPUT"
echo "skip_browser=${skip_browser}" >> "$GITHUB_OUTPUT"
echo "skip_mcp=${skip_mcp}" >> "$GITHUB_OUTPUT"
echo "skip_sandbox=${skip_sandbox}" >> "$GITHUB_OUTPUT"
echo "skip_wrapper=${skip_wrapper}" >> "$GITHUB_OUTPUT"
if [ "$skip_agents" = "true" ] && [ "$skip_code" = "true" ] && [ "$skip_bot" = "true" ] && [ "$skip_train" = "true" ] && [ "$skip_browser" = "true" ] && [ "$skip_mcp" = "true" ] && [ "$skip_wrapper" = "true" ]; then
if [ "$skip_agents" = "true" ] && [ "$skip_code" = "true" ] && [ "$skip_bot" = "true" ] && [ "$skip_train" = "true" ] && [ "$skip_browser" = "true" ] && [ "$skip_mcp" = "true" ] && [ "$skip_sandbox" = "true" ] && [ "$skip_wrapper" = "true" ]; then
echo "All target versions already on PyPI — nothing to publish."
fi
@@ -433,6 +474,7 @@ jobs:
steps.pypi_exists.outputs.skip_train == 'true' &&
steps.pypi_exists.outputs.skip_browser == 'true' &&
steps.pypi_exists.outputs.skip_mcp == 'true' &&
steps.pypi_exists.outputs.skip_sandbox == 'true' &&
steps.pypi_exists.outputs.skip_wrapper == 'true'
run: echo "Idempotent skip — target versions already on PyPI."
@@ -887,6 +929,76 @@ jobs:
git pull --rebase origin main
git push origin main
- name: Publish praisonai-sandbox
if: >-
inputs.dry_run != true &&
inputs.skip_sandbox != true &&
steps.pypi_exists.outputs.skip_sandbox != 'true'
working-directory: src/praisonai-sandbox
env:
NEW_VERSION: ${{ steps.versions.outputs.sandbox_version }}
CURRENT: ${{ steps.versions.outputs.current_sandbox }}
run: |
set -euo pipefail
python <<'PY'
import os
import re
from pathlib import Path
new = os.environ["NEW_VERSION"]
current = os.environ["CURRENT"]
pyproject = Path("pyproject.toml")
content = pyproject.read_text()
pyproject.write_text(content.replace(f'version = "{current}"', f'version = "{new}"', 1))
version_py = Path("praisonai_sandbox/_version.py")
version_content = version_py.read_text()
version_py.write_text(re.sub(r'__version__ = "[^"]+"', f'__version__ = "{new}"', version_content, count=1))
PY
rm -rf dist
uv lock
uv build
uv publish
- name: Wait for praisonai-sandbox on PyPI
if: >-
inputs.dry_run != true &&
inputs.skip_sandbox != true &&
steps.pypi_exists.outputs.skip_sandbox != 'true'
run: |
set -euo pipefail
PACKAGE="praisonai-sandbox"
VERSION="${{ steps.versions.outputs.sandbox_version }}"
MAX_WAIT=600
INTERVAL=30
START=$(date +%s)
while true; do
if curl -fsSL "https://pypi.org/pypi/${PACKAGE}/${VERSION}/json" >/dev/null; then
echo "✅ ${PACKAGE}==${VERSION} is available on PyPI"
exit 0
fi
ELAPSED=$(( $(date +%s) - START ))
if [ "$ELAPSED" -ge "$MAX_WAIT" ]; then
echo "❌ Timeout waiting for ${PACKAGE}==${VERSION} on PyPI"
exit 1
fi
echo "⏳ Waiting for ${PACKAGE}==${VERSION} ($(( MAX_WAIT - ELAPSED ))s remaining...)"
sleep "$INTERVAL"
done
- name: Commit praisonai-sandbox version bump
if: >-
inputs.dry_run != true &&
inputs.skip_sandbox != true &&
steps.pypi_exists.outputs.skip_sandbox != 'true'
run: |
set -euo pipefail
git add src/praisonai-sandbox/pyproject.toml src/praisonai-sandbox/uv.lock src/praisonai-sandbox/praisonai_sandbox/_version.py
git diff --cached --quiet && { echo "No sandbox files to commit"; exit 0; }
git commit -m "Bump praisonai-sandbox to ${{ steps.versions.outputs.sandbox_version }}"
git pull --rebase origin main
git push origin main
- name: Bump and release wrapper
if: >-
inputs.dry_run != true &&
@@ -901,6 +1013,7 @@ jobs:
--train-pin "${{ steps.versions.outputs.train_version }}" \
--browser-pin "${{ steps.versions.outputs.browser_version }}" \
--mcp-pin "${{ steps.versions.outputs.mcp_version }}" \
--sandbox-pin "${{ steps.versions.outputs.sandbox_version }}" \
--wait --max-wait 600 --no-add-all
- name: Publish praisonai wrapper to PyPI
@@ -948,6 +1061,7 @@ jobs:
TRAIN="${{ steps.versions.outputs.train_version }}"
BROWSER="${{ steps.versions.outputs.browser_version }}"
MCP="${{ steps.versions.outputs.mcp_version }}"
SANDBOX="${{ steps.versions.outputs.sandbox_version }}"
WRAPPER="${{ steps.versions.outputs.wrapper_version }}"
if [ "${{ inputs.skip_agents }}" != "true" ]; then
@@ -974,6 +1088,10 @@ jobs:
echo "✅ praisonai-mcp==${MCP}"
fi
if [ "${{ inputs.skip_sandbox }}" != "true" ]; then
echo "✅ praisonai-sandbox==${SANDBOX}"
fi
if [ "${{ inputs.skip_wrapper }}" != "true" ]; then
echo "✅ praisonai==${WRAPPER}"
fi
@@ -0,0 +1,47 @@
name: Terminal-Bench Smoke
# Manual (and optional weekly) smoke run of the `praisonai code` assistant on a
# small verified Terminal-Bench 2.1 subset via the Harbor harness.
# Never runs on PRs — it costs money (LLM calls) and is inherently flaky.
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * 1" # Mondays 06:00 UTC
permissions:
contents: read
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Harbor + PraisonAI
run: |
python -m pip install --upgrade pip
pip install harbor
pip install -e src/praisonai-agents -e src/praisonai
- name: Run Terminal-Bench 2.1 smoke subset
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PYTHONPATH: .
run: |
harbor run -c examples/terminal_bench/job_code_smoke.yaml || true
- name: Upload Harbor results
if: always()
uses: actions/upload-artifact@v4
with:
name: harbor-results
path: |
runs/
**/results.json
if-no-files-found: warn
+13
View File
@@ -107,6 +107,13 @@ jobs:
extra_ignore: ""
pythonpath: >-
${{ github.workspace }}/src/praisonai-agents
- shard: sandbox
workdir: src/praisonai-sandbox
paths: >-
tests/
extra_ignore: ""
pythonpath: >-
${{ github.workspace }}/src/praisonai-agents
- shard: subdirs
paths: >-
tests/unit/scheduler/
@@ -173,6 +180,12 @@ jobs:
run: |
set -euo pipefail
WORKDIR="${{ matrix.workdir || 'src/praisonai' }}"
if [ "$WORKDIR" = "src/praisonai-sandbox" ]; then
bash "$GITHUB_WORKSPACE/scripts/check_c13_sandbox_imports.sh"
fi
if [ "$WORKDIR" = "src/praisonai-mcp" ]; then
bash "$GITHUB_WORKSPACE/scripts/check_c12_mcp_imports.sh"
fi
cd "$WORKDIR"
if [ -n "${{ matrix.pythonpath || '' }}" ]; then
export PYTHONPATH="${{ matrix.pythonpath }}:${PYTHONPATH:-}"
+20 -3
View File
@@ -42,7 +42,7 @@ jobs:
# ============================================
smoke:
runs-on: ubuntu-latest
timeout-minutes: 8
timeout-minutes: 12
steps:
- uses: actions/checkout@v4
with:
@@ -85,6 +85,7 @@ jobs:
tests/unit/test_c9_1_boundaries.py \
tests/unit/test_c11_browser_backward_compat.py \
tests/unit/test_c12_mcp_backward_compat.py \
tests/unit/test_c13_sandbox_backward_compat.py \
-q --tb=line --timeout=30 --maxfail=5
python -m pytest tests/unit/cli/ \
../praisonai-bot/tests/unit/cli/test_onboard_command.py \
@@ -251,10 +252,27 @@ jobs:
bash "$GITHUB_WORKSPACE/scripts/check_c12_mcp_imports.sh"
python -m pytest src/praisonai-mcp/tests/mcp_server -q -m "not network"
- name: Standalone praisonai-sandbox smoke (C13)
run: |
set -euo pipefail
python -m venv /tmp/praisonai-sandbox-standalone
/tmp/praisonai-sandbox-standalone/bin/pip install -q -e src/praisonai-agents -e src/praisonai-sandbox
/tmp/praisonai-sandbox-standalone/bin/python -c "
from praisonai_sandbox._version import __version__ as pkg_version
import praisonai_sandbox
assert praisonai_sandbox.__version__ == pkg_version
for heavy in ('docker', 'modal', 'e2b'):
assert heavy not in __import__('sys').modules
print('sandbox standalone ok', praisonai_sandbox.__version__)
"
/tmp/praisonai-sandbox-standalone/bin/praisonai-sandbox --help
bash "$GITHUB_WORKSPACE/scripts/check_c13_sandbox_imports.sh"
python -m pytest src/praisonai-sandbox/tests -q -m "not network"
- name: Audit hybrid module imports (C8 full stack)
run: |
set -euo pipefail
pip install -q -e src/praisonai-agents -e src/praisonai-code -e src/praisonai-bot -e src/praisonai-train -e src/praisonai-browser -e src/praisonai-mcp -e src/praisonai
pip install -q -e src/praisonai-agents -e src/praisonai-code -e src/praisonai-bot -e src/praisonai-train -e src/praisonai-browser -e src/praisonai-mcp -e src/praisonai-sandbox -e src/praisonai
python scripts/audit_hybrid_modules.py
- name: Smoke Test Summary
@@ -320,7 +338,6 @@ jobs:
--ignore=tests/e2e \
--ignore=tests/live \
--ignore=tests/unit/jobs \
--ignore=tests/unit/sandbox \
--ignore=tests/unit/test_langflow_components.py \
--cov=praisonai \
--cov-report=xml \
+1 -1
View File
@@ -20,7 +20,7 @@ on:
jobs:
test-windows:
runs-on: windows-latest
timeout-minutes: 5
timeout-minutes: 10
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL_NAME: gpt-4o-mini
+9
View File
@@ -29,6 +29,15 @@ output
threads.db
threads.db-journal
# Example run artifacts (generated at runtime, must not be committed)
examples/**/knowledge.db
examples/**/knowledge.db-journal
examples/python/managed-agents/managed_ids.json
examples/python/save_output/blog_post.md
examples/python/save_output/generated/
examples/python/token-metrics/token_metrics_export.json
examples/python/usecases/market_research_results.json
.chainlit
!praisonai/ui/config/.chainlit
+2 -2
View File
@@ -7,9 +7,9 @@ You are working on the PraisonAI project.
- Be concise and helpful in responses
- Test implementation thoroughly
- Ensure backward compatibility with existing APIs
- Follow protocol-driven design across the seven packages: core protocols in `praisonaiagents/`, agentic terminal CLI in `praisonai-code/`, bots/gateway in `praisonai-bot/`, LLM fine-tuning + agent training in `praisonai-train/`, browser automation in `praisonai-browser/`, MCP server host in `praisonai-mcp/`, integrations/serve/dashboard in the `praisonai/` wrapper
- Follow protocol-driven design across the eight packages: core protocols in `praisonaiagents/`, agentic terminal CLI in `praisonai-code/`, bots/gateway in `praisonai-bot/`, LLM fine-tuning + agent training in `praisonai-train/`, browser automation in `praisonai-browser/`, MCP server host in `praisonai-mcp/`, sandbox backends in `praisonai-sandbox/`, integrations/serve/dashboard in the `praisonai/` wrapper
- Preserve old `praisonai.*` import paths via shims when moving code between packages (see §2.3 in `src/praisonai-agents/AGENTS.md`; shim helpers in `src/praisonai/praisonai/cli/_shim.py`)
- Package boundaries and dependency rules: `ARCHITECTURE.md` §2 (Tier 2 packages must never PyPI-depend on the wrapper; cross-tier access goes through lazy `_*_bridge` modules)
- Boundary manifests: `src/praisonai/tests/PRAISONAI_BOT_MANIFEST.md` (C9), `src/praisonai/tests/PRAISONAI_TRAIN_MANIFEST.md` (C10), `src/praisonai/tests/PRAISONAI_BROWSER_MANIFEST.md` (C11), `src/praisonai/tests/PRAISONAI_MCP_MANIFEST.md` (C12)
- Boundary manifests: `src/praisonai/tests/PRAISONAI_BOT_MANIFEST.md` (C9), `src/praisonai/tests/PRAISONAI_TRAIN_MANIFEST.md` (C10), `src/praisonai/tests/PRAISONAI_BROWSER_MANIFEST.md` (C11), `src/praisonai/tests/PRAISONAI_MCP_MANIFEST.md` (C12), `src/praisonai/tests/PRAISONAI_SANDBOX_MANIFEST.md` (C13)
- When reviewing a PR or an issue, evaluate whether the change addresses a framework concern or a user goal, and design its surface (params, naming, defaults) accordingly
- The aim of this package is to stay **lightweight and powerful**. Do a critical review at each stage — when triaging an issue, when planning a fix, and when reviewing/implementing a PR. Reject scope creep for the sake of adding features: if a capability already exists (e.g. via existing Agent params like `instructions`/`backstory`/`tools`/`hooks`/`memory`), prefer it over a new API surface. A change must genuinely strengthen the SDK (simpler, more robust, more user-friendly) — do not add knobs, params, modules, or exports that have no live consumer or that merely duplicate existing behaviour.
+15 -10
View File
@@ -1,6 +1,6 @@
# PraisonAI Architecture
> **Last updated:** 2026-07-15 (C12 — seven-package tiered model)
> **Last updated:** 2026-07-17 (C13 — eight-package tiered model)
>
> Strategic architecture document for PraisonAI — a multi-agent AI framework.
> Covers **Python tiered package model (C7.1 + C9 + C10)**, system design, runtime
@@ -11,7 +11,7 @@
## Table of Contents
1. [Executive Summary](#1-executive-summary)
2. [Python Tiered Package Model (C7.1 + C9 + C10 + C11 + C12)](#2-python-tiered-package-model-c71--c9--c10--c11--c12)
2. [Python Tiered Package Model (C7.1 + C9 + C10 + C11 + C12 + C13)](#2-python-tiered-package-model-c71--c9--c10--c11--c12--c13)
3. [System Overview](#3-system-overview)
4. [Layered Architecture](#4-layered-architecture)
5. [Core Data Contracts](#5-core-data-contracts)
@@ -51,16 +51,17 @@ Orchestration + Observability** core to unlock adoption and trust:
---
## 2. Python Tiered Package Model (C7.1 + C9 + C10 + C11 + C12)
## 2. Python Tiered Package Model (C7.1 + C9 + C10 + C11 + C12 + C13)
**Release:** v4.6.110+ · `praisonaiagents` · `praisonai-code` · `praisonai-bot` · `praisonai-train` · `praisonai-browser` · `praisonai-mcp` · `praisonai`
**Release:** v4.6.110+ · `praisonaiagents` · `praisonai-code` · `praisonai-bot` · `praisonai-train` · `praisonai-browser` · `praisonai-mcp` · `praisonai-sandbox` · `praisonai`
The Python monorepo publishes seven packages in three tiers with strict dependency
The Python monorepo publishes eight packages in three tiers with strict dependency
direction. C7 delivered a standalone agentic hot path; C7.1 formalised
code/wrapper ownership; C9 extracted bots, gateway, and channel CLI into
`praisonai-bot`; C10 extracted LLM fine-tuning and agent training into
`praisonai-train`; C11 extracted browser automation into `praisonai-browser`;
C12 extracted the heavy MCP host into `praisonai-mcp`.
C13 extracted sandbox backends into `praisonai-sandbox`.
```mermaid
flowchart TB
@@ -68,12 +69,13 @@ flowchart TB
Agents["praisonaiagents<br/>Agent, tools, memory, hooks, protocols"]
end
subgraph tier2 [Tier 2 — Terminal + Bot + Train + Browser + MCP]
subgraph tier2 [Tier 2 — Terminal + Bot + Train + Browser + MCP + Sandbox]
Code["praisonai-code<br/>run, chat, code, Typer, runtime, LLM"]
Bot["praisonai-bot<br/>bots, gateway, channel CLI, OS daemon"]
Train["praisonai-train<br/>LLM fine-tuning, agent training"]
Browser["praisonai-browser<br/>extension bridge, CDP, Playwright"]
MCP["praisonai-mcp<br/>MCP server host, auth, capability adapters"]
Sandbox["praisonai-sandbox<br/>Docker, E2B, Modal, Sandlock backends"]
end
subgraph tier3 [Tier 3 — Wrapper]
@@ -85,32 +87,35 @@ flowchart TB
Agents --> Train
Agents --> Browser
Agents --> MCP
Agents --> Sandbox
Agents --> Wrapper
Code -.->|"lazy _bot_bridge"| Bot
Code -.->|"lazy _train_bridge"| Train
Code -.->|"lazy _browser_bridge"| Browser
Code -.->|"lazy _mcp_bridge"| MCP
Code -.->|"lazy _sandbox_bridge"| Sandbox
Code -.->|"lazy _wrapper_bridge"| Wrapper
Bot -.->|"lazy _code_bridge / _wrapper_bridge"| Code
Bot -.->|"lazy _wrapper_bridge"| Wrapper
Train -.->|"lazy _code_bridge / _wrapper_bridge"| Code
```
**PyPI publish order:** `praisonaiagents` → `praisonai-code` + `praisonai-bot` + `praisonai-train` + `praisonai-browser` + `praisonai-mcp` → `praisonai`
**PyPI publish order:** `praisonaiagents` → `praisonai-code` + `praisonai-bot` + `praisonai-train` + `praisonai-browser` + `praisonai-mcp` + `praisonai-sandbox` → `praisonai`
**Backward compatibility:** `praisonai.bots`, `praisonai.gateway`, `praisonai.train`,
`praisonai.browser`, `praisonai.mcp_server`, and related CLI paths remain as
`praisonai.browser`, `praisonai.mcp_server`, `praisonai.sandbox`, and related CLI paths remain as
`alias_package` shims to `praisonai_bot.*` / `praisonai_train.*` /
`praisonai_browser.*` / `praisonai_mcp.*`.
`praisonai_browser.*` / `praisonai_mcp.*` / `praisonai_sandbox.*`.
| Tier | Package | Owns | Must not depend on |
|------|---------|------|-------------------|
| 1 | `src/praisonai-agents/` | Agent, tools, memory, hooks, `frameworks/` protocols | `praisonai`, `praisonai-code`, `praisonai-bot`, `praisonai-train`, `praisonai-browser`, `praisonai-mcp` |
| 1 | `src/praisonai-agents/` | Agent, tools, memory, hooks, `frameworks/` protocols, sandbox protocols | `praisonai`, `praisonai-code`, `praisonai-bot`, `praisonai-train`, `praisonai-browser`, `praisonai-mcp`, `praisonai-sandbox` |
| 2a | `src/praisonai-code/` | `run`/`chat`/`code`, Typer, runtime, LLM, tool resolution | **`praisonai` as a PyPI dependency** (optional lazy imports via `_wrapper_bridge` only) |
| 2b | `src/praisonai-bot/` | Bots, gateway, channel CLI, OS daemon, gateway scheduler tick | **`praisonai` as a PyPI dependency** (optional lazy `_wrapper_bridge` for jobs/UI) |
| 2c | `src/praisonai-train/` | LLM fine-tuning (Unsloth), agent training, `train` CLI, conda env setup | **`praisonai` as a PyPI dependency** (lazy `_code_bridge` for legacy dispatch) |
| 2d | `src/praisonai-browser/` | Extension bridge, CDP/hybrid automation, `browser` CLI | **`praisonai` as a PyPI dependency** (none required; depends on `praisonaiagents` only) |
| 2e | `src/praisonai-mcp/` | MCP server host, auth, transports, `mcp` CLI | **`praisonai` as a PyPI dependency** (lazy `_wrapper_bridge` for full capability registry) |
| 2f | `src/praisonai-sandbox/` | Sandbox backends (Docker, E2B, Modal, Sandlock, SSH), `SandboxRegistry` | **`praisonai` as a PyPI dependency** (lazy `_code_bridge` for `PluginRegistry`) |
| 3 | `src/praisonai/` | `framework_adapters/`, serve, dashboard, async jobs API | — |
**Config kernel:** Phase 0 `praisonai/common/` was skipped; shared config lives in
-7
View File
@@ -232,13 +232,6 @@ Methods:
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">repeat</a>(step: Any, until: Optional[Callable[[WorkflowContext], bool]] = None, max_iterations: int = 10) -> Repeat</code>
* <code title="function">praisonaiagents.<a href="./src/praisonai-agents/praisonaiagents/workflows/workflows.py">route</a>(routes: Dict[str, List], default: Optional[List] = None) -> Route</code>
# DB
Types:
```python
from praisonaiagents import db
```
# Memory
Types:
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.6.150" \
"praisonai>=4.6.155" \
"praisonai[chat]" \
"embedchain[github,youtube]"
+1 -1
View File
@@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.6.150" \
"praisonai>=4.6.155" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=4.6.150" \
"praisonai>=4.6.155" \
"praisonai[ui]" \
"praisonai[crewai]"
View File
Whitespace-only changes.
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
HTTP Approval Example
=====================
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Slack Approval Example
======================
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Completions Capability Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Embeddings Capability Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Images Capability Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Moderations Capability Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Energy Industry Template
========================
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Transportation Industry Template
================================
+4 -1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
CI Integration Example - Using Doctor in CI/CD pipelines
@@ -19,7 +20,9 @@ def run_doctor_ci():
[sys.executable, "-m", "praisonai", "doctor", "ci"],
capture_output=True,
text=True,
timeout=120
encoding="utf-8",
errors="replace",
timeout=120,
)
# Parse JSON output
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Agent-centric Embedding Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
PraisonAI Endpoints Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
Fixed example demonstrating proper guardrail usage with PraisonAI Agents.
+13 -6
View File
@@ -149,21 +149,28 @@ def main():
print(f"\nOriginal document length: {len(content)} characters")
chunks = [{"text": content, "metadata": {"source": doc_path}}]
target_tokens = 2000
# Compress with different ratios
for ratio in [0.3, 0.5, 0.7]:
compressor = ContextCompressor(
max_tokens=2000,
target_ratio=ratio,
compressor = ContextCompressor(verbose=False)
result = compressor.compress(
chunks,
query="security verification code",
target_tokens=target_tokens,
compression_ratio=ratio,
)
result = compressor.compress([content], query="security verification code")
print(f"\nCompression ratio {ratio}:")
print(f" Original tokens: {result.original_tokens}")
print(f" Compressed tokens: {result.compressed_tokens}")
print(f" Actual ratio: {result.compressed_tokens / max(result.original_tokens, 1):.2f}")
print(f" Actual ratio: {result.compression_ratio:.2f}")
# Check if secret code is preserved
compressed_text = " ".join(result.chunks) if result.chunks else ""
compressed_text = " ".join(
c.get("text", "") for c in result.chunks
) if result.chunks else ""
if SECRET_CODE in compressed_text:
print(f" ✅ Secret code preserved in compressed output")
else:
@@ -65,7 +65,6 @@ def main():
name="Policy_Expert",
instructions="You are a policy expert.",
knowledge=[temp_dir],
agent_id="policy_agent_v1", # Knowledge scoped to this agent
)
response = shared_agent.chat("What are the expense report rules?")
@@ -81,7 +80,6 @@ def main():
instructions="You are a personal HR assistant.",
knowledge=[temp_dir],
memory={"user_id": "user_bob"},
agent_id="hr_bot_v2",
)
response = combined_agent.chat("What training is required?")
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + ClickHouse Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + MongoDB Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + MySQL Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + PostgreSQL Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + Redis Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
ManagedAgent + SQLite Persistence — Real conversation with session resume.
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
Custom Tools MCP Server Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
HTTP Stream MCP Server Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
MCP Client Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""Multi-Agent Shared Session Demo"""
from praisonaiagents import Agent
from praisonai.persistence import create_conversation_store
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Langfuse Integration Example (Updated for TraceSinkProtocol)
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""MLflow Local Observability Demo (no API key needed)"""
import mlflow
import time
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
ClickHouse — Persistence Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Minimal Agent with Database Persistence
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
MongoDB StateStore — Full Persistence Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
MySQL ConversationStore — Full Persistence Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
PostgreSQL ConversationStore — Full Persistence Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
PostgreSQL with Runs and Traces
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Redis StateStore — Full Persistence Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Session Resume Example
+4 -2
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Redis State Store - Agent-First Example
@@ -13,7 +14,8 @@ Expected Output:
Agent responds with state persisted to Redis
"""
from praisonaiagents import Agent, db
from praisonaiagents import Agent
from praisonaiagents.db import db
print("=== Redis State Store (Agent-First) ===")
@@ -26,7 +28,7 @@ my_db = db(
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant.",
db=my_db,
memory=my_db,
session_id="redis-state-example"
)
@@ -61,7 +61,7 @@ def demonstrate_collision_problem():
_reset_default_registry()
# Agent 1 registers "custom" provider
register_llm_provider("custom", Agent1Provider)
register_llm_provider("custom", Agent1Provider, override=True)
print("Agent 1 registered 'custom' provider")
# Agent 2 tries to register same name - ERROR!
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
PraisonAI A2A Server Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Agent-Centric Autonomy Example.
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
AutoAgents Workflow Patterns Example
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
#!/usr/bin/env python3
"""
Context Agent Example - Basic Usage
+3 -1
View File
@@ -1,3 +1,5 @@
# praisonai: skip=true
# Uses removed praisonaiagents.tools exports; pending example refresh
from praisonaiagents import Agent, Tools
from praisonaiagents.tools import read_csv, read_excel, write_csv, write_excel, filter_data, get_summary, group_by, pivot_table
import os
@@ -7,4 +9,4 @@ agent.start(f"""
Read the data from the csv file {os.path.join(os.path.dirname(__file__), "tesla-stock-price.csv")}
Analyse the data and give me the insights
read_csv to read the file
""")
""")
+3 -1
View File
@@ -1,5 +1,7 @@
# praisonai: skip=true
# Uses removed praisonaiagents.tools exports; pending example refresh
from praisonaiagents import Agent, Tools
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data
agent = Agent(instructions="You are a Research Agent", tools=[get_stock_price, get_stock_info, get_historical_data])
agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them")
agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them")
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Math Agent Example
@@ -135,7 +135,7 @@ def example_auto_agents_multi_provider():
from praisonaiagents.agents import AutoAgents
# Create AutoAgents that will automatically assign appropriate models
auto_agents = AutoAgentTeam(
auto_agents = AutoAgents(
instructions="Create a market research report on electric vehicles. Include data analysis, competitor analysis, and future projections.",
max_agents=3,
llm="gpt-4o-mini", # Default model for agent generation
+3 -1
View File
@@ -1,3 +1,5 @@
# praisonai: skip=true
# Uses removed praisonaiagents.tools exports; pending example refresh
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents.tools import wiki_search, wiki_summary, wiki_page, wiki_random, wiki_language
@@ -13,4 +15,4 @@ agent.start(
"First search the history of AI"
"Read the page of the history of AI"
"Get the summary of the page"
)
)
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, MCP
qa_agent = Agent(
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, AgentTeam, Tools
research_agent = Agent(name="Research", instructions="You are a research agent to search internet about AI 2024", tools=[Tools.internet_search])
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, AgentTeam, Tools
research_agent = Agent(name="Research", instructions="You are a research agent to search internet about AI 2024", tools=[Tools.internet_search])
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Secondary Market Research FastAPI Application
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, MCP
search_agent = Agent(
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, AgentTeam
from duckduckgo_search import DDGS
+30 -1
View File
@@ -1,5 +1,34 @@
import socket
import sys
import threading
import time
from praisonaiagents import Agent
def _wait_until_ready(host: str, port: int, timeout: float = 15.0) -> bool:
"""Poll the MCP server port until it accepts connections or times out."""
deadline = time.time() + timeout
while time.time() < deadline:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.settimeout(1.0)
if sock.connect_ex((host, port)) == 0:
return True
time.sleep(0.25)
return False
if __name__ == "__main__":
host, port = "127.0.0.1", 8080
agent = Agent(name="TweetAgent", instructions="Create a Tweet based on the topic provided")
agent.launch(port=8080, protocol="mcp", path="/")
server = threading.Thread(
target=lambda: agent.launch(port=port, protocol="mcp", path="/mcp"),
daemon=True,
)
server.start()
if _wait_until_ready(host, port):
print(f"MCP server started on http://{host}:{port}/mcp")
else:
print(f"MCP server failed to start on http://{host}:{port}/mcp", file=sys.stderr)
sys.exit(1)
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import AudioAgent
# Text to Speech
+3
View File
@@ -1,3 +1,5 @@
# praisonai: skip=true
# Requires local audio.mp3 fixture
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3") # 10x faster
@@ -5,3 +7,4 @@ text = agent.transcribe("audio.mp3", language="en")
print(text)
# Models: openai/whisper-1, groq/whisper-large-v3, deepgram/nova-2
+3
View File
@@ -1,3 +1,5 @@
# praisonai: skip=true
# Requires local audio.mp3 fixture
# Speech-to-Text with Groq (fastest)
# Requires: export GROQ_API_KEY=your-key
@@ -6,3 +8,4 @@ from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3")
text = agent.listen("audio.mp3") # Replace with your audio file
print(text)
+3
View File
@@ -1,5 +1,8 @@
# praisonai: skip=true
# Requires local audio.mp3 fixture
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="deepgram/nova-2")
text = agent.listen("audio.mp3")
print(text)
+3
View File
@@ -1,5 +1,8 @@
# praisonai: skip=true
# Requires local audio.mp3 fixture
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="groq/whisper-large-v3")
text = agent.listen("audio.mp3")
print(text)
+3
View File
@@ -1,5 +1,8 @@
# praisonai: skip=true
# Requires local audio.mp3 fixture
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/whisper-1")
text = agent.listen("audio.mp3")
print(text)
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/tts-1-hd")
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
# Text-to-Speech with OpenAI
# Requires: export OPENAI_API_KEY=your-key
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="elevenlabs/eleven_multilingual_v2")
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="gemini/gemini-2.5-flash-preview-tts")
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import AudioAgent
agent = AudioAgent(llm="openai/tts-1")
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Bot Commands Example — Built-in /status, /new, /help commands.
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Bot Gateway Example — Run multiple bots from one gateway server.
+2 -2
View File
@@ -102,7 +102,7 @@ async def demo_with_run_control():
from praisonai.bots._run_control import SessionRunControl
from praisonai.bots._session import BotSessionManager
from praisonai.bots._commands import handle_stop_command
from praisonai.bots._commands import handle_stop_command_async
# Session manager with run control
run_control = SessionRunControl(
@@ -136,7 +136,7 @@ async def demo_with_run_control():
print("\n3. User decides to stop current task:")
print(" User: '/stop'")
stop_response = await handle_stop_command(user_id, run_control)
stop_response = await handle_stop_command_async(user_id, run_control)
print(f" Bot: {stop_response}")
# Wait for first task to complete (it should be cancelled)
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Standalone gateway example (praisonai-bot first).
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""HTTP Approval — serve a local web dashboard for tool approvals."""
from praisonaiagents import Agent
+1
View File
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Basic Camera Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Continuous Camera Monitoring Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Multi-Agent Camera Analysis Example
@@ -46,6 +46,6 @@ custom_cmd = SlashCommand(
alt_names=["mc"]
)
handler.register(custom_cmd)
handler.register_command(custom_cmd)
result = handler.execute("/mycommand arg1 arg2")
print(f"\n=== Custom Command ===\n{result.get('message', '')}")
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Claude Code CLI Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Codex CLI Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Cursor CLI Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
External Agents Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Gemini CLI Integration Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
CSV Processing with PraisonAI Agents
@@ -10,6 +10,18 @@ import os
from praisonaiagents import Agent
from praisonaiagents.knowledge import Knowledge
def _result_items(results):
items = results.results if hasattr(results, "results") else results
return list(items)[:3]
def _result_text(result):
if isinstance(result, dict):
return result.get("memory", result.get("text", str(result)))
return getattr(result, "text", None) or getattr(result, "memory", None) or str(result)
def main():
"""
Demonstrates knowledge search with and without reranking.
@@ -82,9 +94,9 @@ def main():
basic_results = basic_knowledge.search(query, rerank=False)
print(f"Query: {query}")
print(f"Results (limit=3):")
for i, result in enumerate(basic_results[:3]):
text = result.get('memory', result.get('text', str(result)))
score = result.get('score', 'N/A')
for i, result in enumerate(_result_items(basic_results)):
text = _result_text(result)
score = result.get('score', 'N/A') if isinstance(result, dict) else getattr(result, 'score', 'N/A')
print(f" {i+1}. Score: {score}")
print(f" Text: {text[:100]}...")
print()
@@ -94,9 +106,9 @@ def main():
rerank_results = basic_knowledge.search(query, rerank=True)
print(f"Query: {query}")
print(f"Results (limit=3):")
for i, result in enumerate(rerank_results[:3]):
text = result.get('memory', result.get('text', str(result)))
score = result.get('score', 'N/A')
for i, result in enumerate(_result_items(rerank_results)):
text = _result_text(result)
score = result.get('score', 'N/A') if isinstance(result, dict) else getattr(result, 'score', 'N/A')
print(f" {i+1}. Score: {score}")
print(f" Text: {text[:100]}...")
print()
@@ -106,9 +118,9 @@ def main():
default_results = rerank_knowledge.search(query) # Will use default_rerank=True
print(f"Query: {query}")
print(f"Results (limit=3):")
for i, result in enumerate(default_results[:3]):
text = result.get('memory', result.get('text', str(result)))
score = result.get('score', 'N/A')
for i, result in enumerate(_result_items(default_results)):
text = _result_text(result)
score = result.get('score', 'N/A') if isinstance(result, dict) else getattr(result, 'score', 'N/A')
print(f" {i+1}. Score: {score}")
print(f" Text: {text[:100]}...")
print()
@@ -125,9 +137,9 @@ def main():
)
print(f"Query: {query}")
print(f"Advanced results with keyword_search=True, filter_memories=True:")
for i, result in enumerate(advanced_results[:3]):
text = result.get('memory', result.get('text', str(result)))
score = result.get('score', 'N/A')
for i, result in enumerate(_result_items(advanced_results)):
text = _result_text(result)
score = result.get('score', 'N/A') if isinstance(result, dict) else getattr(result, 'score', 'N/A')
print(f" {i+1}. Score: {score}")
print(f" Text: {text[:100]}...")
print()
@@ -138,7 +150,7 @@ def main():
agent = Agent(
name="AI Research Assistant",
instructions="You are an AI research assistant. Use your knowledge base to answer questions about artificial intelligence topics.",
knowledge={**rerank_config, "sources": sample_documents},
knowledge={"sources": sample_documents, "rerank": True},
llm="gpt-4o-mini"
)
@@ -1,3 +1,4 @@
# praisonai: skip=true
"""
Reasoning Extraction Example
@@ -1,3 +1,4 @@
# praisonai: skip=true
from praisonaiagents import Agent, Task, AgentTeam
agent = Agent(
Loaded 100 of 665 files, more files were not shown because too many files have changed in this diff. Show more