MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / doctor_check_config

Function doctor_check_config

src/agents/opencode.rs:294–325  ·  view source on GitHub ↗

Check opencode.json has tracedecay registered.

(dc: &mut DoctorCounters, home: &Path)

Source from the content-addressed store, hash-verified

292
293/// Check opencode.json has tracedecay registered.
294fn doctor_check_config(dc: &mut DoctorCounters, home: &Path) {
295 let config_path = opencode_config_path(home);
296 if !config_path.exists() {
297 dc.warn(&format!(
298 "{} not found — run `tracedecay install --agent opencode` if you use OpenCode",
299 config_path.display()
300 ));
301 return;
302 }
303
304 let config = load_json_file(&config_path);
305 let mcp_entry = &config["mcp"]["tracedecay"];
306 if !mcp_entry.is_object() {
307 dc.fail(&format!(
308 "MCP server NOT registered in {} — run `tracedecay install --agent opencode`",
309 config_path.display()
310 ));
311 return;
312 }
313 dc.pass(&format!(
314 "MCP server registered in {}",
315 config_path.display()
316 ));
317
318 let command = mcp_entry["command"].as_array();
319 let has_serve = command.is_some_and(|arr| arr.iter().any(|v| v.as_str() == Some("serve")));
320 if has_serve {
321 dc.pass("MCP server args include \"serve\"");
322 } else {
323 dc.fail("MCP server args missing \"serve\" — run `tracedecay install --agent opencode`");
324 }
325}
326
327/// Check AGENTS.md contains tracedecay rules.
328fn doctor_check_prompt(dc: &mut DoctorCounters, home: &Path) {

Callers 1

healthcheckMethod · 0.70

Calls 7

load_json_fileFunction · 0.85
existsMethod · 0.80
warnMethod · 0.80
failMethod · 0.80
passMethod · 0.80
opencode_config_pathFunction · 0.70
as_strMethod · 0.45

Tested by

no test coverage detected