mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
chore(core): refine zen model wording and cleanup comments
This commit is contained in:
@@ -336,12 +336,12 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
}),
|
||||
show_in_picker: false,
|
||||
},
|
||||
// Hanzo Zen models (qwen3+ based, served via api.hanzo.ai)
|
||||
// Zen models (qwen3+ based)
|
||||
ModelPreset {
|
||||
id: "zen-4-coder".to_string(),
|
||||
model: "zen-4-coder".to_string(),
|
||||
display_name: "zen-4-coder".to_string(),
|
||||
description: "Frontier Zen coding model optimized for agentic workflows.".to_string(),
|
||||
description: "Zen coding model for multi-file edits and agentic workflows.".to_string(),
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: vec![
|
||||
ReasoningEffortPreset {
|
||||
@@ -366,7 +366,7 @@ static PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
|
||||
id: "zen-4".to_string(),
|
||||
model: "zen-4".to_string(),
|
||||
display_name: "zen-4".to_string(),
|
||||
description: "General purpose Zen model with broad knowledge and strong reasoning.".to_string(),
|
||||
description: "General-purpose Zen model; broad knowledge with strong reasoning.".to_string(),
|
||||
default_reasoning_effort: ReasoningEffort::Medium,
|
||||
supported_reasoning_efforts: vec![
|
||||
ReasoningEffortPreset {
|
||||
|
||||
@@ -275,7 +275,7 @@ const AGENT_MODEL_SPECS: &[AgentModelSpec] = &[
|
||||
read_only_args: ZEN_4_CODER_READ_ONLY,
|
||||
write_args: ZEN_4_CODER_WRITE,
|
||||
model_args: &["--model", "zen-4-coder"],
|
||||
description: "Hanzo Zen frontier coding agent; qwen3-based, strong at multi-file edits and agentic workflows.",
|
||||
description: "Zen coding agent (qwen3-based); strong at multi-file edits and agentic workflows.",
|
||||
enabled_by_default: true,
|
||||
aliases: &[
|
||||
"zen-4",
|
||||
|
||||
@@ -375,8 +375,6 @@ pub(crate) struct Session {
|
||||
pub(super) retention_config: crate::config_types::RetentionConfig,
|
||||
pub(super) model_descriptions: Option<String>,
|
||||
|
||||
/// ZAP native tool dispatcher for in-process filesystem, VCS, build,
|
||||
/// network, and LSP tools — no MCP server required.
|
||||
pub(super) zap_dispatcher: std::sync::Arc<hanzo_zap::ToolDispatcher>,
|
||||
}
|
||||
pub(super) struct HookGuard<'a> {
|
||||
|
||||
@@ -3242,7 +3242,6 @@ async fn handle_function_call(
|
||||
"code_bridge" | "code_bridge_subscription" => {
|
||||
handle_code_bridge(sess, &ctx, arguments).await
|
||||
}
|
||||
// ZAP native tools: filesystem, VCS, build, network, LSP — no MCP required.
|
||||
_ if name.starts_with("zap_") => {
|
||||
handle_zap_tool_call(sess, &name, arguments, call_id).await
|
||||
}
|
||||
@@ -3267,11 +3266,6 @@ async fn handle_function_call(
|
||||
}
|
||||
}
|
||||
|
||||
/// Dispatch a `zap_*` tool call to the ZAP native executor.
|
||||
///
|
||||
/// Strips the `zap_` prefix from the tool name, parses the JSON arguments,
|
||||
/// builds an [`hanzo_zap::ExecutorContext`] from the session state, and calls
|
||||
/// the dispatcher. Returns the result as a `FunctionCallOutput`.
|
||||
async fn handle_zap_tool_call(
|
||||
sess: &Session,
|
||||
prefixed_name: &str,
|
||||
|
||||
@@ -272,7 +272,7 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {
|
||||
max_output_tokens: Some(MAX_OUTPUT_DEFAULT),
|
||||
)
|
||||
} else if slug.starts_with("zen-") || slug.starts_with("zen4") || slug.starts_with("qwen") {
|
||||
// Hanzo Zen models (qwen3+ based, served via api.hanzo.ai)
|
||||
// Zen models (qwen3+ based)
|
||||
model_family!(
|
||||
slug, "zen-4",
|
||||
needs_special_apply_patch_instructions: true,
|
||||
|
||||
@@ -584,10 +584,6 @@ pub(crate) fn mcp_tool_to_openai_tool(
|
||||
})
|
||||
}
|
||||
|
||||
/// Convert a ZAP [`hanzo_zap::ToolDef`] into a [`ResponsesApiTool`].
|
||||
///
|
||||
/// The tool name is prefixed with `zap_` so the model (and dispatch logic) can
|
||||
/// distinguish ZAP-native tools from built-in and MCP tools.
|
||||
fn zap_tool_to_openai_tool(
|
||||
tool_def: &hanzo_zap::ToolDef,
|
||||
) -> Result<ResponsesApiTool, serde_json::Error> {
|
||||
@@ -730,7 +726,6 @@ pub fn get_openai_tools(
|
||||
get_openai_tools_with_zap(config, mcp_tools, None, browser_enabled, _agents_active)
|
||||
}
|
||||
|
||||
/// Like [`get_openai_tools`] but also accepts ZAP native tool definitions.
|
||||
pub fn get_openai_tools_with_zap(
|
||||
config: &ToolsConfig,
|
||||
mcp_tools: Option<HashMap<String, mcp_types::Tool>>,
|
||||
@@ -815,11 +810,9 @@ pub fn get_openai_tools_with_zap(
|
||||
}
|
||||
}
|
||||
|
||||
// Add ZAP native tools (filesystem, VCS, build, network, LSP).
|
||||
// These are prefixed with "zap_" to avoid collisions with built-in tools.
|
||||
if let Some(zap_tools) = zap_tools {
|
||||
for tool_def in zap_tools {
|
||||
// Skip tools that duplicate built-in functionality.
|
||||
// Skip tools that overlap with built-ins.
|
||||
if matches!(
|
||||
tool_def.name.as_str(),
|
||||
"exec"
|
||||
|
||||
@@ -528,9 +528,9 @@ impl ModelSelectionView {
|
||||
} else if model.eq_ignore_ascii_case("gpt-5.1") {
|
||||
Some("Broad world knowledge with strong general reasoning.")
|
||||
} else if model.eq_ignore_ascii_case("zen-4-coder") {
|
||||
Some("Frontier Zen coding model optimized for agentic workflows.")
|
||||
Some("Zen coding model for multi-file edits and agentic workflows.")
|
||||
} else if model.eq_ignore_ascii_case("zen-4") {
|
||||
Some("General purpose Zen model with broad knowledge and strong reasoning.")
|
||||
Some("General-purpose Zen model; broad knowledge with strong reasoning.")
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -212,10 +212,6 @@ impl ToolDispatcher {
|
||||
self.category_map.get(category).cloned().unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Return tool schemas for all registered tools.
|
||||
///
|
||||
/// Looks up each registered tool name in `default_tools()` and returns the
|
||||
/// matching `ToolDef` entries. Tools without a schema definition are skipped.
|
||||
pub fn all_tool_schemas(&self) -> Vec<ToolDef> {
|
||||
let all_defs = crate::tools::default_tools();
|
||||
let registered: std::collections::HashSet<&str> =
|
||||
|
||||
Reference in New Issue
Block a user