mirror of
https://github.com/openai/codex.git
synced 2026-11-02 16:20:35 +00:00
add(feedback): over-refusal / safety check (#11948)
Add new feedback option for "Over-refusal / safety check"
This commit is contained in:
1 parent
19afbc35c1
commit
b37555dd75
5 files changed
+54
-15
No files matched your search
@@ -279,7 +279,7 @@ impl CodexLogSnapshot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let level = match classification {
|
let level = match classification {
|
||||||
"bug" | "bad_result" => Level::Error,
|
"bug" | "bad_result" | "safety_check" => Level::Error,
|
||||||
_ => Level::Info,
|
_ => Level::Info,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -342,6 +342,7 @@ fn display_classification(classification: &str) -> String {
|
|||||||
"bug" => "Bug".to_string(),
|
"bug" => "Bug".to_string(),
|
||||||
"bad_result" => "Bad result".to_string(),
|
"bad_result" => "Bad result".to_string(),
|
||||||
"good_result" => "Good result".to_string(),
|
"good_result" => "Good result".to_string(),
|
||||||
|
"safety_check" => "Safety check".to_string(),
|
||||||
_ => "Other".to_string(),
|
_ => "Other".to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,5 +371,6 @@ pub(crate) enum FeedbackCategory {
|
|||||||
BadResult,
|
BadResult,
|
||||||
GoodResult,
|
GoodResult,
|
||||||
Bug,
|
Bug,
|
||||||
|
SafetyCheck,
|
||||||
Other,
|
Other,
|
||||||
}
|
}
|
||||||
@@ -353,6 +353,10 @@ fn feedback_title_and_placeholder(category: FeedbackCategory) -> (String, String
|
|||||||
"Tell us more (bug)".to_string(),
|
"Tell us more (bug)".to_string(),
|
||||||
"(optional) Write a short description to help us further".to_string(),
|
"(optional) Write a short description to help us further".to_string(),
|
||||||
),
|
),
|
||||||
|
FeedbackCategory::SafetyCheck => (
|
||||||
|
"Tell us more (safety check)".to_string(),
|
||||||
|
"(optional) Share what was refused and why it should have been allowed".to_string(),
|
||||||
|
),
|
||||||
FeedbackCategory::Other => (
|
FeedbackCategory::Other => (
|
||||||
"Tell us more (other)".to_string(),
|
"Tell us more (other)".to_string(),
|
||||||
"(optional) Write a short description to help us further".to_string(),
|
"(optional) Write a short description to help us further".to_string(),
|
||||||
@@ -365,6 +369,7 @@ fn feedback_classification(category: FeedbackCategory) -> &'static str {
|
|||||||
FeedbackCategory::BadResult => "bad_result",
|
FeedbackCategory::BadResult => "bad_result",
|
||||||
FeedbackCategory::GoodResult => "good_result",
|
FeedbackCategory::GoodResult => "good_result",
|
||||||
FeedbackCategory::Bug => "bug",
|
FeedbackCategory::Bug => "bug",
|
||||||
|
FeedbackCategory::SafetyCheck => "safety_check",
|
||||||
FeedbackCategory::Other => "other",
|
FeedbackCategory::Other => "other",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -378,14 +383,15 @@ fn issue_url_for_category(
|
|||||||
// the external GitHub behavior identical while routing internal users to
|
// the external GitHub behavior identical while routing internal users to
|
||||||
// the internal go link.
|
// the internal go link.
|
||||||
match category {
|
match category {
|
||||||
FeedbackCategory::Bug | FeedbackCategory::BadResult | FeedbackCategory::Other => {
|
FeedbackCategory::Bug
|
||||||
Some(match feedback_audience {
|
| FeedbackCategory::BadResult
|
||||||
FeedbackAudience::OpenAiEmployee => slack_feedback_url(thread_id),
|
| FeedbackCategory::SafetyCheck
|
||||||
FeedbackAudience::External => {
|
| FeedbackCategory::Other => Some(match feedback_audience {
|
||||||
format!("{BASE_BUG_ISSUE_URL}&steps=Uploaded%20thread:%20{thread_id}")
|
FeedbackAudience::OpenAiEmployee => slack_feedback_url(thread_id),
|
||||||
}
|
FeedbackAudience::External => {
|
||||||
})
|
format!("{BASE_BUG_ISSUE_URL}&steps=Uploaded%20thread:%20{thread_id}")
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
FeedbackCategory::GoodResult => None,
|
FeedbackCategory::GoodResult => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,6 +429,12 @@ pub(crate) fn feedback_selection_params(
|
|||||||
"Helpful, correct, high‑quality, or delightful result worth celebrating.",
|
"Helpful, correct, high‑quality, or delightful result worth celebrating.",
|
||||||
FeedbackCategory::GoodResult,
|
FeedbackCategory::GoodResult,
|
||||||
),
|
),
|
||||||
|
make_feedback_item(
|
||||||
|
app_event_tx.clone(),
|
||||||
|
"safety check",
|
||||||
|
"Benign usage blocked due to safety checks or refusals.",
|
||||||
|
FeedbackCategory::SafetyCheck,
|
||||||
|
),
|
||||||
make_feedback_item(
|
make_feedback_item(
|
||||||
app_event_tx,
|
app_event_tx,
|
||||||
"other",
|
"other",
|
||||||
@@ -616,7 +628,14 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn issue_url_available_for_bug_bad_result_and_other() {
|
fn feedback_view_safety_check() {
|
||||||
|
let view = make_view(FeedbackCategory::SafetyCheck);
|
||||||
|
let rendered = render(&view, 60);
|
||||||
|
insta::assert_snapshot!("feedback_view_safety_check", rendered);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn issue_url_available_for_bug_bad_result_safety_check_and_other() {
|
||||||
let bug_url = issue_url_for_category(
|
let bug_url = issue_url_for_category(
|
||||||
FeedbackCategory::Bug,
|
FeedbackCategory::Bug,
|
||||||
"thread-1",
|
"thread-1",
|
||||||
@@ -639,6 +658,13 @@ mod tests {
|
|||||||
);
|
);
|
||||||
assert!(other_url.is_some());
|
assert!(other_url.is_some());
|
||||||
|
|
||||||
|
let safety_check_url = issue_url_for_category(
|
||||||
|
FeedbackCategory::SafetyCheck,
|
||||||
|
"thread-4",
|
||||||
|
FeedbackAudience::OpenAiEmployee,
|
||||||
|
);
|
||||||
|
assert!(safety_check_url.is_some());
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
issue_url_for_category(
|
issue_url_for_category(
|
||||||
FeedbackCategory::GoodResult,
|
FeedbackCategory::GoodResult,
|
||||||
|
|||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tui/src/bottom_pane/feedback_view.rs
|
||||||
|
expression: rendered
|
||||||
|
---
|
||||||
|
▌ Tell us more (safety check)
|
||||||
|
▌
|
||||||
|
▌ (optional) Share what was refused and why it should have b
|
||||||
|
|
||||||
|
Press enter to confirm or esc to go back
|
||||||
+7
-5
@@ -4,8 +4,10 @@ expression: popup
|
|||||||
---
|
---
|
||||||
How was this?
|
How was this?
|
||||||
|
|
||||||
› 1. bug Crash, error message, hang, or broken UI/behavior.
|
› 1. bug Crash, error message, hang, or broken UI/behavior.
|
||||||
2. bad result Output was off-target, incorrect, incomplete, or unhelpful.
|
2. bad result Output was off-target, incorrect, incomplete, or unhelpful.
|
||||||
3. good result Helpful, correct, high‑quality, or delightful result worth
|
3. good result Helpful, correct, high‑quality, or delightful result worth
|
||||||
celebrating.
|
celebrating.
|
||||||
4. other Slowness, feature suggestion, UX feedback, or anything else.
|
4. safety check Benign usage blocked due to safety checks or refusals.
|
||||||
|
5. other Slowness, feature suggestion, UX feedback, or anything
|
||||||
|
else.
|
||||||
Reference in new issue
Block a user