5 Commits

Author SHA1 Message Date
ea37ab38c1 feat: add loop guard to halt repeated-identical tool call loops
Introduces `pallas.loop_guard` module that detects and halts agentic loops
where the same `(tool, args) → result` repeats consecutively, preventing
wasted LLM turns when upstream MCP servers return contradictory data.

- Add per-request `ToolRunnerHooks` tracking rolling tool-call signatures
- Halt loop after `loop_repeat_threshold` consecutive repeats (default 3)
- Collapse `max_iterations` on halt to terminate without further LLM call
- Append user-facing explanation to the turn with `stop_reason=endTurn`
- Expose `pallas_agent_loop_aborted_total{agent,reason}` counter
- Add per-agent `max_iterations` and `loop_repeat_threshold` config
- Document guard behavior, metric, and alerting query
2026-06-16 08:27:07 -04:00
0b0a8f37a4 feat: relay sub-agent activity chunks to parent MCP context 2026-05-28 15:36:14 -04:00
63ced9ba2b feat: stream intermediate assistant turns over MCP
Install a per-request `after_llm_call` hook that emits each intermediate
assistant turn as an MCP `notifications/message`, so users see
substantive text from earlier loop iterations instead of only the final
`agent.send()` return value.

Add tests covering the hook's payload shape, error handling, and
lifecycle via `install_for_request`.
2026-05-28 06:09:41 -04:00
df40d32d80 docs(pallas): expand LLM preflight docs and refactor health probes 2026-05-12 15:04:57 -04:00
75d529cf16 docs: update Mantle setup to reflect automatic shim detection 2026-05-12 11:16:22 -04:00