Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ mod read_receipt;
pub use read_receipt::ReadReceipt;
use self::reply_claim::*;
mod verdict;
mod prefill_during_tool;
mod tool_surface;
use super::tool_surface::{SelectedSurface, ToolSurface};

Expand Down Expand Up @@ -239,8 +238,6 @@ pub struct LlmDeliberationFaculty {
held_blocks: parking_lot::Mutex<std::collections::HashMap<(Uuid, String), crate::cognition::context_streams::blocks::Grounding>>,
/// A measurement fork's (`fork_eval_cycle`): its turns warm their own page, never hers.
forked: bool,
/// Her prompt, prefilled into her slot while her tool runs (`prefill_during_tool.rs`).
prefix_warm: prefill_during_tool::PendingPrefix,
}

impl LlmDeliberationFaculty {
Expand Down Expand Up @@ -275,7 +272,6 @@ impl LlmDeliberationFaculty {
held_blocks: parking_lot::Mutex::new(std::collections::HashMap::new()),
reading: Default::default(),
forked: false,
prefix_warm: Default::default(),
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -667,3 +667,29 @@ async fn empty_prose_with_no_tools_is_a_pass() {
.expect("verdict");
assert_eq!(c.decision, Some(Decision::pass()));
}

// what this catches: a one-token "warm" request sent between her act and her next generation (the
// deleted prefill_during_tool). It re-sent the prompt she was served, so the engine truncated her
// generated reasoning and call out of her KV and her next generation recomputed them (the M5,
// 2026-11-17). Her act, then her next generation: exactly two calls, neither a one-token pass.
#[tokio::test]
async fn her_act_and_her_next_generation_are_the_only_requests_on_her_slot() {
let call = ToolCall { id: "t1".to_string(), name: "code/read".to_string(), input: json!({ "path": "deploy.md" }) };
let adapter = Arc::new(ScriptedAdapter {
prompt_cache: crate::ai::adapter::PromptCache::PinnedSlot,
..ScriptedAdapter::new(vec![
make_response(FinishReason::ToolUse, "", Some(vec![call])),
make_response(FinishReason::Stop, "deploy.md says it landed", None),
])
});
let faculty = LlmDeliberationFaculty::new(Uuid::new_v4(), "Ivar", "You are Ivar.", Arc::clone(&adapter) as Arc<dyn AIProviderAdapter>)
.with_tools(vec![read_tool()])
.with_context_window(32_768);
let ws = Workspace::new("teammate asks: did the deploy fix land?");
let first = faculty.contribute(&ws).await.expect("verdict");
assert!(matches!(first.decision, Some(Decision::Act { .. })), "her act dispatches the tool");
faculty.contribute(&ws).await.expect("verdict");
let seen = adapter.seen.lock().expect("fixture request log");
assert_eq!(seen.len(), 2, "her act, then her next generation: nothing between them on her slot");
assert!(seen.iter().all(|request| request.max_tokens != Some(1)), "no one-token pass truncates what she generated");
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ mod act_output_room;

mod unpriced_need;

mod prefill_during_tool;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ impl LlmDeliberationFaculty {
// A rebuilt request with no max_tokens keeps the last one sent (the read of the
// previous value is also what keeps the initializer honest).
sent_allowance = request.max_tokens.or(sent_allowance);
self.prefix_warm_settled(ws.room_id).await; // her prefix, warmed while her last tool ran
let result = self
.generate_for_workspace(ws, &binding, fit_window, request, terms, allocation, receipts)
.await?;
Expand Down Expand Up @@ -841,7 +840,6 @@ impl LlmDeliberationFaculty {
return Some(v);
}
if !calls.is_empty() {
self.prefill_during_tool(&binding.adapter, ws.room_id, request_template.as_ref(), &view);
return Some(self.act_verdict(calls, &resp, ws.activity_room_id));
}
}
Expand Down
Loading