Skip to main content

vtcode_config/constants/
optimization.rs

1/// File read cache defaults (development and general use)
2pub(crate) const FILE_READ_CACHE_MIN_SIZE_BYTES: usize = 256 * 1024; // 256 KB
3pub(crate) const FILE_READ_CACHE_MAX_SIZE_BYTES: usize = 10 * 1024 * 1024; // 10 MB
4pub(crate) const FILE_READ_CACHE_TTL_SECS: u64 = 300;
5pub(crate) const FILE_READ_CACHE_MAX_ENTRIES: usize = 128;
6
7/// Absolute ceiling on the number of lines a single `read_file` call may
8/// return (line-based reads). Larger requests are clamped and the response
9/// carries a `next_read_args` continuation so the agent can page forward.
10pub const DEFAULT_MAX_READ_LINES: usize = 400;
11
12/// File read cache defaults for production
13pub(crate) const FILE_READ_CACHE_PROD_MIN_SIZE_BYTES: usize = 512 * 1024; // 512 KB
14pub(crate) const FILE_READ_CACHE_PROD_MAX_SIZE_BYTES: usize = 25 * 1024 * 1024; // 25 MB
15pub(crate) const FILE_READ_CACHE_PROD_TTL_SECS: u64 = 600;
16pub(crate) const FILE_READ_CACHE_PROD_MAX_ENTRIES: usize = 256;
17
18/// Command cache defaults (development and general use)
19pub(crate) const COMMAND_CACHE_TTL_MS: u64 = 2_000;
20pub(crate) const COMMAND_CACHE_MAX_ENTRIES: usize = 128;
21pub(crate) const COMMAND_CACHE_ALLOWLIST: &[&str] = &["rg", "ls", "git status", "git diff --stat"];
22
23/// Command cache defaults for production
24pub(crate) const COMMAND_CACHE_PROD_TTL_MS: u64 = 3_000;
25pub(crate) const COMMAND_CACHE_PROD_MAX_ENTRIES: usize = 256;
26pub(crate) const COMMAND_CACHE_PROD_ALLOWLIST: &[&str] = &["rg", "ls", "git status", "git diff --stat"];