Commit Graph

7 Commits

Author SHA1 Message Date
MrAvalonApple eb484d9bbf feat: add context management strategies (sliding-window, summarize, custom) to prevent unbounded conversation growth 2026-04-09 19:40:15 +03:00
Ibrahim Kazimov 97c39b316c
feat: add tool allowlist, denylist, preset list (#83)
* feat: add allowlist denylist and preset list for tools

* feat: update readme and add AGENT_FRAMEWORK_DISALLOWED

* fix: update filtering logic to allow custom tools

* fix: enhance tool registration and filtering for runtime-added tools

---------

Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-08 02:04:40 +08:00
Ibrahim Kazimov 60fb2b142e
feat: implement token budget management in agent and orchestrator (#71)
* feat: implement token budget management in agent and orchestrator

* fix: resolve TypeScript type errors in event and trace handlers

* feat: add budget exceeded event handling in agent and orchestrator

---------

Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-06 23:14:08 +08:00
JackChen a86a448fa0
feat(agent): smart loop detection for stuck agents (#49)
* feat(agent): add smart loop detection for stuck agents (#16)

Detect when agents repeat the same tool calls or text outputs in a
sliding window. Three modes: warn (inject nudge, terminate on 2nd hit),
terminate (immediate stop), or custom callback. Fully opt-in via
`loopDetection` on AgentConfig — zero overhead when unconfigured.

* fix(agent): support async onLoopDetected callbacks and prevent orphaned tool_use events

- Await onLoopDetected callback result so async functions work correctly
  instead of silently falling through to 'continue'
- Move loop detection before yielding tool_use events so terminate mode
  never emits tool_use without a matching tool_result

* fix(agent): reset loopWarned on recovery and rename maxRepeatedToolCalls to maxRepetitions

- Reset loopWarned flag when the agent stops repeating, so a future
  loop gets a fresh warning cycle instead of immediate termination
- Rename maxRepeatedToolCalls → maxRepetitions since the threshold
  applies to both tool call and text output repetition detection

* test(agent): add tests for async callback, warn recovery, and injected warning text

- Verify async onLoopDetected callback is awaited correctly
- Verify loopWarned resets after recovery, giving fresh warning cycle
- Verify WARNING TextBlock is injected into user message content
2026-04-05 13:01:53 +08:00
JackChen bc31008f4e feat(llm): add fallback tool-call extraction for local models (#15)
Local models (Ollama, vLLM) sometimes return tool calls as text instead
of using the native tool_calls wire format. This adds a safety-net
extractor that parses tool calls from model text output when native
tool_calls is empty.

- Add text-tool-extractor with support for bare JSON, code fences,
  and Hermes <tool_call> tags
- Wire fallback into OpenAI adapter chat() and stream() paths
- Add onWarning callback when model ignores configured tools
- Add timeoutMs on AgentConfig for per-run abort (local models can
  be slow)
- Add 26 tests for extractor and fallback behavior
- Document local model compatibility in README
2026-04-05 11:49:10 +08:00
JackChen 0111876264
feat: add onTrace observability callback (#18)
Add lightweight onTrace callback to OrchestratorConfig that emits
structured span events (llm_call, tool_call, task, agent) with timing,
token usage, and runId correlation. Zero overhead when not subscribed.

Closes #18
2026-04-03 15:28:59 +08:00
JackChen a6244cfe64 Initial release: open-multi-agent v0.1.0
Production-grade multi-agent orchestration framework.
Model-agnostic, supports team collaboration, task scheduling
with dependency resolution, and inter-agent communication.
2026-04-01 04:33:15 +08:00