affaan-m/ECC · error · anyhow::Error

page_size must be greater than 0

Error message

page_size must be greater than 0

What it means

Guard in the observability store's query pagination: a page_size of 0 was passed, which would make LIMIT 0 return nothing and make page math meaningless. Page size must be at least 1.

Source

Thrown at ecc2/src/observability/mod.rs:288

    pub fn log(&self, event: &ToolCallEvent) -> Result<ToolLogEntry> {
        let timestamp = chrono::Utc::now().to_rfc3339();

        self.db.insert_tool_log(
            &event.session_id,
            &event.tool_name,
            &event.input_summary,
            &event.input_params_json,
            &event.output_summary,
            &event.trigger_summary,
            event.duration_ms,
            event.risk_score,
            &timestamp,
        )
    }

    pub fn query(&self, session_id: &str, page: u64, page_size: u64) -> Result<ToolLogPage> {
        if page_size == 0 {
            bail!("page_size must be greater than 0");
        }

        self.db.query_tool_logs(session_id, page.max(1), page_size)
    }
}

pub fn log_tool_call(db: &StateStore, event: &ToolCallEvent) -> Result<ToolLogEntry> {
    ToolLogger::new(db).log(event)
}

#[cfg(test)]
mod tests {
    use super::{SuggestedAction, ToolCallEvent, ToolLogger};
    use crate::config::Config;
    use crate::session::store::StateStore;
    use crate::session::{Session, SessionMetrics, SessionState};
    use std::path::PathBuf;

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Pass a page_size greater than 0.
  2. Check for config or CLI parsing that produced 0 for page_size.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ecc2/src/observability/mod.rs:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/5e6fc4933f450a2d. Report an issue: GitHub.