cleanup: fix all build warnings, delete dead DMN context code
- Delete poc-daemon/src/context.rs dead code (git_context, work_state, irc_digest, recent_commits, uncommitted_files) — replaced by where-am-i.md and memory graph - Remove unused imports (BufWriter, Context, similarity) - Prefix unused variables (_store, _avg_cc, _episodic_ratio, _message) - #[allow(dead_code)] on public API surface that's not yet wired (Message::assistant, ConversationLog::message_count/read_all, Config::context_message, ContextInfo fields) - Fix to_capnp macro dead_code warning - Rename _rewrite_store_DISABLED to snake_case Only remaining warnings are in generated capnp code (can't fix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
378a09a9f8
commit
9d476841b8
17 changed files with 41 additions and 197 deletions
|
|
@ -1066,15 +1066,15 @@ struct ContextPlan {
|
|||
/// Index into recent conversation: skip messages before this
|
||||
conv_trim: usize,
|
||||
/// Total recent conversation messages
|
||||
conv_count: usize,
|
||||
_conv_count: usize,
|
||||
/// Tokens used by full journal entries
|
||||
full_tokens: usize,
|
||||
_full_tokens: usize,
|
||||
/// Tokens used by header-only journal entries
|
||||
header_tokens: usize,
|
||||
_header_tokens: usize,
|
||||
/// Tokens used by conversation (after trimming)
|
||||
conv_tokens: usize,
|
||||
_conv_tokens: usize,
|
||||
/// Total budget available (after identity, memory, reserve)
|
||||
available: usize,
|
||||
_available: usize,
|
||||
}
|
||||
|
||||
/// Build a context window from conversation messages + journal entries.
|
||||
|
|
@ -1233,11 +1233,11 @@ fn plan_context(
|
|||
full_start,
|
||||
entry_count: entries.len(),
|
||||
conv_trim,
|
||||
conv_count: recent.len(),
|
||||
full_tokens: full_used,
|
||||
header_tokens: header_used,
|
||||
conv_tokens: trimmed_conv,
|
||||
available,
|
||||
_conv_count: recent.len(),
|
||||
_full_tokens: full_used,
|
||||
_header_tokens: header_used,
|
||||
_conv_tokens: trimmed_conv,
|
||||
_available: available,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
mod anthropic;
|
||||
mod openai;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use anyhow::Result;
|
||||
use reqwest::Client;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ pub async fn stream(
|
|||
let mut empty_deltas: u64 = 0;
|
||||
let mut first_content_at: Option<Duration> = None;
|
||||
|
||||
let reasoning_enabled = reasoning_effort != "none";
|
||||
let _reasoning_enabled = reasoning_effort != "none";
|
||||
|
||||
while let Some(event) = reader.next_event(&mut response).await? {
|
||||
// OpenRouter sometimes embeds error objects in the stream
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ pub struct Config {
|
|||
|
||||
impl Config {
|
||||
/// Join context parts into a single string for legacy interfaces.
|
||||
#[allow(dead_code)]
|
||||
pub fn context_message(&self) -> String {
|
||||
self.context_parts.iter()
|
||||
.map(|(name, content)| format!("## {}\n\n{}", name, content))
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ impl ConversationLog {
|
|||
}
|
||||
|
||||
/// Count messages in the log without loading content.
|
||||
#[allow(dead_code)]
|
||||
pub fn message_count(&self) -> Result<usize> {
|
||||
if !self.path.exists() {
|
||||
return Ok(0);
|
||||
|
|
@ -94,6 +95,7 @@ impl ConversationLog {
|
|||
|
||||
/// Read all messages from the log. Returns empty vec if log doesn't exist.
|
||||
/// NOTE: Don't use this in hot paths — use read_tail() instead.
|
||||
#[allow(dead_code)]
|
||||
pub fn read_all(&self) -> Result<Vec<Message>> {
|
||||
if !self.path.exists() {
|
||||
return Ok(Vec::new());
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ impl Message {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn assistant(content: impl Into<String>) -> Self {
|
||||
Self {
|
||||
role: Role::Assistant,
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ pub struct ContextInfo {
|
|||
pub available_models: Vec<String>,
|
||||
pub prompt_file: String,
|
||||
pub backend: String,
|
||||
#[allow(dead_code)]
|
||||
pub instruction_files: Vec<(String, usize)>,
|
||||
#[allow(dead_code)]
|
||||
pub memory_files: Vec<(String, usize)>,
|
||||
pub system_prompt_chars: usize,
|
||||
pub context_message_chars: usize,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue