Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/maple-agent/app/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1550,13 +1550,11 @@ impl AgentBackend {
Some(AgentStartRequest {
project_root: None,
model,
mode,
}) => {
let config = handle.load_config().await?;
Some(AgentStartRequest {
project_root: gui_start_root(&config),
model,
mode,
})
}
other => other,
Expand Down Expand Up @@ -2332,7 +2330,6 @@ impl AgentBackend {
AgentStartRequest {
project_root: None,
model: std::env::var("MAPLE_MODEL").ok(),
mode: None,
}
}

Expand Down
5 changes: 0 additions & 5 deletions apps/maple-agent/app/src/ui/chat/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,6 @@ impl ChatScreen {
title: None,
model: self.selected_model.clone(),
context_limit: None,
mode: None,
// The draft's switches decide which servers start with the
// task; the runtime reads curated MCP integrations (CUA) from
// this list too. External agents are not servers and are
Expand Down Expand Up @@ -3943,7 +3942,6 @@ impl ChatScreen {
text: text.clone(),
model,
context_limit: None,
mode: None,
vision_capable,
steer: steer && run_active,
queue_id,
Expand Down Expand Up @@ -4751,9 +4749,6 @@ impl ChatScreen {
return false;
}
}
// The runtime no longer asks for tool permissions; the variant
// stays declared until the API drops it.
AgentRunEvent::PermissionRequested { .. } => {}
AgentRunEvent::SubagentStarted {
id,
task,
Expand Down
1 change: 0 additions & 1 deletion apps/maple-agent/app/src/ui/chat/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,6 @@ pub(super) fn session_summary_eq(a: &AgentSessionSummary, b: &AgentSessionSummar
&& a.updated_ms == b.updated_ms
&& a.message_count == b.message_count
&& a.model == b.model
&& a.mode == b.mode
&& a.web_enabled == b.web_enabled
&& a.state == b.state
}
Expand Down
8 changes: 0 additions & 8 deletions apps/maple-agent/app/src/ui/chat/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ mod state_tests {
updated_ms: 0,
message_count: 1,
model: None,
mode: "smart_approve".to_string(),
}
}

Expand Down Expand Up @@ -1835,7 +1834,6 @@ mod state_tests {
},
]);
let request = this.new_session_request().expect("draft request");
assert!(request.mode.is_none());
assert_eq!(request.mcp_server_names, Some(vec!["docs".to_string()]));
this.send_text("hello".to_string(), cx);
assert!(this.session_setup_pending);
Expand Down Expand Up @@ -3053,7 +3051,6 @@ mod state_tests {
running: true,
project_root: None,
model: None,
mode: None,
active_runs: HashMap::new(),
};
assert!(
Expand Down Expand Up @@ -4544,10 +4541,6 @@ mod state_tests {
this.project_root = Some("/work/beta".to_string());
let request = this.new_session_request().expect("explicit root request");
assert_eq!(request.project_root.as_deref(), Some("/work/beta"));
assert!(
request.mode.is_none(),
"a new task names no permission mode"
);
});
}

Expand Down Expand Up @@ -4703,7 +4696,6 @@ mod state_tests {
running: true,
project_root: Some("/work/alpha".to_string()),
model: None,
mode: None,
active_runs: HashMap::from([("s2".to_string(), "run-2".to_string())]),
}),
cx,
Expand Down
31 changes: 9 additions & 22 deletions apps/maple-agent/crates/maple-agent/src/acp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ impl AcpConnectionContext {
),
model: Some(model.clone()),
context_limit: None,
mode: None,
mcp_server_names: None,
system_prompt: caller.system_prompt,
}),
Expand Down Expand Up @@ -1307,7 +1306,6 @@ impl AcpConnectionContext {
text: prompt,
model: Some(model.clone()),
context_limit: None,
mode: None,
vision_capable,
steer: false,
queue_id: None,
Expand Down Expand Up @@ -1514,9 +1512,6 @@ impl AcpConnectionContext {
}
}
}
// The runtime no longer asks for tool permissions; the
// variant stays declared until the API drops it.
Some(AgentRunEvent::PermissionRequested { .. }) => {}
Some(AgentRunEvent::Error(item)) => {
if let Some(message) = event_error_text(&item) {
match self
Expand Down Expand Up @@ -2071,9 +2066,9 @@ mod tests {
/// `initialize` answers, `session/new` returns the mode list AND the model
/// list, and the task it persists is loadable by a later connection.
/// `session/new` and `session/load` advertise no modes and offer the
/// model selector only; a persisted task loads whatever mode it was saved
/// in. Regression shape: a gate on the persisted mode turned `session/load`
/// into an error and the editor lost the model list entirely.
/// model selector only. Regression shape: a gate on the persisted mode
/// turned `session/load` into an error and the editor lost the model list
/// entirely.
#[tokio::test]
async fn session_new_and_load_advertise_no_modes() {
let agent = started_agent_runtime("acp-stdio").await;
Expand Down Expand Up @@ -2153,16 +2148,14 @@ mod tests {

// A persisted task must be loadable by a later connection. The ACP
// task above stays hidden from listing until its first prompt, so load
// a desktop task instead, one saved in a mode older builds used to
// refuse. Every task runs with every tool call allowed.
// a desktop task instead.
let created = agent
.handle
.create_session(Some(crate::agent::AgentCreateSessionRequest {
project_root: Some(project_root.clone()),
title: Some("acp load target".to_string()),
model: None,
context_limit: None,
mode: Some("smart_approve".to_string()),
mcp_server_names: None,
system_prompt: None,
}))
Expand Down Expand Up @@ -2416,7 +2409,7 @@ mod tests {
assert!(canonical_session_id(&SessionId::new(" \n\t ")).is_err());
}

fn session_summary_with_mode(id: &str, mode: &str) -> AgentSessionSummary {
fn session_summary(id: &str) -> AgentSessionSummary {
AgentSessionSummary {
id: id.to_string(),
title: id.to_string(),
Expand All @@ -2425,24 +2418,18 @@ mod tests {
updated_ms: 1,
message_count: 0,
model: Some("model".to_string()),
mode: mode.to_string(),
web_enabled: false,
state: AgentTaskState::Active,
acp: false,
}
}

/// Every persisted task loads, whatever mode it was saved in; only a
/// missing task is refused.
/// Only a missing task is refused.
#[test]
fn session_load_preflight_accepts_every_saved_mode_and_rejects_missing_tasks() {
let sessions = [
session_summary_with_mode("ask-first", "smart_approve"),
session_summary_with_mode("allow-all", "auto"),
session_summary_with_mode("chat", "chat"),
];
fn session_load_preflight_rejects_missing_tasks() {
let sessions = [session_summary("one"), session_summary("two")];

for id in ["ask-first", "allow-all", "chat"] {
for id in ["one", "two"] {
assert_eq!(find_acp_session(&sessions, id).unwrap().id, id);
}
assert!(
Expand Down
Loading
Loading