Skip to content

Commit ad1d48f

Browse files
authored
Merge pull request #426 from CortexLM/feature/update-all-dependencies
feat: update all cargo dependencies to latest versions
2 parents 8a1b81f + 6bfa1ee commit ad1d48f

16 files changed

Lines changed: 306 additions & 172 deletions

File tree

Cargo.lock

Lines changed: 221 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ simd-json = "0.14"
134134
toml = "0.8"
135135

136136
# HTTP client
137-
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls", "cookies"], default-features = false }
137+
reqwest = { version = "0.13", features = ["json", "stream", "rustls", "cookies", "form", "multipart", "query"], default-features = false }
138138

139139
# Error handling
140140
thiserror = "2.0"
@@ -143,10 +143,10 @@ anyhow = "1.0"
143143
# Tracing & Observability
144144
tracing = "0.1"
145145
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
146-
tracing-opentelemetry = "0.28"
147-
opentelemetry = "0.27"
148-
opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] }
149-
opentelemetry-otlp = { version = "0.27", features = ["tonic"] }
146+
tracing-opentelemetry = "0.31"
147+
opentelemetry = "0.31"
148+
opentelemetry_sdk = { version = "0.31", features = ["rt-tokio"] }
149+
opentelemetry-otlp = { version = "0.31", features = ["tonic"] }
150150

151151
# Utilities
152152
uuid = { version = "1.16", features = ["v4", "serde"] }
@@ -277,10 +277,10 @@ tracing-appender = "0.2"
277277
log = "0.4"
278278

279279
# CLI - Parsing
280-
pulldown-cmark = "0.10"
281-
tree-sitter = "0.25"
280+
pulldown-cmark = "0.13"
281+
tree-sitter = "0.26"
282282
tree-sitter-bash = "0.25"
283-
tree-sitter-highlight = "0.25"
283+
tree-sitter-highlight = "0.26"
284284
regex-lite = "0.1"
285285

286286
# CLI - Sandbox & Security (Linux)
@@ -354,8 +354,8 @@ tokio-test = "0.4"
354354
wiremock = "0.6"
355355

356356
# CLI - OpenTelemetry
357-
opentelemetry-semantic-conventions = "0.30"
358-
opentelemetry-appender-tracing = "0.30"
357+
opentelemetry-semantic-conventions = "0.31"
358+
opentelemetry-appender-tracing = "0.31"
359359

360360
# CLI - TypeScript bindings
361361
ts-rs = { version = "11", features = ["uuid-impl", "serde-json-impl", "no-serde-warnings"] }

cortex-agents/src/background/events.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ use serde::{Deserialize, Serialize};
77
use std::time::{Duration, Instant};
88

99
/// Status of a background agent.
10-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
10+
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
1111
pub enum AgentStatus {
1212
/// Agent is being initialized.
13+
#[default]
1314
Initializing,
1415
/// Agent is currently running.
1516
Running,
@@ -23,12 +24,6 @@ pub enum AgentStatus {
2324
TimedOut,
2425
}
2526

26-
impl Default for AgentStatus {
27-
fn default() -> Self {
28-
AgentStatus::Initializing
29-
}
30-
}
31-
3227
impl std::fmt::Display for AgentStatus {
3328
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3429
match self {

cortex-agents/src/background/executor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ pub struct BackgroundAgent {
149149
/// Tokio task handle.
150150
handle: JoinHandle<AgentResult>,
151151
/// Status receiver for updates.
152+
#[allow(dead_code)]
152153
status_rx: mpsc::Receiver<AgentStatus>,
153154
/// Cancel signal sender.
154155
cancel_tx: Option<oneshot::Sender<()>>,

cortex-agents/src/background/messaging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl AgentMailbox {
281281
/// Returns true if there are pending messages.
282282
pub fn has_messages(&mut self) -> bool {
283283
// Try to peek without consuming
284-
matches!(self.inbox.try_recv(), Ok(_))
284+
self.inbox.try_recv().is_ok()
285285
}
286286
}
287287

cortex-agents/src/collab/close.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub async fn handle(
115115
control
116116
.shutdown_agent(agent_id)
117117
.await
118-
.map_err(|e| CollabError::ControlError(e))?;
118+
.map_err(CollabError::ControlError)?;
119119

120120
// Log the closure
121121
tracing::info!(

cortex-agents/src/collab/spawn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub async fn handle(
146146
control
147147
.set_status(agent_id, AgentThreadStatus::Running)
148148
.await
149-
.map_err(|e| CollabError::ControlError(e))?;
149+
.map_err(CollabError::ControlError)?;
150150

151151
// Log spawn (without sensitive content)
152152
tracing::info!(

cortex-agents/src/routing.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::collections::HashSet;
2424
use std::path::PathBuf;
2525

2626
/// Mode for dispatching tasks to agents.
27-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
27+
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
2828
pub enum DispatchMode {
2929
/// Run tasks in parallel.
3030
/// Best for: 3+ unrelated tasks, no shared state, read-only operations.
@@ -40,15 +40,10 @@ pub enum DispatchMode {
4040

4141
/// Run as a single task.
4242
/// Best for: Single task or tightly coupled operations.
43+
#[default]
4344
Single,
4445
}
4546

46-
impl Default for DispatchMode {
47-
fn default() -> Self {
48-
DispatchMode::Single
49-
}
50-
}
51-
5247
impl std::fmt::Display for DispatchMode {
5348
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5449
match self {

cortex-agents/src/spec/approval.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
88
use tokio::sync::oneshot;
99

1010
/// Decision made by the user on a spec plan.
11-
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11+
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
1212
#[serde(rename_all = "snake_case")]
1313
pub enum ApprovalDecision {
1414
/// Plan approved as-is
@@ -18,6 +18,7 @@ pub enum ApprovalDecision {
1818
/// Plan rejected with reason
1919
Rejected(String),
2020
/// Decision deferred (user wants to think about it)
21+
#[default]
2122
Deferred,
2223
}
2324

@@ -43,12 +44,6 @@ impl ApprovalDecision {
4344
}
4445
}
4546

46-
impl Default for ApprovalDecision {
47-
fn default() -> Self {
48-
ApprovalDecision::Deferred
49-
}
50-
}
51-
5247
/// A request for user approval of a spec plan.
5348
pub struct ApprovalRequest {
5449
/// The plan awaiting approval

cortex-apply-patch/src/parser.rs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn parse_unified_diff(patch: &str) -> PatchResult<Vec<FileChange>> {
8484
let line = lines[i];
8585

8686
// Detect file header: --- path
87-
if line.starts_with("--- ") {
87+
if let Some(old_str) = line.strip_prefix("--- ") {
8888
// Save previous file change if exists
8989
if let Some(mut change) = current_change.take() {
9090
if let Some(hunk) = current_hunk.take() {
@@ -95,18 +95,19 @@ pub fn parse_unified_diff(patch: &str) -> PatchResult<Vec<FileChange>> {
9595
}
9696
}
9797

98-
let old_path = parse_file_path(&line[4..]);
98+
let old_path = parse_file_path(old_str);
9999

100100
// Look for +++ line
101-
if i + 1 < lines.len() && lines[i + 1].starts_with("+++ ") {
102-
let new_path = parse_file_path(&lines[i + 1][4..]);
103-
current_change = Some(FileChange::new(old_path, new_path));
104-
i += 2;
105-
continue;
106-
} else {
107-
// Malformed patch, but try to continue
108-
current_change = Some(FileChange::new(old_path, None));
101+
if i + 1 < lines.len() {
102+
if let Some(new_str) = lines[i + 1].strip_prefix("+++ ") {
103+
let new_path = parse_file_path(new_str);
104+
current_change = Some(FileChange::new(old_path, new_path));
105+
i += 2;
106+
continue;
107+
}
109108
}
109+
// Malformed patch, but try to continue
110+
current_change = Some(FileChange::new(old_path, None));
110111
i += 1;
111112
continue;
112113
}
@@ -201,37 +202,37 @@ pub fn parse_git_diff(patch: &str) -> PatchResult<Vec<FileChange>> {
201202

202203
// Handle git-specific metadata
203204
if let Some(ref mut change) = current_change {
204-
if line.starts_with("old mode ") {
205-
change.old_mode = Some(line[9..].to_string());
205+
if let Some(mode) = line.strip_prefix("old mode ") {
206+
change.old_mode = Some(mode.to_string());
206207
i += 1;
207208
continue;
208209
}
209-
if line.starts_with("new mode ") {
210-
change.new_mode = Some(line[9..].to_string());
210+
if let Some(mode) = line.strip_prefix("new mode ") {
211+
change.new_mode = Some(mode.to_string());
211212
i += 1;
212213
continue;
213214
}
214-
if line.starts_with("new file mode ") {
215+
if let Some(mode) = line.strip_prefix("new file mode ") {
215216
change.is_new_file = true;
216-
change.new_mode = Some(line[14..].to_string());
217+
change.new_mode = Some(mode.to_string());
217218
i += 1;
218219
continue;
219220
}
220-
if line.starts_with("deleted file mode ") {
221+
if let Some(mode) = line.strip_prefix("deleted file mode ") {
221222
change.is_deleted = true;
222-
change.old_mode = Some(line[18..].to_string());
223+
change.old_mode = Some(mode.to_string());
223224
i += 1;
224225
continue;
225226
}
226-
if line.starts_with("rename from ") {
227+
if let Some(path) = line.strip_prefix("rename from ") {
227228
change.is_rename = true;
228-
change.old_path = Some(PathBuf::from(&line[12..]));
229+
change.old_path = Some(PathBuf::from(path));
229230
i += 1;
230231
continue;
231232
}
232-
if line.starts_with("rename to ") {
233+
if let Some(path) = line.strip_prefix("rename to ") {
233234
change.is_rename = true;
234-
change.new_path = Some(PathBuf::from(&line[10..]));
235+
change.new_path = Some(PathBuf::from(path));
235236
i += 1;
236237
continue;
237238
}
@@ -251,9 +252,9 @@ pub fn parse_git_diff(patch: &str) -> PatchResult<Vec<FileChange>> {
251252
}
252253

253254
// Standard unified diff parts
254-
if line.starts_with("--- ") {
255+
if let Some(path_str) = line.strip_prefix("--- ") {
255256
if let Some(ref mut change) = current_change {
256-
let old_path = parse_file_path(&line[4..]);
257+
let old_path = parse_file_path(path_str);
257258
if old_path
258259
.as_ref()
259260
.is_some_and(|p| p.as_os_str() == "/dev/null")
@@ -268,9 +269,9 @@ pub fn parse_git_diff(patch: &str) -> PatchResult<Vec<FileChange>> {
268269
continue;
269270
}
270271

271-
if line.starts_with("+++ ") {
272+
if let Some(path_str) = line.strip_prefix("+++ ") {
272273
if let Some(ref mut change) = current_change {
273-
let new_path = parse_file_path(&line[4..]);
274+
let new_path = parse_file_path(path_str);
274275
if new_path
275276
.as_ref()
276277
.is_some_and(|p| p.as_os_str() == "/dev/null")

0 commit comments

Comments
 (0)