Skip to content

Commit 20d6d2f

Browse files
echobtfactorydroid
andauthored
refactor: remove emojis from error messages and logs (#300)
- Replace emoji icons with text-based equivalents: - Success: ✓ -> [OK] - Error: ✗/❌ -> [ERROR] - Warning: ⚠️ -> [WARN] - Info: ℹ️ -> [INFO] - Robot: 🤖 -> removed or replaced with text - Lock: 🔐/🔒 -> removed - Globe: 🌐 -> removed - Keep colors for different message types (error=red, warning=amber, info=blue) - Update screenshot examples and documentation - Update tests to match new icon format Note: Emojis in test files for Unicode/grapheme handling are intentionally kept as they test Unicode character support, not error message display. Co-authored-by: Droid Agent <droid@factory.ai>
1 parent f9ccb0e commit 20d6d2f

File tree

18 files changed

+78
-78
lines changed

18 files changed

+78
-78
lines changed

cortex-cli/src/agent_cmd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ async fn run_create(args: CreateArgs) -> Result<()> {
10101010
}
10111011
}
10121012

1013-
println!("🤖 Cortex Agent Creator");
1013+
println!("Cortex Agent Creator");
10141014
println!("{}", "=".repeat(40));
10151015
println!();
10161016

@@ -1348,7 +1348,7 @@ async fn run_generate(args: CreateArgs) -> Result<()> {
13481348
}
13491349
}
13501350

1351-
println!("🤖 Cortex AI Agent Generator");
1351+
println!("Cortex AI Agent Generator");
13521352
println!("{}", "=".repeat(40));
13531353
println!();
13541354

cortex-cli/src/github_cmd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async fn run_github_agent(args: RunArgs) -> Result<()> {
220220
let event = parse_event(&args.event, &event_content)
221221
.with_context(|| format!("Failed to parse {} event", args.event))?;
222222

223-
println!("🤖 Cortex GitHub Agent");
223+
println!("Cortex GitHub Agent");
224224
println!("{}", "=".repeat(40));
225225
println!("Repository: {}", repository);
226226
println!("Event type: {}", args.event);
@@ -335,7 +335,7 @@ async fn handle_issue_comment(
335335
return Ok(());
336336
}
337337

338-
println!(" 🤖 Cortex command detected!");
338+
println!(" Cortex command detected!");
339339

340340
// Initialize GitHub client
341341
let client = GitHubClient::new(token, repository)?;
@@ -510,7 +510,7 @@ fn parse_cortex_command(text: &str) -> String {
510510

511511
/// Get help message for Cortex commands.
512512
fn get_help_message() -> String {
513-
r#"## 🤖 Cortex Commands
513+
r#"## Cortex Commands
514514
515515
| Command | Description |
516516
|---------|-------------|

cortex-cli/src/styled_output.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ impl MessageType {
133133
/// Get the icon for this message type.
134134
fn icon(&self) -> &'static str {
135135
match self {
136-
MessageType::Success => "",
137-
MessageType::Error => "",
138-
MessageType::Warning => "",
139-
MessageType::Info => "",
140-
MessageType::Dim => "·",
136+
MessageType::Success => "[OK]",
137+
MessageType::Error => "[ERROR]",
138+
MessageType::Warning => "[WARN]",
139+
MessageType::Info => "[INFO]",
140+
MessageType::Dim => "-",
141141
}
142142
}
143143

@@ -230,7 +230,7 @@ pub fn print_error(message: &str) {
230230
/// # Example
231231
/// ```
232232
/// print_warning("Configuration file not found, using defaults");
233-
/// // Output: Configuration file not found, using defaults (in amber)
233+
/// // Output: [WARN] Configuration file not found, using defaults (in amber)
234234
/// ```
235235
pub fn print_warning(message: &str) {
236236
print_styled_internal(MessageType::Warning, message, true, false);
@@ -244,7 +244,7 @@ pub fn print_warning(message: &str) {
244244
/// # Example
245245
/// ```
246246
/// print_info("Processing 42 files...");
247-
/// // Output: Processing 42 files... (in blue)
247+
/// // Output: [INFO] Processing 42 files... (in blue)
248248
/// ```
249249
pub fn print_info(message: &str) {
250250
print_styled_internal(MessageType::Info, message, true, false);
@@ -379,19 +379,19 @@ mod tests {
379379

380380
#[test]
381381
fn test_message_type_icons() {
382-
assert_eq!(MessageType::Success.icon(), "");
383-
assert_eq!(MessageType::Error.icon(), "");
384-
assert_eq!(MessageType::Warning.icon(), "");
385-
assert_eq!(MessageType::Info.icon(), "");
386-
assert_eq!(MessageType::Dim.icon(), "·");
382+
assert_eq!(MessageType::Success.icon(), "[OK]");
383+
assert_eq!(MessageType::Error.icon(), "[ERROR]");
384+
assert_eq!(MessageType::Warning.icon(), "[WARN]");
385+
assert_eq!(MessageType::Info.icon(), "[INFO]");
386+
assert_eq!(MessageType::Dim.icon(), "-");
387387
}
388388

389389
#[test]
390390
fn test_format_styled_no_color() {
391391
// When colors are disabled, should just return icon + message
392392
std::env::set_var("NO_COLOR", "1");
393393
let result = format_styled(MessageType::Success, "test message");
394-
assert!(result.contains(""));
394+
assert!(result.contains("[OK]"));
395395
assert!(result.contains("test message"));
396396
std::env::remove_var("NO_COLOR");
397397
}

cortex-commands/src/builtin/agents_cmd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl AgentsCommand {
260260
let mut output = String::new();
261261

262262
// Built-in agents
263-
output.push_str("🤖 Built-in Agents:\n");
263+
output.push_str("Built-in Agents:\n");
264264
for agent in &result.builtin_agents {
265265
let suffix = if agent.is_subagent { " (subagent)" } else { "" };
266266
output.push_str(&format!(
@@ -296,7 +296,7 @@ impl AgentsCommand {
296296
}
297297

298298
if result.has_global_agents {
299-
output.push_str("🌐 Global Agents:\n");
299+
output.push_str("Global Agents:\n");
300300
for agent in result.agents.iter().filter(|d| !d.is_project_local) {
301301
output.push_str(&format!(
302302
" @{:<16} {} ({})\n",

cortex-commands/src/builtin/commands_cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl CommandsCommand {
186186
}
187187

188188
if result.has_global_commands {
189-
output.push_str("🌐 Global Commands:\n");
189+
output.push_str("Global Commands:\n");
190190
for cmd in result.commands.iter().filter(|c| !c.is_project_local) {
191191
output.push_str(&format!(" /{:<16} {}\n", cmd.name, cmd.description));
192192
}

cortex-engine/src/health.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ impl HealthStatus {
4949
}
5050
}
5151

52-
/// Get status emoji.
52+
/// Get status symbol (text-based, no emoji).
5353
pub fn emoji(&self) -> &'static str {
5454
match self {
55-
Self::Healthy => "",
56-
Self::Degraded => "",
57-
Self::Unhealthy => "",
58-
Self::Unknown => "?",
55+
Self::Healthy => "[OK]",
56+
Self::Degraded => "[WARN]",
57+
Self::Unhealthy => "[ERROR]",
58+
Self::Unknown => "[?]",
5959
}
6060
}
6161
}

cortex-engine/src/output.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl ResultFormatter {
576576
/// Format a success result.
577577
pub fn success(&self, message: &str) -> String {
578578
if self.show_success {
579-
format!(" {message}")
579+
format!("[OK] {message}")
580580
} else {
581581
String::new()
582582
}
@@ -585,20 +585,20 @@ impl ResultFormatter {
585585
/// Format an error result.
586586
pub fn error(&self, message: &str) -> String {
587587
if self.show_errors {
588-
format!(" {message}")
588+
format!("[ERROR] {message}")
589589
} else {
590590
String::new()
591591
}
592592
}
593593

594594
/// Format a warning.
595595
pub fn warning(&self, message: &str) -> String {
596-
format!(" {message}")
596+
format!("[WARN] {message}")
597597
}
598598

599599
/// Format info.
600600
pub fn info(&self, message: &str) -> String {
601-
format!(" {message}")
601+
format!("[INFO] {message}")
602602
}
603603
}
604604

@@ -672,9 +672,9 @@ mod tests {
672672
fn test_result_formatter() {
673673
let formatter = ResultFormatter::new();
674674

675-
assert!(formatter.success("Done").contains(""));
676-
assert!(formatter.error("Failed").contains(""));
677-
assert!(formatter.warning("Warn").contains(""));
675+
assert!(formatter.success("Done").contains("[OK]"));
676+
assert!(formatter.error("Failed").contains("[ERROR]"));
677+
assert!(formatter.warning("Warn").contains("[WARN]"));
678678
}
679679

680680
#[test]

cortex-engine/src/permission/prompts.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,19 @@ impl PermissionPrompt {
145145
let mut output = String::new();
146146

147147
// Header
148-
output.push_str(&format!("🔐 Permission Request\n"));
149-
output.push_str(&format!("─────────────────────\n"));
148+
output.push_str("Permission Request\n");
149+
output.push_str("─────────────────────\n");
150150

151151
// Tool and action
152152
output.push_str(&format!("Tool: {}\n", self.tool));
153153
output.push_str(&format!("Action: {}\n", self.action));
154154

155155
// Risk level with color hint
156156
let risk_str = match self.context.risk_level {
157-
RiskLevel::Low => "Low",
158-
RiskLevel::Medium => "Medium",
159-
RiskLevel::High => "High ⚠⚠",
160-
RiskLevel::Critical => "Critical",
157+
RiskLevel::Low => "Low",
158+
RiskLevel::Medium => "Medium",
159+
RiskLevel::High => "High",
160+
RiskLevel::Critical => "Critical",
161161
};
162162
output.push_str(&format!("Risk: {}\n", risk_str));
163163

cortex-engine/src/safety.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,10 @@ pub fn requires_approval(analysis: &SafetyAnalysis, policy: &AskForApproval) ->
352352
/// Format a safety analysis for display.
353353
pub fn format_analysis(analysis: &SafetyAnalysis) -> String {
354354
let risk_indicator = match analysis.risk_level {
355-
RiskLevel::Safe => " Safe",
356-
RiskLevel::Medium => " Medium Risk",
357-
RiskLevel::High => " High Risk",
358-
RiskLevel::Critical => " Critical Risk",
355+
RiskLevel::Safe => "[OK] Safe",
356+
RiskLevel::Medium => "[WARN] Medium Risk",
357+
RiskLevel::High => "[WARN] High Risk",
358+
RiskLevel::Critical => "[CRITICAL] Critical Risk",
359359
};
360360

361361
let mut output = format!("{}: {}", risk_indicator, analysis.reason);

cortex-engine/src/tools/artifacts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ fn create_truncated_output(lines: &[&str], max_lines: usize, artifact_path: &Pat
181181

182182
format!(
183183
"{}\n\n[... {} more lines omitted ...]\n\n\
184-
📄 Full output saved to: {}\n\
185-
💡 Use Read tool to view the full artifact if needed.",
184+
Full output saved to: {}\n\
185+
[TIP] Use Read tool to view the full artifact if needed.",
186186
shown_text,
187187
omitted,
188188
artifact_path.display()

0 commit comments

Comments
 (0)