Skip to content

Conversation

@dwolaver
Copy link
Contributor

@dwolaver dwolaver commented Jan 2, 2026

No description provided.

@dwolaver dwolaver requested a review from a team as a code owner January 2, 2026 17:57
Copilot AI review requested due to automatic review settings January 2, 2026 17:57
@dwolaver dwolaver marked this pull request as draft January 2, 2026 17:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes OEM-specific configuration file integration from the build process as part of FFV (likely "Firmware Version") config file isolation. The change removes two parameters from the JSON configuration merge command that previously incorporated OEM customizations.

  • Removes OEM configuration substitution and addition parameters from the build-time JSON combine step

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dwolaver dwolaver marked this pull request as ready for review January 15, 2026 16:17
Copilot AI review requested due to automatic review settings January 15, 2026 16:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/voice/ctrlm_voice_obj.h:747

  • The function declaration for vsdk_keyword_sensitivity_limit_check remains in the header file but its implementation has been removed from ctrlm_voice_obj.cpp. This will cause a linker error if any code attempts to call this function. Remove this declaration from the header file.
    double               vsdk_keyword_sensitivity_limit_check(double sensitivity);

src/ctrlm_main.cpp:1631

  • The root JSON object is retrieved before the OEM configuration is appended (line 1646). While this works because json_from_path returns a reference to the internal root object which is modified in-place by append_config, it creates confusing code flow. Consider moving this call after the OEM config append operation for clarity, or add a comment explaining why this order is intentional.
   *json_obj_root = ctrlm_config->json_from_path("", true); // Get root AND add ref to it, since this code derefs it

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 16, 2026 20:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/voice/ctrlm_voice_obj.h:747

  • The function declaration for vsdk_keyword_sensitivity_limit_check should be removed since its implementation has been deleted. This leftover declaration will cause linking errors if anyone attempts to use it.
    double               vsdk_keyword_sensitivity_limit_check(double sensitivity);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 21, 2026 16:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 21, 2026 23:15
Copy link

Copilot AI commented Jan 21, 2026

@dwolaver I've opened a new pull request, #172, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +78 to 79
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON parse error log now includes the full config file contents. This can be very large and may leak sensitive data into logs. Consider truncating the logged contents and/or only including it when verbose is enabled.

Copilot uses AI. Check for mistakes.
Comment on lines 1695 to 1697
}

//Extract the vsdk configuration object
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the vsdk extraction block immediately below this section, the code sets json_obj_vsdk = NULL when the JSON value is missing or not an object. That only clears the local pointer variable, not the out-param; if the value exists but is the wrong type, callers can still receive a non-object *json_obj_vsdk. Update that branch to clear *json_obj_vsdk instead.

Copilot uses AI. Check for mistakes.
Comment on lines +1665 to +1675
// Print the configuration since it was loaded from files
char *json_dump = json_dumps(*json_obj_root, JSON_INDENT(3) | JSON_SORT_KEYS);
if(json_dump == NULL) {
XLOGD_ERROR("unable to dump JSON object");
json_decref(*json_obj_root);
*json_obj_root = NULL;
return(false);
} else {
XLOGD_INFO_OPTS(XLOG_OPTS_DEFAULT, 20 * 1024, "Final configuration:\n%s", json_dump);
free(json_dump);
}
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dumping the entire merged configuration to logs can expose secrets/PII (e.g., device_id, endpoints, auth URLs) in production. Consider gating this behind a debug/verbose flag, masking sensitive fields before logging, or removing the full dump entirely.

Suggested change
// Print the configuration since it was loaded from files
char *json_dump = json_dumps(*json_obj_root, JSON_INDENT(3) | JSON_SORT_KEYS);
if(json_dump == NULL) {
XLOGD_ERROR("unable to dump JSON object");
json_decref(*json_obj_root);
*json_obj_root = NULL;
return(false);
} else {
XLOGD_INFO_OPTS(XLOG_OPTS_DEFAULT, 20 * 1024, "Final configuration:\n%s", json_dump);
free(json_dump);
}
// Configuration successfully loaded and validated at this point

Copilot uses AI. Check for mistakes.
Comment on lines +102 to +114
json_t *append_root = json_loads(contents.c_str(), JSON_REJECT_DUPLICATES, &json_error);
if(append_root == NULL) {
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
} else {
if(json_object_update(this->root, append_root) != 0) {
XLOGD_ERROR("Failed to merge JSON objects");
} else {
if(verbose) {
XLOGD_INFO("config appended successfully as JSON for <%s>", file_path.c_str());
}
ret = true;
}
json_decref(append_root);
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append_config() uses json_object_update(), which overwrites top-level keys and replaces nested objects wholesale. If the OPT file is intended to override only a subset of an OEM section (common for config overrides), this will drop the rest of the OEM subtree. Use a recursive merge (e.g., json_object_update_recursive() or equivalent custom deep-merge) to preserve existing nested keys while overriding only those provided.

Copilot uses AI. Check for mistakes.
install(TARGETS controlMgr RUNTIME DESTINATION bin)

install(FILES ${CMAKE_BINARY_DIR}/ctrlm_config.json.template DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} COMPONENT config )
install(FILES ${CMAKE_BINARY_DIR}/ctrlm_config.json DESTINATION ${CMAKE_INSTALL_SYSCONFDIR} COMPONENT config )
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctrlm_load_config() now loads OEM config from /etc/vendor/input/ctrlm_config.json, but the build installs ctrlm_config.json to ${CMAKE_INSTALL_SYSCONFDIR} (typically /etc). This mismatch means the installed config may never be read at runtime. Align the install destination with the runtime search path (or update the runtime path to match the install).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants