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
14 changes: 8 additions & 6 deletions crates/jcode-base/src/import_codex_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ pub(super) fn append_tool(session: &mut Session, value: &serde_json::Value) -> b
let Some(payload) = value.get("payload") else {
return false;
};
let kind = payload
.get("type")
.and_then(|v| v.as_str())
.unwrap_or_default();
let Some(kind) = payload.get("type").and_then(|v| v.as_str()) else {
return false;
};
let Some(id) = payload
.get("call_id")
.and_then(|v| v.as_str())
Expand All @@ -38,7 +37,7 @@ pub(super) fn append_tool(session: &mut Session, value: &serde_json::Value) -> b
None => serde_json::json!({}),
}
} else {
serde_json::json!({"input": payload.get("input").cloned().unwrap_or_default()})
serde_json::json!({"input": payload.get("input").cloned().unwrap_or(serde_json::Value::Null)})
};
(
Role::Assistant,
Expand All @@ -51,7 +50,10 @@ pub(super) fn append_tool(session: &mut Session, value: &serde_json::Value) -> b
)
}
"function_call_output" | "custom_tool_call_output" => {
let output = payload.get("output").cloned().unwrap_or_default();
let output = payload
.get("output")
.cloned()
.unwrap_or(serde_json::Value::Null);
(
Role::User,
ContentBlock::ToolResult {
Expand Down
9 changes: 3 additions & 6 deletions src/cli/acp/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ pub(super) struct DaemonSession {
pub(super) socket_path: Option<PathBuf>,
/// Shared with the router, which builds steer recovery requests itself.
pub(super) next_request_id: Arc<AtomicU64>,
/// Client instance id of this logical attachment: `{process}/{n}`. Socket
/// replacement retains ownership; separate sessions
/// in one adapter process must not look like each other's peer, so the
/// per-process id is not enough.
/// Logical attachment id: `{process}/{n}`. Socket replacement retains ownership;
/// separate sessions in one adapter process must not appear as each other's peer.
pub(super) instance_id: String,
/// Event routing state, shared with this connection's reader task. The
/// reader owns clones of the shared state, never the session itself, so
Expand All @@ -27,8 +25,7 @@ pub(super) struct DaemonSession {
pub(super) prompt_tasks_done: tokio::sync::Notify,
pub(super) catalog_refresh: Mutex<()>,
pub(super) ui_state: Arc<Mutex<SessionUiState>>,
/// Workspace root reported by the ACP client, used to compose the
/// project-local skill overlay for slash-skill resolution.
/// ACP workspace root for the project-local slash-skill overlay.
pub(super) working_dir: Option<PathBuf>,
/// Sticky skill selection, resent with every prompt. The daemon treats a
/// missing `active_skill` as "clear the selection", mirroring the TUI.
Expand Down
Loading