Skip to main content

enrich_tool_input_with_runtime_context

Function enrich_tool_input_with_runtime_context 

Source
pub fn enrich_tool_input_with_runtime_context(
    tool_input: &Value,
    workspace_dir: &Path,
    current_model: Option<&str>,
    session_id: &str,
    agent_name: &str,
    provenance: Option<&ExecutionProvenance>,
) -> Value
Expand description

Enrich tool input with session metadata, provenance, and workspace-aware paths.

ยงExamples

use codetether_agent::session::helper::runtime::enrich_tool_input_with_runtime_context;
use serde_json::json;
use std::path::Path;

let enriched = enrich_tool_input_with_runtime_context(
    &json!({"path": "src/lib.rs"}),
    Path::new("/workspace"),
    Some("example/model"),
    "session-1",
    "agent-build",
    None,
);

assert_eq!(enriched["path"], "/workspace/src/lib.rs");
assert_eq!(enriched["__ct_session_id"], "session-1");