MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / uninstall_tiered_agent_profiles

Function uninstall_tiered_agent_profiles

src/cli/cli.c:7568–7618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7566}
7567
7568static void uninstall_tiered_agent_profiles(cbm_tiered_profile_set_t profiles, bool dry_run) {
7569 cbm_graph_access_t access = cbm_tiered_profile_set_access(profiles);
7570 for (int value = 0; value < (int)CBM_GRAPH_TIER_COUNT; value++) {
7571 cbm_graph_tier_t tier = (cbm_graph_tier_t)value;
7572 char path[CLI_BUF_1K];
7573 if (cbm_tiered_profile_path(profiles.verify_path, tier, path, sizeof(path)) != CLI_OK) {
7574 record_agent_config_error(true, profiles.label, "agent_path", profiles.verify_path);
7575 continue;
7576 }
7577 if (dry_run) {
7578 printf(" %s agent: would remove owned profile %s\n", profiles.label, path);
7579 continue;
7580 }
7581 char *current =
7582 cbm_render_graph_profile(profiles.dialect, tier, access, profiles.binary_path);
7583 if (!current) {
7584 record_agent_config_error(true, profiles.label, "agent_render", path);
7585 continue;
7586 }
7587 cbm_graph_access_t alternate_access =
7588 access == CBM_GRAPH_ACCESS_DIRECT ? CBM_GRAPH_ACCESS_HANDOFF : CBM_GRAPH_ACCESS_DIRECT;
7589 char *alternate = cbm_render_graph_profile(profiles.dialect, tier, alternate_access,
7590 profiles.binary_path);
7591 char *codex_rc1 =
7592 profiles.dialect == CBM_GRAPH_DIALECT_CODEX && access == CBM_GRAPH_ACCESS_DIRECT
7593 ? cbm_render_graph_profile_codex_rc1(tier)
7594 : NULL;
7595 const char *released[3];
7596 size_t released_count = 0U;
7597 if (alternate) {
7598 released[released_count++] = alternate;
7599 }
7600 if (codex_rc1) {
7601 released[released_count++] = codex_rc1;
7602 }
7603 if (tier == CBM_GRAPH_TIER_VERIFY && profiles.legacy_verify_content) {
7604 released[released_count++] = profiles.legacy_verify_content;
7605 }
7606 int result = cbm_text_remove_owned_document_any(path, current, released, released_count);
7607 free(codex_rc1);
7608 free(alternate);
7609 free(current);
7610 if (result < CLI_OK) {
7611 record_agent_config_error(true, profiles.label, "agent_uninstall", path);
7612 } else if (result > CLI_OK) {
7613 printf(" %s agent: preserved modified profile %s\n", profiles.label, path);
7614 } else {
7615 printf(" %s agent: removed owned profile %s\n", profiles.label, path);
7616 }
7617 }
7618}
7619
7620static void install_tiered_profile_prompts(const char *label, const char *verify_path,
7621 cbm_graph_profile_dialect_t dialect,

Tested by

no test coverage detected