mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
TUI: enforce core boundary (#17399)
Problem: The TUI still depended on `codex-core` directly in a number of places, and we had no enforcement from keeping this problem from getting worse. Solution: Route TUI core access through `codex-app-server-client::legacy_core`, add CI enforcement for that boundary, and re-export this legacy bridge inside the TUI as `crate::legacy_core` so the remaining call sites stay readable. There is no functional change in this PR — just changes to import targets. Over time, we can whittle away at the remaining symbols in this legacy namespace with the eventual goal of removing them all. In the meantime, this linter rule will prevent us from inadvertently importing new symbols from core.
This commit is contained in:
committed by
GitHub
Unverified
parent
37aac89a6d
commit
66e13efd9c
@@ -10,15 +10,15 @@ use crate::bottom_pane::SelectionViewParams;
|
||||
use crate::bottom_pane::SkillsToggleItem;
|
||||
use crate::bottom_pane::SkillsToggleView;
|
||||
use crate::bottom_pane::popup_consts::standard_popup_hint_line;
|
||||
use crate::legacy_core::TOOL_MENTION_SIGIL;
|
||||
use crate::legacy_core::connectors::connector_mention_slug;
|
||||
use crate::legacy_core::skills::model::SkillDependencies;
|
||||
use crate::legacy_core::skills::model::SkillInterface;
|
||||
use crate::legacy_core::skills::model::SkillMetadata;
|
||||
use crate::legacy_core::skills::model::SkillToolDependency;
|
||||
use crate::skills_helpers::skill_description;
|
||||
use crate::skills_helpers::skill_display_name;
|
||||
use codex_chatgpt::connectors::AppInfo;
|
||||
use codex_core::TOOL_MENTION_SIGIL;
|
||||
use codex_core::connectors::connector_mention_slug;
|
||||
use codex_core::skills::model::SkillDependencies;
|
||||
use codex_core::skills::model::SkillInterface;
|
||||
use codex_core::skills::model::SkillMetadata;
|
||||
use codex_core::skills::model::SkillToolDependency;
|
||||
use codex_protocol::parse_command::ParsedCommand;
|
||||
use codex_protocol::protocol::ListSkillsResponseEvent;
|
||||
use codex_protocol::protocol::SkillMetadata as ProtocolSkillMetadata;
|
||||
|
||||
@@ -14,6 +14,18 @@ pub(super) use crate::bottom_pane::LocalImageAttachment;
|
||||
pub(super) use crate::bottom_pane::MentionBinding;
|
||||
pub(super) use crate::chatwidget::realtime::RealtimeConversationPhase;
|
||||
pub(super) use crate::history_cell::UserHistoryCell;
|
||||
pub(super) use crate::legacy_core::config::Config;
|
||||
pub(super) use crate::legacy_core::config::ConfigBuilder;
|
||||
pub(super) use crate::legacy_core::config::Constrained;
|
||||
pub(super) use crate::legacy_core::config::ConstraintError;
|
||||
pub(super) use crate::legacy_core::config_loader::AppRequirementToml;
|
||||
pub(super) use crate::legacy_core::config_loader::AppsRequirementsToml;
|
||||
pub(super) use crate::legacy_core::config_loader::ConfigLayerStack;
|
||||
pub(super) use crate::legacy_core::config_loader::ConfigRequirements;
|
||||
pub(super) use crate::legacy_core::config_loader::ConfigRequirementsToml;
|
||||
pub(super) use crate::legacy_core::config_loader::RequirementSource;
|
||||
pub(super) use crate::legacy_core::plugins::OPENAI_CURATED_MARKETPLACE_NAME;
|
||||
pub(super) use crate::legacy_core::skills::model::SkillMetadata;
|
||||
pub(super) use crate::model_catalog::ModelCatalog;
|
||||
pub(super) use crate::test_backend::VT100Backend;
|
||||
pub(super) use crate::test_support::PathBufExt;
|
||||
@@ -85,18 +97,6 @@ pub(super) use codex_config::types::ApprovalsReviewer;
|
||||
pub(super) use codex_config::types::Notifications;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub(super) use codex_config::types::WindowsSandboxModeToml;
|
||||
pub(super) use codex_core::config::Config;
|
||||
pub(super) use codex_core::config::ConfigBuilder;
|
||||
pub(super) use codex_core::config::Constrained;
|
||||
pub(super) use codex_core::config::ConstraintError;
|
||||
pub(super) use codex_core::config_loader::AppRequirementToml;
|
||||
pub(super) use codex_core::config_loader::AppsRequirementsToml;
|
||||
pub(super) use codex_core::config_loader::ConfigLayerStack;
|
||||
pub(super) use codex_core::config_loader::ConfigRequirements;
|
||||
pub(super) use codex_core::config_loader::ConfigRequirementsToml;
|
||||
pub(super) use codex_core::config_loader::RequirementSource;
|
||||
pub(super) use codex_core::plugins::OPENAI_CURATED_MARKETPLACE_NAME;
|
||||
pub(super) use codex_core::skills::model::SkillMetadata;
|
||||
pub(super) use codex_features::FEATURES;
|
||||
pub(super) use codex_features::Feature;
|
||||
pub(super) use codex_git_utils::CommitLogEntry;
|
||||
|
||||
@@ -109,7 +109,7 @@ pub(super) fn snapshot(percent: f64) -> RateLimitSnapshot {
|
||||
}
|
||||
|
||||
pub(super) fn test_session_telemetry(config: &Config, model: &str) -> SessionTelemetry {
|
||||
let model_info = codex_core::test_support::construct_model_info_offline(model, config);
|
||||
let model_info = crate::legacy_core::test_support::construct_model_info_offline(model, config);
|
||||
SessionTelemetry::new(
|
||||
ThreadId::new(),
|
||||
model,
|
||||
@@ -131,7 +131,7 @@ pub(super) fn test_model_catalog(config: &Config) -> Arc<ModelCatalog> {
|
||||
.enabled(Feature::DefaultModeRequestUserInput),
|
||||
};
|
||||
Arc::new(ModelCatalog::new(
|
||||
codex_core::test_support::all_model_presets().clone(),
|
||||
crate::legacy_core::test_support::all_model_presets().clone(),
|
||||
collaboration_modes_config,
|
||||
))
|
||||
}
|
||||
@@ -148,9 +148,9 @@ pub(super) async fn make_chatwidget_manual(
|
||||
let app_event_tx = AppEventSender::new(tx_raw);
|
||||
let (op_tx, op_rx) = unbounded_channel::<Op>();
|
||||
let mut cfg = test_config().await;
|
||||
let resolved_model = model_override
|
||||
.map(str::to_owned)
|
||||
.unwrap_or_else(|| codex_core::test_support::get_model_offline(cfg.model.as_deref()));
|
||||
let resolved_model = model_override.map(str::to_owned).unwrap_or_else(|| {
|
||||
crate::legacy_core::test_support::get_model_offline(cfg.model.as_deref())
|
||||
});
|
||||
if let Some(model) = model_override {
|
||||
cfg.model = Some(model.to_string());
|
||||
}
|
||||
|
||||
@@ -956,7 +956,7 @@ async fn submit_user_message_emits_structured_plugin_mentions_from_bindings() {
|
||||
});
|
||||
chat.set_feature_enabled(Feature::Plugins, /*enabled*/ true);
|
||||
chat.bottom_pane.set_plugin_mentions(Some(vec![
|
||||
codex_core::plugins::PluginCapabilitySummary {
|
||||
crate::legacy_core::plugins::PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "Sample Plugin".to_string(),
|
||||
description: None,
|
||||
@@ -1232,7 +1232,7 @@ async fn collaboration_modes_defaults_to_code_on_startup() {
|
||||
.build()
|
||||
.await
|
||||
.expect("config");
|
||||
let resolved_model = codex_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let resolved_model = crate::legacy_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
config: cfg.clone(),
|
||||
|
||||
@@ -58,7 +58,7 @@ async fn experimental_mode_plan_is_ignored_on_startup() {
|
||||
.build()
|
||||
.await
|
||||
.expect("config");
|
||||
let resolved_model = codex_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let resolved_model = crate::legacy_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
config: cfg.clone(),
|
||||
|
||||
@@ -117,7 +117,7 @@ async fn helpers_are_available_and_do_not_panic() {
|
||||
let (tx_raw, _rx) = unbounded_channel::<AppEvent>();
|
||||
let tx = AppEventSender::new(tx_raw);
|
||||
let cfg = test_config().await;
|
||||
let resolved_model = codex_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let resolved_model = crate::legacy_core::test_support::get_model_offline(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
config: cfg.clone(),
|
||||
|
||||
Reference in New Issue
Block a user