Gate nightly diagnostics behind feature
This commit is contained in:
parent
0e459aae92
commit
b76ac9f405
6 changed files with 18 additions and 12 deletions
|
|
@ -18,6 +18,9 @@ name = "consciousness"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|
||||||
|
[features]
|
||||||
|
nightly-diagnostics = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
html2md = "0.2"
|
html2md = "0.2"
|
||||||
|
|
|
||||||
|
|
@ -403,10 +403,11 @@ impl Agent {
|
||||||
loop {
|
loop {
|
||||||
let _thinking = start_activity(&agent, "thinking...").await;
|
let _thinking = start_activity(&agent, "thinking...").await;
|
||||||
|
|
||||||
let (rx, _stream_guard) = {
|
let (rx, _stream_guard, in_think) = {
|
||||||
let (prompt_tokens, images) = agent.assemble_prompt().await;
|
let (prompt_tokens, images) = agent.assemble_prompt().await;
|
||||||
let st = agent.state.lock().await;
|
let st = agent.state.lock().await;
|
||||||
agent.client.stream_completion_mm(
|
let in_think = st.think_native;
|
||||||
|
let stream = agent.client.stream_completion_mm(
|
||||||
&prompt_tokens,
|
&prompt_tokens,
|
||||||
&images,
|
&images,
|
||||||
api::SamplingParams {
|
api::SamplingParams {
|
||||||
|
|
@ -415,7 +416,8 @@ impl Agent {
|
||||||
top_k: st.top_k,
|
top_k: st.top_k,
|
||||||
},
|
},
|
||||||
st.priority,
|
st.priority,
|
||||||
)
|
);
|
||||||
|
(stream.0, stream.1, in_think)
|
||||||
};
|
};
|
||||||
|
|
||||||
let branch_idx = {
|
let branch_idx = {
|
||||||
|
|
@ -427,7 +429,7 @@ impl Agent {
|
||||||
idx
|
idx
|
||||||
};
|
};
|
||||||
|
|
||||||
let parser = ResponseParser::new(branch_idx);
|
let parser = ResponseParser::new(branch_idx, in_think);
|
||||||
let (mut tool_rx, parser_handle) = parser.run(rx, agent.clone());
|
let (mut tool_rx, parser_handle) = parser.run(rx, agent.clone());
|
||||||
|
|
||||||
let mut pending_calls: Vec<PendingToolCall> = Vec::new();
|
let mut pending_calls: Vec<PendingToolCall> = Vec::new();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
#![feature(panic_backtrace_config)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(panic_backtrace_config))]
|
||||||
#![warn(unreachable_pub)]
|
#![warn(unreachable_pub)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
#[cfg(feature = "nightly-diagnostics")]
|
||||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||||
consciousness::user::main()
|
consciousness::user::main()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(async_fn_track_caller)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(async_fn_track_caller))]
|
||||||
|
|
||||||
// consciousness — unified crate for memory, agents, and subconscious processes
|
// consciousness — unified crate for memory, agents, and subconscious processes
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
|
||||||
Self { inner: Mutex::new(value) }
|
Self { inner: Mutex::new(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.lock().await;
|
let guard = self.inner.lock().await;
|
||||||
|
|
@ -125,7 +125,7 @@ impl<T> TrackedMutex<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
|
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.try_lock()?;
|
let guard = self.inner.try_lock()?;
|
||||||
|
|
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
|
||||||
Self { inner: RwLock::new(value) }
|
Self { inner: RwLock::new(value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.read().await;
|
let guard = self.inner.read().await;
|
||||||
|
|
@ -182,7 +182,7 @@ impl<T> TrackedRwLock<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||||
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
|
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
|
||||||
let location = Location::caller();
|
let location = Location::caller();
|
||||||
let guard = self.inner.write().await;
|
let guard = self.inner.write().await;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(panic_backtrace_config)]
|
#![cfg_attr(feature = "nightly-diagnostics", feature(panic_backtrace_config))]
|
||||||
|
|
||||||
// poc-memory: graph-structured memory for AI assistants
|
// poc-memory: graph-structured memory for AI assistants
|
||||||
//
|
//
|
||||||
|
|
@ -464,6 +464,7 @@ impl Run for AdminCmd {
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
#[cfg(feature = "nightly-diagnostics")]
|
||||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||||
|
|
||||||
// Handle --help ourselves for expanded subcommand display
|
// Handle --help ourselves for expanded subcommand display
|
||||||
|
|
@ -495,4 +496,3 @@ async fn main() {
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue