diff --git a/codex-rs/core/src/context/contextual_user_message_tests.rs b/codex-rs/core/src/context/contextual_user_message_tests.rs
index dc7cb0f534..c3f360772a 100644
--- a/codex-rs/core/src/context/contextual_user_message_tests.rs
+++ b/codex-rs/core/src/context/contextual_user_message_tests.rs
@@ -33,14 +33,14 @@ fn detects_subagent_notification_fragment_case_insensitively() {
#[test]
fn detects_internal_model_context_fragment() {
let text = InternalModelContextFragment::new(
- InternalContextSource::from_static("goal"),
- "Continue working toward the active thread goal.",
+ InternalContextSource::from_static("extension"),
+ "Internal steering.",
)
.render();
assert_eq!(
text,
- "\nContinue working toward the active thread goal.\n"
+ "\nInternal steering.\n"
);
assert!(is_contextual_user_fragment(&ContentItem::InputText {
text
@@ -65,7 +65,7 @@ fn does_not_hide_arbitrary_context_tags() {
#[test]
fn rejects_invalid_internal_model_context_source() {
assert!(!is_contextual_user_fragment(&ContentItem::InputText {
- text: "\nbody\n"
+ text: "\nbody\n"
.to_string(),
}));
}
@@ -73,13 +73,13 @@ fn rejects_invalid_internal_model_context_source() {
#[test]
fn contextual_user_fragment_is_dyn_compatible() {
let fragment: Box = Box::new(InternalModelContextFragment::new(
- InternalContextSource::from_static("goal"),
- "Continue working toward the active thread goal.",
+ InternalContextSource::from_static("extension"),
+ "Internal steering.",
));
assert_eq!(
fragment.render(),
- "\nContinue working toward the active thread goal.\n"
+ "\nInternal steering.\n"
);
}
diff --git a/codex-rs/core/src/event_mapping_tests.rs b/codex-rs/core/src/event_mapping_tests.rs
index 4cf1b72d5d..5f2ed66830 100644
--- a/codex-rs/core/src/event_mapping_tests.rs
+++ b/codex-rs/core/src/event_mapping_tests.rs
@@ -324,8 +324,8 @@ fn internal_model_context_does_not_parse_as_visible_turn_item() {
role: "user".to_string(),
content: vec![ContentItem::InputText {
text: InternalModelContextFragment::new(
- InternalContextSource::from_static("goal"),
- "Continue working toward the active thread goal.",
+ InternalContextSource::from_static("extension"),
+ "Internal steering.",
)
.render(),
}],
diff --git a/codex-rs/core/src/goals.rs b/codex-rs/core/src/goals.rs
deleted file mode 100644
index 6e0663655c..0000000000
--- a/codex-rs/core/src/goals.rs
+++ /dev/null
@@ -1,1622 +0,0 @@
-//! Core support for persisted thread goals.
-//!
-//! This module bridges core sessions and the state-db goal table. It validates
-//! goal mutations, converts between state and protocol shapes, emits goal-update
-//! events, and owns helper hooks used by goal lifecycle behavior.
-
-use crate::StateDbHandle;
-use crate::context::ContextualUserFragment;
-use crate::context::InternalContextSource;
-use crate::context::InternalModelContextFragment;
-use crate::session::TurnInput;
-use crate::session::session::Session;
-use crate::session::turn_context::TurnContext;
-use crate::state::ActiveTurn;
-use crate::state::TurnState;
-use crate::tasks::RegularTask;
-use crate::tools::handlers::goal_spec::UPDATE_GOAL_TOOL_NAME;
-use anyhow::Context;
-use codex_features::Feature;
-use codex_otel::GOAL_BLOCKED_METRIC;
-use codex_otel::GOAL_BUDGET_LIMITED_METRIC;
-use codex_otel::GOAL_COMPLETED_METRIC;
-use codex_otel::GOAL_CREATED_METRIC;
-use codex_otel::GOAL_DURATION_SECONDS_METRIC;
-use codex_otel::GOAL_RESUMED_METRIC;
-use codex_otel::GOAL_TOKEN_COUNT_METRIC;
-use codex_otel::GOAL_USAGE_LIMITED_METRIC;
-use codex_prompts::budget_limit_prompt;
-use codex_prompts::continuation_prompt;
-use codex_prompts::objective_updated_prompt;
-use codex_protocol::ThreadId;
-use codex_protocol::config_types::ModeKind;
-use codex_protocol::models::ResponseItem;
-use codex_protocol::protocol::EventMsg;
-use codex_protocol::protocol::ThreadGoal;
-use codex_protocol::protocol::ThreadGoalStatus;
-use codex_protocol::protocol::ThreadGoalUpdatedEvent;
-use codex_protocol::protocol::TokenUsage;
-use codex_protocol::protocol::validate_thread_goal_objective;
-use codex_rollout::state_db::reconcile_rollout;
-use codex_thread_store::LocalThreadStore;
-use futures::future::BoxFuture;
-use std::sync::Arc;
-use std::time::Duration;
-use std::time::Instant;
-use tokio::sync::Mutex;
-use tokio::sync::Semaphore;
-use tokio::sync::SemaphorePermit;
-
-pub(crate) struct SetGoalRequest {
- pub(crate) objective: Option,
- pub(crate) status: Option,
- pub(crate) token_budget: Option