Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/agentkit-tool-compose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runlet = { version = "0.4.0", optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_toon2 = { version = "0.2.0", optional = true }
tokio = { workspace = true, features = ["sync"] }
tokio = { workspace = true, features = ["sync", "time"] }

[features]
default = ["lua"]
Expand Down
32 changes: 13 additions & 19 deletions crates/agentkit-tool-compose/src/tests/runlet.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::atomic::Ordering;
use std::sync::{Arc, Mutex as StdMutex};
use std::time::Duration;

use tokio::sync::Barrier;

use agentkit_core::{MetadataMap, SessionId, ToolCallId, ToolOutput, ToolResultPart, TurnId};
use agentkit_tools_core::{
Expand Down Expand Up @@ -40,8 +43,7 @@ async fn execute_compose(
#[derive(Clone)]
struct OrderingProbeTool {
spec: ToolSpec,
active_parallel: Arc<AtomicUsize>,
saw_parallel_overlap: Arc<AtomicBool>,
parallel_barrier: Arc<Barrier>,
events: Arc<StdMutex<Vec<String>>>,
}

Expand All @@ -55,8 +57,7 @@ impl OrderingProbeTool {
"record compose scheduling",
json!({"type": "object"}),
),
active_parallel: Arc::new(AtomicUsize::new(0)),
saw_parallel_overlap: Arc::new(AtomicBool::new(false)),
parallel_barrier: Arc::new(Barrier::new(2)),
events: Arc::new(StdMutex::new(Vec::new())),
}
}
Expand All @@ -76,15 +77,13 @@ impl Tool for OrderingProbeTool {
let kind = request.input["kind"].as_str().unwrap_or_default();
match kind {
"parallel_a" | "parallel_b" => {
self.active_parallel.fetch_add(1, Ordering::SeqCst);
for _ in 0..1_000 {
if self.active_parallel.load(Ordering::SeqCst) >= 2 {
self.saw_parallel_overlap.store(true, Ordering::SeqCst);
break;
}
tokio::task::yield_now().await;
}
self.active_parallel.fetch_sub(1, Ordering::SeqCst);
tokio::time::timeout(Duration::from_secs(5), self.parallel_barrier.wait())
.await
.map_err(|_| {
ToolError::ExecutionFailed(
"independent effectful calls did not overlap".into(),
)
})?;
}
"prerequisite" => {
self.events
Expand Down Expand Up @@ -117,7 +116,6 @@ impl Tool for OrderingProbeTool {
#[tokio::test]
async fn effectful_calls_run_concurrently_and_after_orders_without_data_flow() {
let child = OrderingProbeTool::new();
let saw_parallel_overlap = child.saw_parallel_overlap.clone();
let events = child.events.clone();
let outcome = execute_compose(
ComposeConfig::default(),
Expand All @@ -142,10 +140,6 @@ return [a.kind, b.kind, later.kind]"#,
),
other => panic!("unexpected outcome: {other:?}"),
}
assert!(
saw_parallel_overlap.load(Ordering::SeqCst),
"independent effectful calls should overlap"
);
assert_eq!(
*events.lock().expect("events lock"),
vec!["prerequisite:start", "prerequisite:finish", "after:start"]
Expand Down
2 changes: 1 addition & 1 deletion crates/agentkit-tool-skills/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ homepage.workspace = true
name = "agentkit-tool-skills"
readme = "README.md"
repository.workspace = true
version = "0.10.7"
version = "0.10.8"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions crates/agentkit-tool-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
Progressive Agent Skills discovery and activation for agentkit.

This crate discovers `SKILL.md` files, builds a lightweight catalog for the
model, and exposes an `activate_skill` tool that loads full skill instructions
model, and exposes a `skill` tool that loads full skill instructions
on demand.

## What it provides

- recursive skill discovery from one or more roots
- exact-directory loading for package formats with fixed discovery rules
- frontmatter parsing for skill metadata
- per-session activation tracking to avoid duplicate loads
- progressive disclosure so the model sees descriptions first and bodies later

## Example
Expand All @@ -31,7 +30,7 @@ use agentkit_tool_skills::SkillRegistry;
// (`./.agents/skills` and `~/.agents/skills`).
let registry = SkillRegistry::discover(".").build().await;

// `tool_registry()` returns a `ToolRegistry` exposing only `activate_skill`,
// `tool_registry()` returns a `ToolRegistry` exposing only `skill`,
// ready to merge with the rest of your agent's tools.
let tools = agentkit_tools_core::ToolRegistry::new()
.merge(registry.tool_registry());
Expand Down
Loading
Loading