ag-agent 0.15.15

Agentty is an ADE (Agentic Development Environment) for structured, controllable AI-assisted software development.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::sync::{Arc, Mutex};

use serde_json::Value;

/// Captures the dynamic JSON-RPC `id` from a written payload through the
/// supplied mutex so the response side of a mock can echo it back.
pub(super) fn remember_request_id(id_store: &Arc<Mutex<Option<String>>>, payload: &Value) {
    let id = payload
        .get("id")
        .and_then(Value::as_str)
        .map(ToString::to_string);
    if let Ok(mut guard) = id_store.lock() {
        *guard = id;
    }
}