MCPcopy Create free account
hub / github.com/AI45Lab/Code / real_executor

Function real_executor

core/tests/test_workflow_facade_real_llm.rs:37–50  ·  view source on GitHub ↗

A bare real-LLM executor over a throwaway workspace. Keep the returned guard in scope so the temp dir is cleaned up (no stray temp files).

()

Source from the content-addressed store, hash-verified

35/// A bare real-LLM executor over a throwaway workspace. Keep the returned guard
36/// in scope so the temp dir is cleaned up (no stray temp files).
37fn real_executor() -> (Arc<dyn AgentExecutor>, tempfile::TempDir) {
38 let path = repo_config_path();
39 let config = CodeConfig::from_file(&path)
40 .unwrap_or_else(|e| panic!("failed to load {}: {e}", path.display()));
41 let llm_client =
42 create_client_with_config(config.default_llm_config().expect("default llm config"));
43 let workspace = tempfile::tempdir().expect("temp workspace");
44 let executor = TaskExecutor::new(
45 Arc::new(AgentRegistry::new()),
46 llm_client,
47 workspace.path().to_string_lossy().to_string(),
48 );
49 (Arc::new(executor), workspace)
50}
51
52/// A real-LLM session built from the repo config, over a throwaway workspace.
53async fn real_session() -> (AgentSession, tempfile::TempDir) {

Calls 5

expectMethod · 0.80
default_llm_configMethod · 0.80
pathMethod · 0.80
repo_config_pathFunction · 0.70

Tested by

no test coverage detected