Troubleshooting
Read this when a build fails or behaves differently than the workflow predicts. Each section lists symptoms, likely cause, and a concrete fix.
Build / aomi-build
aomi-build compile --app <name> reports "0 plugins built"
Symptoms:
- The build completes with no errors but produces no plugin file.
- The expected
target/release/lib<name>.dylib(or.so/.dll) is missing.
Cause:
- The app path, package metadata, or skip marker prevented discovery. Current
aomi-build compilescans tracked manifests and the apps directory, but apps with[package.metadata.aomi.skip]are still skipped intentionally.
Fix:
cargo run -p aomi-sdk --features cli --bin aomi-build -- compile --app <name>For an immediate compile signal without staging anything:
cargo build --manifest-path apps/<name>/Cargo.tomlIf the app is intentionally hidden behind package metadata, remove the skip only when it is ready.
App is intentionally skipped
Symptoms:
- App exists but
compileskips it. - The build logs mention
package metadata aomi.skip = true.
Cause:
- The app's
Cargo.tomlhas[package.metadata.aomi.skip]set, usually for in-progress crates that don't yet build.
Fix:
If the app is ready, remove the skip block from apps/<name>/Cargo.toml. If it's still in-progress, leave it alone — the skip is intentional.
cargo build succeeds but aomi-build compile errors with manifest validation
Symptoms:
- The crate compiles fine.
aomi-build compilerejects with errors like "manifest does not exportaomi_create" or "missingaomi_sdk_versionsymbol".
Cause:
lib.rsis missing thedyn_aomi_app!macro invocation, OR the macro arguments are malformed (e.g. typo intools = [...], missingnamespacesfield).
Fix:
Compare against sdk/examples/app-template-http/src/lib.rs:
dyn_aomi_app!(
app = client::MyApp, // type from client.rs
name = "my-app", // string identifier
version = "0.1.0", // app version, not SDK version
preamble = PREAMBLE, // const &str
tools = [client::Tool1, client::Tool2],
namespaces = [] // required field; [], ["evm-core"], or SVM namespace sets
);Common mistakes:
- Trailing comma after
namespaces = []— fine, but make sure it's there if you copy-paste. preamble = "..."inline string instead ofpreamble = PREAMBLEconst reference. Both work; const is preferred for long preambles.- Forgetting the
namespacesfield entirely — required by the current SDK.
macOS codesigning failure
Symptoms:
- Build error like
codesign failed: errSecInternalComponentorunable to sign cdylib.
Cause:
- macOS requires cdylibs to be signed before they can be loaded.
aomi-build compilerunscodesignautomatically; this can fail if Xcode CLI tools are missing or the keychain is locked.
Fix:
# Confirm Xcode CLI tools are installed
xcode-select -p
# If missing:
xcode-select --install
# If keychain is locked:
security unlock-keychain login.keychainThen retry the build. For CI, ensure the runner has codesigning capability or use --target to build for a non-Apple platform.
Runtime / Host
Plugin rejected at host load: SDK version mismatch
Symptoms:
- Host log:
plugin <name> rejected: aomi_sdk_version 0.1.14 does not match host 0.1.15.
Cause:
- The plugin was built against an older (or newer)
aomi-sdkthan the host. The host enforces an exact-match version gate.
Fix:
# Pull the latest aomi-sdk
git -C ../aomi-sdk pull
# Rebuild ALL apps — the version gate is repo-wide
cargo run -p aomi-sdk --features cli --bin aomi-build -- compile --releaseA single app rebuild is not enough if other apps in the runtime also need to load. The hosted runtime treats SDK drift as a coordinated rebuild event — see docs/sdk-version-compatibility.md.
Plugin loads but tool calls return empty/null
Symptoms:
- Host loads the plugin successfully.
aomi app currentshows the right tools.- Calling a tool returns nothing or
{}.
Cause: Several:
- The tool's
runreturnedOk(Value::Null)orOk(json!({}))— check the implementation. - The HTTP client succeeded but response deserialization silently produced an empty struct (loose
serdedefaults). - For async tools:
complete()was never called, onlyemit().
Fix:
- Add a temporary
eprintln!("response: {:?}", raw_response)before the JSON conversion inclient.rs. - Confirm the upstream response shape matches your typed model. Run with
RUST_LOG=debugif the SDK exposes it. - For async tools, audit
run_asyncfor a path that emits without ever completing. Every async tool must eithercomplete()once or returnErr(...).
Tool implementation
JsonSchema derive failure
Symptoms:
error[E0277]: the trait bound `MyType: JsonSchema` is not satisfiedCause:
- A field in
MyArgsis a custom type that doesn't implementJsonSchema. The derive needs every field to be deriveable.
Fix:
Add the derive on the inner type:
#[derive(Debug, Deserialize, JsonSchema)]
pub struct MyArgs {
pub config: NestedConfig, // NestedConfig must also derive JsonSchema
}
#[derive(Debug, Deserialize, JsonSchema)]
pub struct NestedConfig {
pub field: String,
}For std/external types that don't have it (bigdecimal::BigDecimal, chrono::DateTime, etc.) — represent them as String in the args struct and parse inside the tool. Schemars-compatible features for some crates (schemars with chrono feature) work but tie you to specific versions.
Args deserialization fails at runtime
Symptoms:
- Tool called by the LLM returns
Err("missing field 'symbol'")orErr("invalid type: string, expected u32").
Cause:
- The LLM produced args that don't match your
Argsstruct. Common reasons: required field marked as required in schema but the LLM omitted it; type mismatch from prose-style numeric strings.
Fix:
Make optional fields explicitly optional and add doc comments that guide the LLM:
#[derive(Debug, Deserialize, JsonSchema)]
pub struct GetDepthArgs {
/// Trading pair symbol in uppercase, no separator (e.g., "BTCUSDT", "ETHUSDT").
pub symbol: String,
/// Optional. Number of price levels to return. Valid values: 5, 10, 20, 50, 100, 500, 1000, 5000. Default 100.
#[serde(default)]
pub limit: Option<u32>,
}Doc comments become part of the model-facing schema. Spell out valid values, units, and formats — they are the only signal the model has.
Async tool hangs / never completes
Symptoms:
- The host shows the tool as "in progress" indefinitely.
- No
emitorcompleteevents ever fire.
Cause: Several:
- The tool calls a blocking HTTP request that itself hangs (no timeout).
- Inner loop never reaches
sink.complete(...)because of an unhandled condition. IS_ASYNCset totruebut the tool implementsruninstead ofrun_async.
Fix:
Confirm
const IS_ASYNC: bool = true;is set, ANDrun_asyncis implemented (notrun).Add explicit timeouts to all HTTP calls:
reqwest::blocking::Client::builder() .timeout(Duration::from_secs(30)) .build()Audit every code path in
run_async— does each branch call eithersink.complete(...)or returnErr(...)? A loop with no exit condition will hang silently.Add
is_canceled()checks at loop boundaries:loop { if sink.is_canceled() { return Ok(()); } // ... work ... }
Tool returns successfully but routes don't fire
Symptoms:
- Tool returns a
ToolReturn::with_routes(value, [...])envelope. - The runtime acknowledges the tool result but never invokes the routed-to tool.
Cause: Several:
- The route's
toolfield references a tool name that doesn't exist (typo, or the tool isn't registered). - For
OnBoundEventroutes: the alias never resolves because no upstream step published it viabind_as. - The app's
namespaces = []doesn't include"evm-core", so host tool references in routes are not authorized.
Fix:
- Confirm
namespaces = ["evm-core"]in the manifest. - For
OnSyncReturnroutes: confirm thetoolfield matches an exported tool name exactly. For host tools, prefer typed markers such asRouteStep::on_return_to::<host::EvmCommitMessage>(args)orhost::CommitTxsto catch typos at compile time. - For
OnBoundEventroutes: trace the alias chain. The earlier step that publishes viabind_as("foo")must execute and complete before a later step bound to"foo"can fire. Check the order of routes in thewith_routes([...])array. - Inspect the host's event log: it logs every
OnBoundEventresolution and any unresolved aliases at session end.
Testing
run_tool fails with "args type mismatch"
Symptoms:
- Test code:
run_tool::<MyTool>(&MyApp, json!({"foo": "bar"}), ctx)? - Error:
expected MyArgs, got Value::Object.
Cause:
- The args you passed don't deserialize into
MyTool::Args. Same as runtime — but easier to catch in tests.
Fix:
Construct the args with the typed struct first, then serialize:
let args = json!(MyArgs {
foo: "bar".to_string(),
optional_field: None,
});
let result = run_tool::<MyTool>(&MyApp, args, ctx)?;This catches missing fields and type mismatches at compile time rather than runtime.
run_async_tool returns no updates
Symptoms:
let (updates, terminal) = run_async_tool::<...>(...).updatesis empty.
Cause:
- The async tool went straight to
complete()without anyemit()calls. Or the test runs faster than the tool's polling loop.
Fix:
Check whether updates.is_empty() is actually a bug or expected for this tool. Many async tools have legitimate fast paths — e.g. job already complete on first poll. Adjust the assertion to allow >= 0 updates and only require terminal.value to be correct.
For tools that should always emit at least one progress update, audit the implementation — they may have a synchronous fast path that should be split into a separate sync tool.
Manifest / Workspace
"package not found in workspace" when compiling an app
Symptoms:
cargo build --manifest-path apps/<name>/Cargo.tomloraomi-build compile --app <name>errors withpackage <name> not found in workspace.
Cause:
- The app is not in the workspace's expected app layout, or it was copied by hand without matching the current app manifest conventions.
Fix:
The aomi-sdk workspace excludes app crates by default because they build as cdylibs separately. Add the new app to exclude if your current checkout still requires it:
# Cargo.toml (workspace root)
[workspace]
exclude = [
"apps/<existing>",
"apps/<your-new-app>", # add this
]aomi-build init <name> handles the current scaffold shape. If you scaffolded by copying instead, compare against a freshly generated app.
Two apps with the same name = "..." in dyn_aomi_app!
Symptoms:
- Both apps build successfully.
- Host loads only one of them; the other is silently shadowed.
Cause:
- The
namefield indyn_aomi_app!is the runtime identifier and must be unique across all loaded plugins.
Fix:
Change one of the names:
dyn_aomi_app!(
app = client::MyApp,
name = "my-app", // must be unique
...
);The crate name (Cargo.toml [package].name) and the app name don't have to match, but it's a good convention to keep them aligned.
Diagnostic Checklist
When something doesn't work, run through these in order:
-
aomi-sdkrepo is on the latest commit (git -C ../aomi-sdk log -1)? - SDK version in
sdk/Cargo.tomlmatches the host'sAOMI_SDK_VERSION? -
aomi-build compile --app <name>sees the app? - App package metadata does not set
[package.metadata.aomi.skip]unless intentionally skipped? -
dyn_aomi_app!has all required fields includingnamespaces? - Every
Argsstruct derivesDeserialize + JsonSchema? - Async tools set
const IS_ASYNC: bool = trueAND implementrun_async(notrun)? - Every async tool path either calls
complete()or returnsErr(...)? - HTTP clients have explicit timeouts?
- For wallet-handoff tools:
namespaces = ["evm-core"]and routes use typedhost::*markers? - For deprecated patterns: no remaining
SYSTEM_NEXT_ACTIONstrings, no prose-only "next_step" hints?