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
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
nightly-diagnostics = []
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
html2md = "0.2"
|
||||
|
|
|
|||
|
|
@ -403,10 +403,11 @@ impl Agent {
|
|||
loop {
|
||||
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 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,
|
||||
&images,
|
||||
api::SamplingParams {
|
||||
|
|
@ -415,7 +416,8 @@ impl Agent {
|
|||
top_k: st.top_k,
|
||||
},
|
||||
st.priority,
|
||||
)
|
||||
);
|
||||
(stream.0, stream.1, in_think)
|
||||
};
|
||||
|
||||
let branch_idx = {
|
||||
|
|
@ -427,7 +429,7 @@ impl Agent {
|
|||
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 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)]
|
||||
|
||||
fn main() {
|
||||
#[cfg(feature = "nightly-diagnostics")]
|
||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||
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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
|
|||
Self { inner: Mutex::new(value) }
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
||||
let location = Location::caller();
|
||||
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> {
|
||||
let location = Location::caller();
|
||||
let guard = self.inner.try_lock()?;
|
||||
|
|
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
|
|||
Self { inner: RwLock::new(value) }
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
||||
let location = Location::caller();
|
||||
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> {
|
||||
let location = Location::caller();
|
||||
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
|
||||
//
|
||||
|
|
@ -464,6 +464,7 @@ impl Run for AdminCmd {
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
#[cfg(feature = "nightly-diagnostics")]
|
||||
std::panic::set_backtrace_style(std::panic::BacktraceStyle::Short);
|
||||
|
||||
// Handle --help ourselves for expanded subcommand display
|
||||
|
|
@ -495,4 +496,3 @@ async fn main() {
|
|||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue