mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-08 09:04:49 +08:00
chore: clean up post-merge compiler warnings
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -19,7 +19,6 @@ use crate::sse::SseParser;
|
|||||||
use crate::types::{MessageDeltaEvent, MessageRequest, MessageResponse, StreamEvent, Usage};
|
use crate::types::{MessageDeltaEvent, MessageRequest, MessageResponse, StreamEvent, Usage};
|
||||||
|
|
||||||
pub const DEFAULT_BASE_URL: &str = "https://api.anthropic.com";
|
pub const DEFAULT_BASE_URL: &str = "https://api.anthropic.com";
|
||||||
const ANTHROPIC_VERSION: &str = "2023-06-01";
|
|
||||||
const REQUEST_ID_HEADER: &str = "request-id";
|
const REQUEST_ID_HEADER: &str = "request-id";
|
||||||
const ALT_REQUEST_ID_HEADER: &str = "x-request-id";
|
const ALT_REQUEST_ID_HEADER: &str = "x-request-id";
|
||||||
const DEFAULT_INITIAL_BACKOFF: Duration = Duration::from_millis(200);
|
const DEFAULT_INITIAL_BACKOFF: Duration = Duration::from_millis(200);
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ fn read_optional_json_object(
|
|||||||
|
|
||||||
let parsed = match JsonValue::parse(&contents) {
|
let parsed = match JsonValue::parse(&contents) {
|
||||||
Ok(parsed) => parsed,
|
Ok(parsed) => parsed,
|
||||||
Err(error) if is_legacy_config => return Ok(None),
|
Err(_error) if is_legacy_config => return Ok(None),
|
||||||
Err(error) => return Err(ConfigError::Parse(format!("{}: {error}", path.display()))),
|
Err(error) => return Err(ConfigError::Parse(format!("{}: {error}", path.display()))),
|
||||||
};
|
};
|
||||||
let Some(object) = parsed.as_object() else {
|
let Some(object) = parsed.as_object() else {
|
||||||
|
|||||||
@@ -476,15 +476,6 @@ impl HookRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct HookInvocation<'a> {
|
|
||||||
event: HookEvent,
|
|
||||||
tool_name: &'a str,
|
|
||||||
tool_input: &'a str,
|
|
||||||
tool_output: Option<&'a str>,
|
|
||||||
is_error: bool,
|
|
||||||
payload: &'a str,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum HookCommandOutcome {
|
enum HookCommandOutcome {
|
||||||
Allow { parsed: ParsedHookOutput },
|
Allow { parsed: ParsedHookOutput },
|
||||||
Deny { parsed: ParsedHookOutput },
|
Deny { parsed: ParsedHookOutput },
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ mod render;
|
|||||||
|
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fmt::Write as _;
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
use std::net::TcpListener;
|
use std::net::TcpListener;
|
||||||
@@ -18,8 +17,7 @@ use std::time::{Duration, Instant, UNIX_EPOCH};
|
|||||||
use api::{
|
use api::{
|
||||||
resolve_startup_auth_source, AnthropicClient, AuthSource, ContentBlockDelta, InputContentBlock,
|
resolve_startup_auth_source, AnthropicClient, AuthSource, ContentBlockDelta, InputContentBlock,
|
||||||
InputMessage, MessageRequest, MessageResponse, OutputContentBlock, PromptCache,
|
InputMessage, MessageRequest, MessageResponse, OutputContentBlock, PromptCache,
|
||||||
SessionTracer, StreamEvent as ApiStreamEvent, ToolChoice, ToolDefinition,
|
StreamEvent as ApiStreamEvent, ToolChoice, ToolDefinition, ToolResultContentBlock,
|
||||||
ToolResultContentBlock,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use commands::{
|
use commands::{
|
||||||
@@ -52,7 +50,6 @@ fn max_tokens_for_model(model: &str) -> u32 {
|
|||||||
}
|
}
|
||||||
const DEFAULT_DATE: &str = "2026-03-31";
|
const DEFAULT_DATE: &str = "2026-03-31";
|
||||||
const DEFAULT_OAUTH_CALLBACK_PORT: u16 = 4545;
|
const DEFAULT_OAUTH_CALLBACK_PORT: u16 = 4545;
|
||||||
const TELEMETRY_LOG_PATH_ENV: &str = "CLAW_TELEMETRY_LOG_PATH";
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
const BUILD_TARGET: Option<&str> = option_env!("TARGET");
|
const BUILD_TARGET: Option<&str> = option_env!("TARGET");
|
||||||
const GIT_SHA: Option<&str> = option_env!("GIT_SHA");
|
const GIT_SHA: Option<&str> = option_env!("GIT_SHA");
|
||||||
@@ -3290,10 +3287,6 @@ impl AnthropicRuntimeClient {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_session_tracer(mut self, session_tracer: SessionTracer) -> Self {
|
|
||||||
self.client = self.client.with_session_tracer(session_tracer);
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resolve_cli_auth_source() -> Result<AuthSource, Box<dyn std::error::Error>> {
|
fn resolve_cli_auth_source() -> Result<AuthSource, Box<dyn std::error::Error>> {
|
||||||
@@ -3522,23 +3515,6 @@ fn collect_prompt_cache_events(summary: &runtime::TurnSummary) -> Vec<serde_json
|
|||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_prompt_cache_events(summary: &runtime::TurnSummary) {
|
|
||||||
for event in &summary.prompt_cache_events {
|
|
||||||
let label = if event.unexpected {
|
|
||||||
"Prompt cache break"
|
|
||||||
} else {
|
|
||||||
"Prompt cache invalidation"
|
|
||||||
};
|
|
||||||
println!(
|
|
||||||
"{label}: {} (cache read {} -> {}, drop {})",
|
|
||||||
event.reason,
|
|
||||||
event.previous_cache_read_input_tokens,
|
|
||||||
event.current_cache_read_input_tokens,
|
|
||||||
event.token_drop,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn slash_command_completion_candidates() -> Vec<String> {
|
fn slash_command_completion_candidates() -> Vec<String> {
|
||||||
slash_command_specs()
|
slash_command_specs()
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user