MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / patch_config

Function patch_config

crates/opencode-server/src/routes.rs:2424–2438  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
    Json(patch): Json<AppConfig>,
)

Source from the content-addressed store, hash-verified

2422}
2423
2424async fn patch_config(
2425 State(state): State<Arc<ServerState>>,
2426 Json(patch): Json<AppConfig>,
2427) -> Result<Json<AppConfig>> {
2428 let mut config = CONFIG_STATE.write().await;
2429 config.merge(patch);
2430 let updated = config.clone();
2431 state.broadcast(
2432 &serde_json::json!({
2433 "type": "config.updated",
2434 })
2435 .to_string(),
2436 );
2437 Ok(Json(updated))
2438}
2439
2440#[derive(Debug, Serialize)]
2441pub struct ConfigProvidersResponse {

Callers

nothing calls this directly

Calls 3

broadcastMethod · 0.80
mergeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected