Files
codex/codex-rs/context-fragments/src/lib.rs
T
Felipe Coury 0ed34eb9ce Ensure side-chat policy reaches the first model request (#60067)
## Why

An inherited turn can suppress a fork's configured developer instructions, leaving the first side-chat request without its developer policy.

## What changed

- Move shared side-conversation instructions and the history boundary into `codex-context-fragments`.
- Inject the developer policy before the user-role boundary when creating a TUI side-chat fork, while retaining the configured instructions.
- Distinguish attached and temporary policies, applying the worktree restriction only to temporary side chats.
- Add guidance to set up recurring monitors in the main chat or a new chat because temporary side chats cannot run scheduled updates.

## Testing

Add a TUI integration test that checks the first side-chat model request contains the policy and boundary. Add a core request-history snapshot covering an attached side chat that preserves inherited context, policy, and its prior answer after resuming from disk.

GitOrigin-RevId: 889cb317dc3327457cd9ef0879ec9f77dbfaeeba
2026-11-07 05:59:44 +00:00

29 lines
1.1 KiB
Rust

mod answered_question;
pub use answered_question::AnsweredQuestion;
mod additional_context;
mod annotated_content;
mod fragment;
mod recap_prompt;
mod side_conversation;
pub use additional_context::AdditionalContextDeveloperFragment;
pub use additional_context::AdditionalContextToolOutput;
pub use additional_context::AdditionalContextUserFragment;
pub use additional_context::MAX_ADDITIONAL_CONTEXT_VALUE_TOKENS;
pub use annotated_content::AnnotatedContent;
pub use annotated_content::message_from_parts;
pub use annotated_content::set_annotated_content;
pub use annotated_content::to_annotated_content;
pub use annotated_content::truncate_annotated_text;
pub use fragment::AttributedFragment;
pub use fragment::ContextualUserFragment;
pub use fragment::RenderedFragment;
pub use recap_prompt::RecapPrompt;
pub use side_conversation::SIDE_BOUNDARY_TITLE;
pub use side_conversation::SideConversationPolicy;
pub use side_conversation::side_conversation_boundary;
/// Shared classification for compaction summaries produced by core and filtered by Guardian.
pub const COMPACTION_SUMMARY_KIND: &str = "compaction.summary";