vtcode_config/core/
model.rs1use serde::{Deserialize, Serialize};
2
3#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
5#[derive(Debug, Clone, Deserialize, Serialize)]
6pub struct ModelConfig {
7 #[serde(default = "default_loop_detection_enabled")]
9 pub skip_loop_detection: bool,
10
11 #[serde(default = "default_loop_detection_threshold")]
13 pub loop_detection_threshold: usize,
14
15 #[serde(default = "default_loop_detection_interactive")]
17 pub loop_detection_interactive: bool,
18
19 #[serde(default)]
22 pub model_supports_reasoning: Option<bool>,
23
24 #[serde(default)]
27 pub model_supports_reasoning_effort: Option<bool>,
28}
29
30impl Default for ModelConfig {
31 fn default() -> Self {
32 Self {
33 skip_loop_detection: default_loop_detection_enabled(),
34 loop_detection_threshold: default_loop_detection_threshold(),
35 loop_detection_interactive: default_loop_detection_interactive(),
36 model_supports_reasoning: None,
37 model_supports_reasoning_effort: None,
38 }
39 }
40}
41
42#[inline]
43const fn default_loop_detection_enabled() -> bool {
44 false
45}
46
47#[inline]
48const fn default_loop_detection_threshold() -> usize {
49 2
50}
51
52#[inline]
53const fn default_loop_detection_interactive() -> bool {
54 true
55}