Support Linux refactoring checks

This commit is contained in:
Hermes Agent
2026-07-29 10:21:56 +00:00
parent 36f1056cf7
commit 902037f947
9 changed files with 253 additions and 100 deletions

View File

@@ -293,7 +293,7 @@ fn sync_a2ui_message(
renderable_surface_updated
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", test))]
fn chat_turn(message: &ChatMessage) -> ChatTurn {
ChatTurn {
user: message.user,
@@ -368,7 +368,7 @@ fn project_agents(path: &Path) -> Result<Option<String>, String> {
}
}
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", test))]
fn title_context(messages: impl IntoIterator<Item = ChatTurn>) -> Vec<ChatTurn> {
let mut started = false;
messages
@@ -497,6 +497,8 @@ impl App {
#[cfg(target_os = "macos")]
let agents =
agents_prompt_for_turn(opening_turn, opening_agents, self.session_agents_prompt());
#[cfg(not(target_os = "macos"))]
let agents = None::<String>;
self.a2ui_auto_switch_pending = true;
self.context_notice = None;
#[cfg(target_os = "macos")]
@@ -535,6 +537,7 @@ impl App {
&effective.turn.system_prompt,
self.compaction_summary(),
);
#[cfg(target_os = "macos")]
let assistant_reasoning = effective.turn.reasoning_mode != ReasoningMode::Direct;
#[cfg(target_os = "macos")]
let model_prompt = if self.config.a2ui_enabled {
@@ -700,7 +703,6 @@ impl App {
{
let _ = effective;
self.error = Some("Local Metal generation requires macOS.".into());
return;
}
}

View File

@@ -1,4 +1,5 @@
use super::*;
use std::sync::RwLock;
#[derive(Clone)]
pub(super) struct PreferenceDraft {
@@ -437,6 +438,7 @@ impl App {
return;
}
}
#[cfg(target_os = "macos")]
let dev_brain_changed = self.config.dev_brain != config.dev_brain;
#[cfg(target_os = "macos")]
let endpoint_changed = self.config.endpoint != config.endpoint;
@@ -447,6 +449,7 @@ impl App {
{
self._endpoint = None;
}
#[cfg(target_os = "macos")]
let pending_endpoint =
if config.endpoint.enabled && (endpoint_changed || self._endpoint.is_none()) {
let Some(generation) = &self.generation_service else {