mirror of
https://github.com/openai/codex.git
synced 2026-05-25 05:24:37 +00:00
## Why Older sessions can contain model-warning records persisted as `user` messages, including the unified exec process-limit warning, the `apply_patch`-via-`exec_command` warning, and the model-mismatch high-risk cyber fallback warning. Those warnings are no longer produced as conversation history items, but when old sessions compact they should still be recognized as injected context rather than preserved as real user turns. ## What changed - Removed `record_model_warning` and the production paths that emitted these warning messages into conversation history. - Added `LegacyUnifiedExecProcessLimitWarning`, `LegacyApplyPatchExecCommandWarning`, and `LegacyModelMismatchWarning` contextual fragments that are used only for matching old persisted messages. - Registered the legacy fragments with contextual user message detection so compaction filters them through the existing fragment path. - Added focused compaction coverage for old warning messages being dropped during compacted-history processing. ## Testing - `cargo test -p codex-core warning` - `just fix -p codex-core`
63 lines
2.8 KiB
Rust
63 lines
2.8 KiB
Rust
//! Context fragments injected into model input.
|
|
|
|
mod approved_command_prefix_saved;
|
|
mod apps_instructions;
|
|
mod available_plugins_instructions;
|
|
mod available_skills_instructions;
|
|
mod collaboration_mode_instructions;
|
|
mod contextual_user_message;
|
|
mod environment_context;
|
|
mod fragment;
|
|
mod goal_context;
|
|
mod guardian_followup_review_reminder;
|
|
mod hook_additional_context;
|
|
mod image_generation_instructions;
|
|
mod legacy_apply_patch_exec_command_warning;
|
|
mod legacy_model_mismatch_warning;
|
|
mod legacy_unified_exec_process_limit_warning;
|
|
mod model_switch_instructions;
|
|
mod network_rule_saved;
|
|
mod permissions_instructions;
|
|
mod personality_spec_instructions;
|
|
mod plugin_instructions;
|
|
mod realtime_end_instructions;
|
|
mod realtime_start_instructions;
|
|
mod realtime_start_with_instructions;
|
|
mod skill_instructions;
|
|
mod subagent_notification;
|
|
mod turn_aborted;
|
|
mod user_instructions;
|
|
mod user_shell_command;
|
|
|
|
pub(crate) use approved_command_prefix_saved::ApprovedCommandPrefixSaved;
|
|
pub(crate) use apps_instructions::AppsInstructions;
|
|
pub(crate) use available_plugins_instructions::AvailablePluginsInstructions;
|
|
pub(crate) use available_skills_instructions::AvailableSkillsInstructions;
|
|
pub(crate) use collaboration_mode_instructions::CollaborationModeInstructions;
|
|
pub(crate) use contextual_user_message::is_contextual_user_fragment;
|
|
pub(crate) use contextual_user_message::parse_visible_hook_prompt_message;
|
|
pub(crate) use environment_context::EnvironmentContext;
|
|
pub use fragment::ContextualUserFragment;
|
|
pub(crate) use fragment::FragmentRegistration;
|
|
pub(crate) use fragment::FragmentRegistrationProxy;
|
|
pub(crate) use goal_context::GoalContext;
|
|
pub(crate) use guardian_followup_review_reminder::GuardianFollowupReviewReminder;
|
|
pub(crate) use hook_additional_context::HookAdditionalContext;
|
|
pub(crate) use image_generation_instructions::ImageGenerationInstructions;
|
|
pub(crate) use legacy_apply_patch_exec_command_warning::LegacyApplyPatchExecCommandWarning;
|
|
pub(crate) use legacy_model_mismatch_warning::LegacyModelMismatchWarning;
|
|
pub(crate) use legacy_unified_exec_process_limit_warning::LegacyUnifiedExecProcessLimitWarning;
|
|
pub(crate) use model_switch_instructions::ModelSwitchInstructions;
|
|
pub(crate) use network_rule_saved::NetworkRuleSaved;
|
|
pub use permissions_instructions::PermissionsInstructions;
|
|
pub(crate) use personality_spec_instructions::PersonalitySpecInstructions;
|
|
pub(crate) use plugin_instructions::PluginInstructions;
|
|
pub(crate) use realtime_end_instructions::RealtimeEndInstructions;
|
|
pub(crate) use realtime_start_instructions::RealtimeStartInstructions;
|
|
pub(crate) use realtime_start_with_instructions::RealtimeStartWithInstructions;
|
|
pub(crate) use skill_instructions::SkillInstructions;
|
|
pub(crate) use subagent_notification::SubagentNotification;
|
|
pub(crate) use turn_aborted::TurnAborted;
|
|
pub(crate) use user_instructions::UserInstructions;
|
|
pub(crate) use user_shell_command::UserShellCommand;
|