feat: add config-owned direct submit runtime

Keep browser-attached workflows on the configured direct-skill path and align the Zhihu export/browser regression contracts with the current ws merge state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
木炎
2026-04-11 15:45:42 +08:00
29 changed files with 5218 additions and 585 deletions

View File

@@ -112,10 +112,15 @@ fn write_skill_script(skill_dir: &std::path::Path, relative_path: &str, body: &s
}
fn real_skill_lib_root() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
let repo_parent = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.join("skill_lib")
.to_path_buf();
let hyphenated = repo_parent.join("skill-lib");
if hyphenated.exists() {
return hyphenated;
}
repo_parent.join("skill_lib")
}
fn success_browser_response(seq: u64, data: Value) -> BrowserMessage {
@@ -349,6 +354,9 @@ fn compat_runtime_uses_zeroclaw_provider_path_and_executes_browser_actions() {
server_handle.join().unwrap();
let request_bodies = requests.lock().unwrap().clone();
std::env::remove_var("DEEPSEEK_API_KEY");
std::env::remove_var("DEEPSEEK_BASE_URL");
std::env::remove_var("DEEPSEEK_MODEL");
let sent = transport.sent_messages();
assert_eq!(summary, "已通过 ZeroClaw 执行任务: 打开百度搜索天气");
@@ -676,7 +684,10 @@ fn handle_browser_message_routes_supported_instruction_to_compat_runtime_when_ll
message,
AgentMessage::LogEntry { level, message }
if level == "info" &&
message == "sgclaw runtime version=0.1.0 protocol=1.0"
message == &format!(
"sgclaw runtime version={} protocol=1.0",
env!("CARGO_PKG_VERSION")
)
)
}));
assert!(sent.iter().any(|message| {
@@ -883,6 +894,11 @@ fn handle_browser_message_falls_back_to_compat_runtime_for_unsupported_instructi
#[test]
fn handle_browser_message_requires_llm_configuration_when_no_model_is_available() {
let _guard = env_lock().lock().unwrap_or_else(|err| err.into_inner());
std::env::remove_var("DEEPSEEK_API_KEY");
std::env::remove_var("DEEPSEEK_BASE_URL");
std::env::remove_var("DEEPSEEK_MODEL");
let transport = Arc::new(MockTransport::new(vec![]));
let browser_tool = BrowserPipeTool::new(
transport.clone(),