Skip to content

Incremental engine for long horizon agents 🌟 Star if you like it!

fix(core): name engine errors in language-neutral terms (#2763)

LJ πŸ₯₯🌴d1a0a1405c1b
diff --git a/python/tests/core/test_function_memo.py b/python/tests/core/test_function_memo.py
index 4a5b73b8..4e4abc07 100644
--- a/python/tests/core/test_function_memo.py
+++ b/python/tests/core/test_function_memo.py
@@ -502,7 +502,7 @@ def test_memo_nested_functions_with_components() -> None:
"1A": SourceDataEntry(name="1A", version=1, content="content1A"),
},
)
- with pytest.raises(Exception, match="memo=True mounted child components"):
+ with pytest.raises(Exception, match="mounted child components"):
app.update_blocking()
@@ -542,7 +542,7 @@ def test_memo_nested_functions_with_components_async() -> None:
"1A": SourceDataEntry(name="1A", version=1, content="content1A"),
},
)
- with pytest.raises(Exception, match="memo=True mounted child components"):
+ with pytest.raises(Exception, match="mounted child components"):
app.update_blocking()
diff --git a/rust/core/src/engine/context.rs b/rust/core/src/engine/context.rs
index 56ed1f4f..c6693ba1 100644
--- a/rust/core/src/engine/context.rs
+++ b/rust/core/src/engine/context.rs
@@ -683,7 +683,7 @@ impl<D: Persist + Clone> UserStateCache<D> {
Entry::Occupied(mut e) => match e.get() {
UserStateEntry::Declared(_) => {
already_declared_bail!(
- "coco.use_state() key {:?} declared more than once in the same component run",
+ "use_state key {:?} declared more than once in the same component run",
e.key()
);
}
@@ -710,7 +710,7 @@ impl<D: Persist + Clone> UserStateCache<D> {
}
_ => {
client_bail!(
- "coco.use_state() key {:?} has not been declared via use_state() in this component run",
+ "use_state key {:?} has not been declared via use_state in this component run",
key
);
}
diff --git a/rust/core/src/engine/function.rs b/rust/core/src/engine/function.rs
index b185ee6a..29581d72 100644
--- a/rust/core/src/engine/function.rs
+++ b/rust/core/src/engine/function.rs
@@ -189,8 +189,9 @@ impl<Prof: EngineProfile> FnCallMemoGuard<Prof> {
if has_child_components {
*self.guard = FnCallMemoEntry::Ready(None);
client_bail!(
- "A function with memo=True mounted child components. \
- Either mount the function as a component, or set memo=False."
+ "A memoized function (`memo=True` in Python, `#[function(memo)]` in Rust) \
+ mounted child components. Either mount the function as a component, \
+ or turn off its memoization."
);
}
let memo_ret = build_fn_call_memo(fn_ctx, ret(), memo_states);