feat: agent runtime capabilities — cancellation, usage, parallel tools, reasoning levels + docs - #6
Open
dynamder wants to merge 4 commits into
Open
feat: agent runtime capabilities — cancellation, usage, parallel tools, reasoning levels + docs#6dynamder wants to merge 4 commits into
dynamder wants to merge 4 commits into
Conversation
…tools, reasoning levels, shell marker, cancellable loop - serde: gate Serialize/Deserialize derives on chat message types behind a new \serde\ feature, with round-trip tests - session: FuneraSession::with_id; AgentRuntime carries a stable session_id reused by send/send_stream (fire keeps a fresh one-shot id) - usage: TokenUsage + TokenEvent::Usage; requests set stream_options.include_usage; DeepSeek/OpenAI providers report usage - parallel tools: max_concurrent_tools workers over a shared tool bus - reasoning: ReasoningLevel (Off..Max) with hot-reload; DeepSeek mirrors the official harness (thinking + reasoning_effort), OpenAI maps to reasoning_effort (xhigh/max clamped to high) - Tool::is_shell_tool marker (default false); ShellPolicy applies by marker instead of hard-coded tool names; ShellTool opts in - cancellation: per-call CancellationToken through ReActLoopConfig, ToolExecCommand, and every blocking await (biased select); the loop emits MiddlewareEvent::cancelled on cancel - fix CI-found issues: biased cancellation selects, clippy clone_on_copy
…parallel wiring, cancel example - Agent::fire returns FireHandle; all four entry points carry a per-call CancellationToken exposed as cancel(); dropping any handle auto-cancels - AgentEvent::Cancelled flows through the middleware chain and subscribers (never into session history); awaiting a cancelled handle yields OrchestrateError::Cancelled; recv() returns None once cancelled - ChatResponse.usage carries the last turn's TokenUsage - builder knobs: max_concurrent_tools, reasoning_level; set_reasoning_level hot-reload; AgentRuntime::session_id - new example: cancel (explicit cancel, drop-to-cancel, timeout, middleware notification) - fire() call sites updated across examples, integration tests, and doctests
…mmand - README: cancellation feature bullet + cancel example row; fire() double-await in quick starts - docs/architecture.md: Cancellation section (handles, cooperative exit, AgentEvent::Cancelled never written to session) - docs/examples/README.md: cancel example listed - docs/getting-started.md: fix tool_policy run command (missing --features security); fire() double-await - docs/concepts/effects.md: tool registration is an internal pairing, not an extension API (external code must not couple to the tool registry) - CHANGELOG: serde/session-id/usage/parallel/reasoning/cancellation entries - book/: rebuilt with mdbook (includes the Cancellation section)
ShellPolicy scrutiny now applies by the marker instead of a hard-coded tool-name list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent runtime capabilities batch + full documentation proofread, verified locally with act against the CI workflow.
Highlights
easoning_effort\ for high/max), OpenAI maps to
easoning_effort\ (xhigh/max clamped to high).
Breaking change
\Agent::fire\ now returns a \FireHandle: use \�gent.fire(msg, &runtime).await?.await?\ (all examples/doctests updated).
Verification
Commits