rustfmt the soft context limit change
This commit is contained in:
parent
8147b76cda
commit
7dd988a9e8
3 changed files with 10 additions and 4 deletions
|
|
@ -144,7 +144,9 @@ pub async fn run(bus: Bus) {
|
||||||
loop {
|
loop {
|
||||||
if let Some(read) = read(&client, &agent).await {
|
if let Some(read) = read(&client, &agent).await {
|
||||||
overridden.apply(&read, &target);
|
overridden.apply(&read, &target);
|
||||||
target.bus.set_soft_context_percent(read.soft_context_percent);
|
target
|
||||||
|
.bus
|
||||||
|
.set_soft_context_percent(read.soft_context_percent);
|
||||||
}
|
}
|
||||||
tokio::time::sleep(POLL_INTERVAL).await;
|
tokio::time::sleep(POLL_INTERVAL).await;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use hive_claude::{CompactionPolicy, Usage};
|
||||||
use hive_runtime::{
|
use hive_runtime::{
|
||||||
AcpRuntime, AgentRuntime, ClaudeRuntime, Config, PercentPolicy, PermissionAsk,
|
AcpRuntime, AgentRuntime, ClaudeRuntime, Config, PercentPolicy, PermissionAsk,
|
||||||
PermissionPolicy, Runtime, RuntimeSpec, Sink,
|
PermissionPolicy, Runtime, RuntimeSpec, Sink,
|
||||||
};
|
};
|
||||||
use hive_claude::{CompactionPolicy, Usage};
|
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use crate::events::{Bus, LiveEvent};
|
use crate::events::{Bus, LiveEvent};
|
||||||
|
|
@ -891,12 +891,12 @@ fn archive_session(bus: &Bus, session: &AgentSession) {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use super::{PercentPolicy, SoftLimitPolicy};
|
||||||
use super::{
|
use super::{
|
||||||
PermissionAsk, TurnError, TurnOutcome, acp_permits, apply_telemetry, emit_turn_end,
|
PermissionAsk, TurnError, TurnOutcome, acp_permits, apply_telemetry, emit_turn_end,
|
||||||
error_to_turn, nonzero_or, parse_u64, report_compact, runtime_error_to_turn,
|
error_to_turn, nonzero_or, parse_u64, report_compact, runtime_error_to_turn,
|
||||||
with_turn_end_compact,
|
with_turn_end_compact,
|
||||||
};
|
};
|
||||||
use super::{PercentPolicy, SoftLimitPolicy};
|
|
||||||
use crate::events::{Bus, LiveEvent};
|
use crate::events::{Bus, LiveEvent};
|
||||||
use hive_claude::{CompactionPolicy, Usage};
|
use hive_claude::{CompactionPolicy, Usage};
|
||||||
use hive_runtime::{AcpError, Error};
|
use hive_runtime::{AcpError, Error};
|
||||||
|
|
|
||||||
|
|
@ -569,7 +569,11 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn soft_context_percent_outside_its_range_is_refused() {
|
fn soft_context_percent_outside_its_range_is_refused() {
|
||||||
for percent in [0, MIN_SOFT_CONTEXT_PERCENT - 1, MAX_SOFT_CONTEXT_PERCENT + 1] {
|
for percent in [
|
||||||
|
0,
|
||||||
|
MIN_SOFT_CONTEXT_PERCENT - 1,
|
||||||
|
MAX_SOFT_CONTEXT_PERCENT + 1,
|
||||||
|
] {
|
||||||
let json = format!(r#"{{"soft_context_percent":{percent}}}"#);
|
let json = format!(r#"{{"soft_context_percent":{percent}}}"#);
|
||||||
assert!(into_stored(settings(&json).unwrap()).is_err(), "{json}");
|
assert!(into_stored(settings(&json).unwrap()).is_err(), "{json}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue