A supervised worker runs in the DAEMON's environment, not the requesting * client's. The daemon admitted this request under the client's session policy * and re-executed us with the canonical repo_path in the args (both daemon * spawn paths rewrite it), so the request itself is the worker's workspace * scope: repository == session root == allowed root. Without this, a fresh * server fell back
| 849 | * missing repository as the tool error it always was, instead of the |
| 850 | * supervisor misreading a refused worker as a crash. */ |
| 851 | static const char *main_index_worker_scope_request(cbm_mcp_server_t *srv, const char *args_json) { |
| 852 | char *repo_path = cbm_mcp_get_string_arg(args_json, "repo_path"); |
| 853 | if (!repo_path || !repo_path[0]) { |
| 854 | free(repo_path); |
| 855 | return "request names no repo_path"; |
| 856 | } |
| 857 | char canonical[MAIN_PATH_CAP]; |
| 858 | bool exists = cbm_canonical_path(repo_path, canonical, sizeof(canonical)) != 0; |
| 859 | const char *scope = exists ? canonical : repo_path; |
| 860 | bool scoped = cbm_mcp_server_set_session_context(srv, scope, exists ? scope : NULL); |
| 861 | free(repo_path); |
| 862 | return scoped ? NULL : "session context could not be installed"; |
| 863 | } |
| 864 | |
| 865 | static int run_cli(int argc, char **argv, cbm_project_lock_manager_t *project_locks, |
| 866 | main_local_maintenance_context_t *maintenance_context) { |
no test coverage detected