f7a720204a
- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用 - 添加所有子项目的完整源代码 - 保留原始 .git 为 .git.bak 备份
68 lines
1.7 KiB
Rust
68 lines
1.7 KiB
Rust
//! Integration tests for Spawn tool description (TC-4.2-07).
|
|
//!
|
|
//! Verifies the enhanced Spawn tool description contains capacity limits
|
|
//! and usage guidance as specified in the test plan.
|
|
|
|
mod common;
|
|
|
|
use std::sync::Arc;
|
|
|
|
use common::{MockLlmProvider, test_config};
|
|
use nomi_agent::spawn_tool::SpawnTool;
|
|
use nomi_agent::spawner::AgentSpawner;
|
|
use nomi_tools::Tool;
|
|
|
|
fn make_spawn_tool() -> SpawnTool {
|
|
let provider = Arc::new(MockLlmProvider::with_text_response("ok"));
|
|
let spawner = Arc::new(AgentSpawner::new(
|
|
provider,
|
|
test_config(),
|
|
std::env::temp_dir(),
|
|
));
|
|
SpawnTool::new(spawner)
|
|
}
|
|
|
|
// --- TC-4.2-07: Spawn tool description contains capacity limits ---
|
|
|
|
#[test]
|
|
fn spawn_description_mentions_max_agents() {
|
|
let tool = make_spawn_tool();
|
|
let desc = tool.description();
|
|
assert!(
|
|
desc.contains('5'),
|
|
"Spawn description should mention the 5 sub-agent limit"
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn spawn_description_mentions_parallel() {
|
|
let tool = make_spawn_tool();
|
|
let desc = tool.description();
|
|
assert!(
|
|
desc.contains("parallel"),
|
|
"Spawn description should mention parallel execution"
|
|
);
|
|
}
|
|
|
|
// --- R-4.1-01: Spawn description should document max_turns and max_tokens ---
|
|
|
|
#[test]
|
|
fn spawn_description_mentions_max_turns() {
|
|
let tool = make_spawn_tool();
|
|
let desc = tool.description();
|
|
assert!(
|
|
desc.contains("200"),
|
|
"Spawn description should mention the 200 turn limit per sub-agent"
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn spawn_description_mentions_max_tokens() {
|
|
let tool = make_spawn_tool();
|
|
let desc = tool.description();
|
|
assert!(
|
|
desc.contains("4096"),
|
|
"Spawn description should mention the 4096 token limit per sub-agent"
|
|
);
|
|
}
|