Organize context fragments (#18794)

Organize context fragments under `core/context`. Implement same trait on
all of them.
This commit is contained in:
pakrym-oai
2026-04-20 22:39:17 -07:00
committed by GitHub
Unverified
parent ab26554a3a
commit 4c2e730488
36 changed files with 452 additions and 559 deletions
+6 -9
View File
@@ -1,20 +1,17 @@
use codex_protocol::protocol::AgentStatus;
/// Helpers for model-visible session state markers that are stored in user-role
/// messages but are not user intent.
use crate::contextual_user_message::SUBAGENT_NOTIFICATION_FRAGMENT;
use crate::context::ContextualUserFragment;
use crate::context::SubagentNotification;
// Helpers for model-visible session state markers that are stored in user-role
// messages but are not user intent.
// TODO(jif) unify with structured schema
pub(crate) fn format_subagent_notification_message(
agent_reference: &str,
status: &AgentStatus,
) -> String {
let payload_json = serde_json::json!({
"agent_path": agent_reference,
"status": status,
})
.to_string();
SUBAGENT_NOTIFICATION_FRAGMENT.wrap(payload_json)
SubagentNotification::new(agent_reference, status.clone()).render()
}
pub(crate) fn format_subagent_context_line(