mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-09-02 09:39:37 +00:00
- Cache discovery_schema() with OnceLock for routine tools (fixes #1361, #1371) - Early-return on empty event cache before allocating Vec (fixes #1369) - Extract batch concurrent count query helper to reduce duplication - Fix ROUTINE_OK sentinel substring matching - Migrate crate::safety import to ironclaw_safety per project convention Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
14abd60917
commit
ec04354c6b
@@ -10,7 +10,7 @@
|
||||
//! - `event_emit` - Emit a structured system event to `system_event`-triggered routines
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
@@ -624,7 +624,8 @@ pub(crate) fn routine_create_parameters_schema() -> Value {
|
||||
}
|
||||
|
||||
fn routine_create_discovery_schema() -> Value {
|
||||
routine_create_schema(true)
|
||||
static CACHE: OnceLock<Value> = OnceLock::new();
|
||||
CACHE.get_or_init(|| routine_create_schema(true)).clone()
|
||||
}
|
||||
|
||||
pub(crate) fn routine_update_parameters_schema() -> Value {
|
||||
@@ -1007,7 +1008,8 @@ pub(crate) fn event_emit_parameters_schema() -> Value {
|
||||
}
|
||||
|
||||
fn event_emit_discovery_schema() -> Value {
|
||||
event_emit_schema(true)
|
||||
static CACHE: OnceLock<Value> = OnceLock::new();
|
||||
CACHE.get_or_init(|| event_emit_schema(true)).clone()
|
||||
}
|
||||
|
||||
fn parse_event_emit_args(params: &Value) -> Result<(String, String, Value), ToolError> {
|
||||
|
||||
Reference in New Issue
Block a user