mirror of
https://github.com/openai/codex.git
synced 2026-05-01 03:42:05 +03:00
Add config to disable /feedback (#8909)
Some enterprises do not want their users to be able to `/feedback`. <img width="395" height="325" alt="image" src="https://github.com/user-attachments/assets/2dae9c0b-20c3-4a15-bcd3-0187857ebbd8" /> Adds to `config.toml`: ```toml [feedback] enabled = false ``` I've deliberately decided to: 1. leave other references to `/feedback` (e.g. in the interrupt message, tips of the day) unchanged. I think we should continue to promote the feature even if it is not usable currently. 2. leave the `/feedback` menu item selectable and display an error saying it's disabled, rather than remove the menu item (which I believe would raise more questions). but happy to discuss these. This will be followed by a change to requirements.toml that admins can use to force the value of feedback.enabled.
This commit is contained in:
@@ -3678,6 +3678,16 @@ impl CodexMessageProcessor {
|
||||
}
|
||||
|
||||
async fn upload_feedback(&self, request_id: RequestId, params: FeedbackUploadParams) {
|
||||
if !self.config.feedback_enabled {
|
||||
let error = JSONRPCErrorError {
|
||||
code: INVALID_REQUEST_ERROR_CODE,
|
||||
message: "sending feedback is disabled by configuration".to_string(),
|
||||
data: None,
|
||||
};
|
||||
self.outgoing.send_error(request_id, error).await;
|
||||
return;
|
||||
}
|
||||
|
||||
let FeedbackUploadParams {
|
||||
classification,
|
||||
reason,
|
||||
|
||||
Reference in New Issue
Block a user