mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Split DeveloperInstructions into individual fragments. (#18813)
Split DeveloperInstructions into individual fragments.
This commit is contained in:
committed by
GitHub
Unverified
parent
5fe767e8e1
commit
2a226096f6
@@ -7,7 +7,6 @@ use std::time::Duration;
|
||||
use anyhow::anyhow;
|
||||
use codex_protocol::config_types::Personality;
|
||||
use codex_protocol::config_types::ReasoningSummary as ReasoningSummaryConfig;
|
||||
use codex_protocol::models::DeveloperInstructions;
|
||||
use codex_protocol::models::ResponseItem;
|
||||
use codex_protocol::openai_models::ReasoningEffort as ReasoningEffortConfig;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
@@ -29,6 +28,8 @@ use crate::config::Constrained;
|
||||
use crate::config::ManagedFeatures;
|
||||
use crate::config::NetworkProxySpec;
|
||||
use crate::config::Permissions;
|
||||
use crate::context::ContextualUserFragment;
|
||||
use crate::context::GuardianFollowupReviewReminder;
|
||||
use crate::rollout::recorder::RolloutRecorder;
|
||||
use crate::session::Codex;
|
||||
use crate::session::session::Session;
|
||||
@@ -48,14 +49,6 @@ use super::prompt::guardian_policy_prompt;
|
||||
use super::prompt::guardian_policy_prompt_with_config;
|
||||
|
||||
const GUARDIAN_INTERRUPT_DRAIN_TIMEOUT: Duration = Duration::from_secs(5);
|
||||
const GUARDIAN_FOLLOWUP_REVIEW_REMINDER: &str = concat!(
|
||||
"Use prior reviews as context, not binding precedent. ",
|
||||
"Follow the Workspace Policy. ",
|
||||
"If the user explicitly approves a previously rejected action after being informed of the ",
|
||||
"concrete risks, set outcome to \"allow\" unless the policy explicitly disallows user ",
|
||||
"overwrites in such cases."
|
||||
);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum GuardianReviewSessionOutcome {
|
||||
Completed(anyhow::Result<Option<String>>),
|
||||
@@ -634,8 +627,7 @@ async fn run_review_on_session(
|
||||
|
||||
async fn append_guardian_followup_reminder(review_session: &GuardianReviewSession) {
|
||||
let turn_context = review_session.codex.session.new_default_turn().await;
|
||||
let reminder: ResponseItem =
|
||||
DeveloperInstructions::new(GUARDIAN_FOLLOWUP_REVIEW_REMINDER).into();
|
||||
let reminder: ResponseItem = ContextualUserFragment::into(GuardianFollowupReviewReminder);
|
||||
review_session
|
||||
.codex
|
||||
.session
|
||||
|
||||
Reference in New Issue
Block a user