Skip to content
Merged
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
45 changes: 29 additions & 16 deletions orbitdock-server/crates/cli/src/commands/review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ pub async fn run(action: &ReviewAction, rest: &RestClient, output: &Output) -> i
tag,
turn,
} => {
create(
create(CreateReviewArgs {
rest,
output,
session_id,
file,
*line,
*line_end,
line: *line,
line_end: *line_end,
body,
tag.as_ref(),
turn.as_deref(),
)
tag: tag.as_ref(),
turn: turn.as_deref(),
})
.await
}
ReviewAction::Update {
Expand Down Expand Up @@ -126,18 +126,31 @@ async fn list(rest: &RestClient, output: &Output, session_id: &str, turn: Option
}
}

#[allow(clippy::too_many_arguments)]
async fn create(
rest: &RestClient,
output: &Output,
session_id: &str,
file: &str,
struct CreateReviewArgs<'a> {
rest: &'a RestClient,
output: &'a Output,
session_id: &'a str,
file: &'a str,
line: u32,
line_end: Option<u32>,
body: &str,
tag: Option<&ReviewTagFilter>,
turn: Option<&str>,
) -> i32 {
body: &'a str,
tag: Option<&'a ReviewTagFilter>,
turn: Option<&'a str>,
}

async fn create(args: CreateReviewArgs<'_>) -> i32 {
let CreateReviewArgs {
rest,
output,
session_id,
file,
line,
line_end,
body,
tag,
turn,
} = args;

let tag_str = tag.map(ReviewTagFilter::as_str);

let req = CreateReviewCommentRequest {
Expand Down
51 changes: 31 additions & 20 deletions orbitdock-server/crates/cli/src/commands/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ pub async fn run(
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|_| ".".to_string()),
};
create(
create(CreateSessionArgs {
config,
output,
provider,
&resolved_cwd,
model.as_deref(),
permission_mode.as_ref(),
effort.as_ref(),
system_prompt.as_deref(),
)
provider_filter: provider,
cwd: &resolved_cwd,
model: model.as_deref(),
permission_mode: permission_mode.as_ref(),
effort: effort.as_ref(),
system_prompt: system_prompt.as_deref(),
})
.await
}
SessionAction::Send {
Expand Down Expand Up @@ -296,17 +296,29 @@ async fn get(rest: &RestClient, output: &Output, session_id: &str, messages: boo

// ── WS Commands ──────────────────────────────────────────────

#[allow(clippy::too_many_arguments)]
async fn create(
config: &ClientConfig,
output: &Output,
provider_filter: &ProviderFilter,
cwd: &str,
model: Option<&str>,
permission_mode: Option<&PermissionMode>,
effort: Option<&Effort>,
system_prompt: Option<&str>,
) -> i32 {
struct CreateSessionArgs<'a> {
config: &'a ClientConfig,
output: &'a Output,
provider_filter: &'a ProviderFilter,
cwd: &'a str,
model: Option<&'a str>,
permission_mode: Option<&'a PermissionMode>,
effort: Option<&'a Effort>,
system_prompt: Option<&'a str>,
}

async fn create(args: CreateSessionArgs<'_>) -> i32 {
let CreateSessionArgs {
config,
output,
provider_filter,
cwd,
model,
permission_mode,
effort,
system_prompt,
} = args;

let Some(mut ws) = ws_connect(config, output).await else {
return EXIT_CONNECTION_ERROR;
};
Expand Down Expand Up @@ -383,7 +395,6 @@ async fn create(
}
}

#[allow(clippy::too_many_arguments)]
async fn send_message(
config: &ClientConfig,
output: &Output,
Expand Down
1 change: 0 additions & 1 deletion orbitdock-server/crates/cli/src/dev_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,6 @@ fn open_selected_event_in_pager(
pager_result
}

#[allow(clippy::needless_return)]
fn copy_text_to_clipboard(text: &str) -> anyhow::Result<()> {
#[cfg(target_os = "macos")]
{
Expand Down
61 changes: 40 additions & 21 deletions orbitdock-server/crates/connector-claude/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,17 @@ fn make_tool_row(
let render_hints = tool_render_hints(kind);
let tool_display = Some(
orbitdock_protocol::conversation_contracts::compute_tool_display(
kind,
family,
status,
tool_name,
subtitle.as_deref(),
None,
None,
raw_input,
None,
orbitdock_protocol::conversation_contracts::ToolDisplayInput {
kind,
family,
status,
title: tool_name,
subtitle: subtitle.as_deref(),
summary: None,
duration_ms: None,
invocation_input: raw_input,
result_output: None,
},
),
);
ToolRow {
Expand Down Expand Up @@ -589,9 +591,25 @@ impl ClaudeConnector {
if allow_bypass_permissions {
args.push("--allow-dangerously-skip-permissions");
}
let allowed_joined = allowed_tools.join(",");

// When permission_mode is "acceptEdits", ensure edit tools are explicitly
// in the allowedTools list. The --permission-prompt-tool stdio flag routes
// ALL permission decisions through the control protocol, so the CLI's
// internal --permission-mode auto-accept logic may not fire. Passing them
// as --allowedTools guarantees the CLI pre-approves them.
let mut effective_allowed: Vec<String> = allowed_tools.to_vec();
if permission_mode == Some("acceptEdits") {
for tool in ["Edit", "Write", "NotebookEdit"] {
let tool_str = tool.to_string();
if !effective_allowed.contains(&tool_str) {
effective_allowed.push(tool_str);
}
}
}

let allowed_joined = effective_allowed.join(",");
let disallowed_joined = disallowed_tools.join(",");
if !allowed_tools.is_empty() {
if !effective_allowed.is_empty() {
args.extend(["--allowedTools", &allowed_joined]);
}
if !disallowed_tools.is_empty() {
Expand Down Expand Up @@ -2316,15 +2334,17 @@ impl ClaudeConnector {
};
tr.tool_display = Some(
orbitdock_protocol::conversation_contracts::compute_tool_display(
tr.kind,
tr.family,
tr.status,
&tr.title,
tr.subtitle.as_deref(),
tr.summary.as_deref(),
tr.duration_ms,
raw_input,
Some(&content),
orbitdock_protocol::conversation_contracts::ToolDisplayInput {
kind: tr.kind,
family: tr.family,
status: tr.status,
title: &tr.title,
subtitle: tr.subtitle.as_deref(),
summary: tr.summary.as_deref(),
duration_ms: tr.duration_ms,
invocation_input: raw_input,
result_output: Some(&content),
},
),
);
events.push(ConnectorEvent::ConversationRowUpdated {
Expand Down Expand Up @@ -2467,7 +2487,6 @@ impl ClaudeConnector {
}

/// Handle `result` messages — turn completed/aborted with usage.
#[allow(clippy::too_many_arguments)]
fn handle_result_message(
raw: &Value,
streaming_content: &mut String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use codex_protocol::protocol::{
use codex_protocol::request_permissions::RequestPermissionsEvent;
use orbitdock_connector_core::{ApprovalType, ConnectorEvent};
use orbitdock_protocol::conversation_contracts::{
compute_tool_display, ConversationRow, ConversationRowEntry, ToolRow,
compute_tool_display, ConversationRow, ConversationRowEntry, ToolDisplayInput, ToolRow,
};
use orbitdock_protocol::domain_events::{ToolFamily, ToolKind, ToolStatus};
use orbitdock_protocol::Provider;
Expand All @@ -30,17 +30,17 @@ fn with_display(mut row: ToolRow) -> ToolRow {
.as_ref()
.and_then(|v| v.get("output").and_then(|o| o.as_str()))
.map(String::from);
row.tool_display = Some(compute_tool_display(
row.kind,
row.family,
row.status,
&row.title,
row.subtitle.as_deref(),
row.summary.as_deref(),
row.duration_ms,
invocation_ref,
result_str.as_deref(),
));
row.tool_display = Some(compute_tool_display(ToolDisplayInput {
kind: row.kind,
family: row.family,
status: row.status,
title: &row.title,
subtitle: row.subtitle.as_deref(),
summary: row.summary.as_deref(),
duration_ms: row.duration_ms,
invocation_input: invocation_ref,
result_output: result_str.as_deref(),
}));
row
}

Expand Down
24 changes: 12 additions & 12 deletions orbitdock-server/crates/connector-codex/src/event_mapping/collab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use codex_protocol::protocol::{
};
use orbitdock_connector_core::ConnectorEvent;
use orbitdock_protocol::conversation_contracts::{
compute_tool_display, ConversationRow, ConversationRowEntry, ToolRow,
compute_tool_display, ConversationRow, ConversationRowEntry, ToolDisplayInput, ToolRow,
};
use orbitdock_protocol::domain_events::{ToolFamily, ToolKind, ToolStatus};
use orbitdock_protocol::Provider;
Expand All @@ -32,17 +32,17 @@ fn with_display(mut row: ToolRow) -> ToolRow {
.as_ref()
.and_then(|v| v.get("output").and_then(|o| o.as_str()))
.map(String::from);
row.tool_display = Some(compute_tool_display(
row.kind,
row.family,
row.status,
&row.title,
row.subtitle.as_deref(),
row.summary.as_deref(),
row.duration_ms,
invocation_ref,
result_str.as_deref(),
));
row.tool_display = Some(compute_tool_display(ToolDisplayInput {
kind: row.kind,
family: row.family,
status: row.status,
title: &row.title,
subtitle: row.subtitle.as_deref(),
summary: row.summary.as_deref(),
duration_ms: row.duration_ms,
invocation_input: invocation_ref,
result_output: result_str.as_deref(),
}));
row
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use orbitdock_connector_core::ConnectorEvent;
use orbitdock_protocol::conversation_contracts::{compute_tool_display, ConversationRow, ToolRow};
use orbitdock_protocol::conversation_contracts::{
compute_tool_display, ConversationRow, ToolDisplayInput, ToolRow,
};
use orbitdock_protocol::domain_events::{
GenericInvocationPayload, GenericResultPayload, ToolFamily, ToolInvocationPayload, ToolKind,
ToolResultPayload, ToolStatus,
Expand All @@ -19,17 +21,17 @@ fn with_display(mut row: ToolRow) -> ToolRow {
.ok()
.filter(|text| !text.trim().is_empty())
});
row.tool_display = Some(compute_tool_display(
row.kind,
row.family,
row.status,
&row.title,
row.subtitle.as_deref(),
row.summary.as_deref(),
row.duration_ms,
invocation_json.as_ref(),
result_text.as_deref(),
));
row.tool_display = Some(compute_tool_display(ToolDisplayInput {
kind: row.kind,
family: row.family,
status: row.status,
title: &row.title,
subtitle: row.subtitle.as_deref(),
summary: row.summary.as_deref(),
duration_ms: row.duration_ms,
invocation_input: invocation_json.as_ref(),
result_output: result_text.as_deref(),
}));
row
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use codex_protocol::protocol::{
use orbitdock_connector_core::ConnectorEvent;
use orbitdock_protocol::conversation_contracts::{
compute_tool_display, ConversationRow, ConversationRowEntry, HandoffRow, HookRow,
MessageRowContent, ToolRow,
MessageRowContent, ToolDisplayInput, ToolRow,
};
use orbitdock_protocol::domain_events::{
HandoffPayload, HookPayload, PlanStepPayload, PlanStepStatus, ToolFamily, ToolKind, ToolStatus,
Expand All @@ -41,17 +41,17 @@ fn with_display(mut row: ToolRow) -> ToolRow {
.as_ref()
.and_then(|v| v.get("output").and_then(|o| o.as_str()))
.map(String::from);
row.tool_display = Some(compute_tool_display(
row.kind,
row.family,
row.status,
&row.title,
row.subtitle.as_deref(),
row.summary.as_deref(),
row.duration_ms,
invocation_ref,
result_str.as_deref(),
));
row.tool_display = Some(compute_tool_display(ToolDisplayInput {
kind: row.kind,
family: row.family,
status: row.status,
title: &row.title,
subtitle: row.subtitle.as_deref(),
summary: row.summary.as_deref(),
duration_ms: row.duration_ms,
invocation_input: invocation_ref,
result_output: result_str.as_deref(),
}));
row
}

Expand Down
Loading
Loading