Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a89abab
fix: harden tool execution under load
w0wl0lxd Aug 15, 2026
5391077
fix: address load hardening review
w0wl0lxd Aug 15, 2026
ad42e54
fix: resolve load hardening review
w0wl0lxd Aug 15, 2026
5bbf6ec
fix: keep output and model selection responsive
w0wl0lxd Aug 15, 2026
1e583af
fix: address deferred timer review
w0wl0lxd Aug 15, 2026
8818ab0
fix: preserve provider validation
w0wl0lxd Aug 15, 2026
ed2adcf
feat: return deferred timer ids
w0wl0lxd Aug 15, 2026
6bf47ad
fix: stabilize model refresh validation
w0wl0lxd Aug 15, 2026
fcf2221
docs: normalize defer return type
w0wl0lxd Aug 15, 2026
756c30d
fix: deliver exit event when a scheduled timer is cancelled
devin-ai-integration[bot] Aug 15, 2026
c6e3551
test: cancelled timer delivers exit event
devin-ai-integration[bot] Aug 15, 2026
e1eef6b
fix: harden deferred output and model refresh
w0wl0lxd Aug 15, 2026
61656db
fix: distinguish cancelled deferred timers
w0wl0lxd Aug 15, 2026
ad0e6e0
fix: address final load review notes
w0wl0lxd Aug 15, 2026
2b08245
fix(runtime): flush deferred output on cleanup
w0wl0lxd Aug 16, 2026
db8cec4
fix(runtime): preserve timeout markers after cleanup
w0wl0lxd Aug 16, 2026
684e88a
fix(runtime): harden cleanup and async finish handling
w0wl0lxd Aug 16, 2026
180d252
fix(lint): gate unix-only jobwait test imports
w0wl0lxd Aug 16, 2026
25a0dc8
fix(runtime): preserve sibling jobwait output
w0wl0lxd Aug 16, 2026
56afb27
fix(lint): avoid redundant lua clone
w0wl0lxd Aug 16, 2026
bc30c1b
fix(runtime): keep bash flush timer ownership
w0wl0lxd Aug 16, 2026
089e337
style(bash): format flush callback
w0wl0lxd Aug 16, 2026
00216be
fix(lint): gate owner access process test
w0wl0lxd Aug 16, 2026
754dfe6
test(runtime): reduce timeout cleanup race
w0wl0lxd Aug 16, 2026
ef19471
fix(runtime): restore timeout marker inside task scope
w0wl0lxd Aug 16, 2026
2fe25f3
test(lua): make owner event drain test deterministic
w0wl0lxd Aug 16, 2026
5dc60ad
fix(runtime): isolate cleanup callback deadline
w0wl0lxd Aug 16, 2026
e6612b8
fix(runtime): preserve callback errors during cleanup
w0wl0lxd Aug 16, 2026
6d6cb40
fix(runtime): preserve per-event finish precedence
w0wl0lxd Aug 16, 2026
d908d98
docs(lua): attach jobwait receiver comment
w0wl0lxd Aug 16, 2026
63a5b4b
fix(runtime): clear cleanup callback deadline
w0wl0lxd Aug 16, 2026
c47c7ee
refactor(lua): reuse timer event draining
w0wl0lxd Aug 16, 2026
29ee82e
fix(lua): mirror defer_fn api
w0wl0lxd Aug 16, 2026
1f5bedb
fix(lua): keep defer compatibility
w0wl0lxd Aug 16, 2026
43d5616
fix(lint): merge defer argument arms
w0wl0lxd Aug 16, 2026
d3707e7
fix(lua): align defer delay parsing
w0wl0lxd Aug 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ re-encoding of tool-call data, and [ALMAS](https://arxiv.org/abs/2510.03463) age
## Quick start

```sh
cargo install --locked --git https://github.com/w0wl0lxd/n00n.git n00n
cargo install --locked --git https://github.com/w0wl0lxd/n00n.git n00n n00n-git n00n-smell

cd your-project && n00n
```
Expand Down
1 change: 1 addition & 0 deletions changelog.d/388.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduced tool-output update overhead under load and capped batch fan-out at four calls.
Comment thread
w0wl0lxd marked this conversation as resolved.
1 change: 1 addition & 0 deletions changelog.d/388.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed discovered nested model specs being rejected when selected and kept bursty shell output responsive without spawning timer processes.
34 changes: 28 additions & 6 deletions n00n-agent/src/agent/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ pub(super) async fn compact_history(
session_id: Option<&n00n_storage::id::SessionRef>,
cwd: &std::path::Path,
transcript_path: Option<&std::path::Path>,
run_hooks: bool,
) -> Result<(TokenUsage, String), AgentError> {
run_precompact_hooks(trigger, session_id, cwd, transcript_path).await?;
if run_hooks {
run_precompact_hooks(trigger, session_id, cwd, transcript_path).await?;
}

let compact_start = Instant::now();
let mut compaction_history: Vec<Message> = history.as_slice().to_vec();
Expand Down Expand Up @@ -162,7 +165,9 @@ pub(super) async fn compact_history(
.first_text_content()
.map_or_else(String::new, std::string::ToString::to_string);

run_postcompact_hooks(trigger, session_id, cwd, transcript_path, &summary).await;
if run_hooks {
run_postcompact_hooks(trigger, session_id, cwd, transcript_path, &summary).await;
}

let usage = finish_compact(response, history, compact_start, model);
Ok((usage, summary))
Expand Down Expand Up @@ -205,6 +210,16 @@ pub async fn compact(
model: &Model,
history: &mut History,
event_tx: &EventSender,
) -> Result<(), AgentError> {
compact_inner(provider, model, history, event_tx, true).await
}

async fn compact_inner(
provider: &dyn n00n_providers::provider::Provider,
model: &Model,
history: &mut History,
event_tx: &EventSender,
run_hooks: bool,
) -> Result<(), AgentError> {
let cancel = CancelToken::none();
let cwd = std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from("/"));
Expand All @@ -218,6 +233,7 @@ pub async fn compact(
None,
&cwd,
None,
run_hooks,
)
.await?;
let context_size = crate::agent::run::estimate_message_tokens(history.as_slice(), &model.id);
Expand Down Expand Up @@ -419,11 +435,12 @@ mod tests {
let (event_tx, event_rx) = flume::unbounded();
let mut history = History::new(vec![Message::user("before".into())]);

compact(
compact_inner(
&*provider,
&model,
&mut history,
&EventSender::new(event_tx, 0),
false,
)
.await
.expect("compact should succeed");
Expand Down Expand Up @@ -548,11 +565,12 @@ mod tests {
let (event_tx, event_rx) = flume::unbounded();
let mut history = History::new(vec![Message::user("before".into())]);

compact(
compact_inner(
&*provider,
&compact_model,
&mut history,
&EventSender::new(event_tx, 0),
false,
)
.await
.expect("compact should succeed");
Expand Down Expand Up @@ -589,11 +607,12 @@ mod tests {
},
]);

compact(
compact_inner(
&*provider,
&model,
&mut history,
&EventSender::new(raw_tx, 0),
false,
)
.await
.unwrap();
Expand Down Expand Up @@ -885,11 +904,12 @@ mod tests {
},
]);

compact(
compact_inner(
&*provider,
&model,
&mut history,
&EventSender::new(raw_tx, 0),
false,
)
.await
.unwrap();
Expand Down Expand Up @@ -1275,6 +1295,7 @@ mod tests {
None,
&std::env::current_dir().unwrap(),
None,
false,
)
.await;

Expand Down Expand Up @@ -1327,6 +1348,7 @@ mod tests {
None,
&std::env::current_dir().unwrap(),
None,
false,
)
.await;

Expand Down
18 changes: 17 additions & 1 deletion n00n-agent/src/agent/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ pub struct AgentRunParams<'h> {
pub tool_filter: ToolFilter,
}

#[cfg(test)]
enum TestCompactionHooks {
Enabled,
Disabled,
}
Comment thread
w0wl0lxd marked this conversation as resolved.

pub struct Agent<'h> {
provider: Arc<dyn Provider>,
model: Arc<Model>,
Expand All @@ -188,6 +194,8 @@ pub struct Agent<'h> {
num_turns: u32,
recent_calls: RecentCalls,
auto_compact: bool,
#[cfg(test)]
test_compaction_hooks: TestCompactionHooks,
Comment thread
w0wl0lxd marked this conversation as resolved.
Comment thread
w0wl0lxd marked this conversation as resolved.
loaded_instructions: LoadedInstructions,
pre_dispatch_rollback_len: Option<usize>,
rollback_len: Option<usize>,
Expand Down Expand Up @@ -258,6 +266,8 @@ impl<'h> Agent<'h> {
num_turns: 0,
recent_calls: RecentCalls::new(),
auto_compact: compaction::auto_compact_enabled(),
#[cfg(test)]
test_compaction_hooks: TestCompactionHooks::Enabled,
loaded_instructions: LoadedInstructions::new(),
pre_dispatch_rollback_len: None,
rollback_len: None,
Expand Down Expand Up @@ -1152,6 +1162,10 @@ impl<'h> Agent<'h> {
self.openai_options,
);
let cwd = std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from("/"));
#[cfg(test)]
let run_hooks = matches!(self.test_compaction_hooks, TestCompactionHooks::Enabled);
#[cfg(not(test))]
let run_hooks = true;
let (usage, summary) = compaction::compact_history(
&*compact_provider,
&compact_model,
Expand All @@ -1162,6 +1176,7 @@ impl<'h> Agent<'h> {
self.identity.as_ref().map(SessionIdentity::session_id),
&cwd,
None,
run_hooks,
)
.await?;
// Charge compaction to the pre-route lane before any Fusion switch.
Expand Down Expand Up @@ -2088,7 +2103,7 @@ mod tests {
},
false,
);
let agent = Agent::new(
let mut agent = Agent::new(
AgentParams {
provider: Arc::new(provider),
model: default_model(),
Expand Down Expand Up @@ -2120,6 +2135,7 @@ mod tests {
tool_filter: filter,
},
);
agent.test_compaction_hooks = TestCompactionHooks::Disabled;
(agent, event_rx)
}

Expand Down
Loading
Loading