You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(logging): audit ai-agent and conversation crates for sentry-ready logs (#257)
Pre-release logging audit. Runtime log level is info and user-reported
issues only upload logs once, so every error/warn must carry enough
context to diagnose from a single shot.
Common:
- Add aionui_common::ErrorChain to render std::error::Error::source()
chains as "outer: inner1: inner2" in one log field. All error! / warn!
callers switch to ErrorChain so nested AppError / sqlx / tungstenite
causes stop being swallowed.
Conversation:
- stream_relay.rs: wrap consume() + persistence/broadcast helpers in
#[instrument(skip_all, fields(conversation_id, msg_id))]. All 12
repository error! calls now carry the full span context, removing
the "Failed to update streaming message" floaters that were unlinkable
to a specific turn.
- service.rs: add #[instrument] to create/get/list/update/delete/reset/
update_extra/send_message/cancel/warmup/create_acp_session_row with
user_id + conversation_id. CRUD success emits info so Sentry can
reconstruct the lifecycle. send_message logs per-step (user message
persisted → agent task ready → stream dispatched). model-change kill
path is no longer silent (let _ = → explicit warn on failure).
insert_message / status write / agent.cancel failures emit warn with
ErrorChain before propagating.
AI-agent:
- spawn_sdk.rs / spawn_legacy.rs: promote spawn / spawned / exit from
debug to info so subprocess lifecycle is visible under info. Back-fill
error logs on all four ok_or_else stdio/PID capture sites.
- manager/acp/agent.rs: #[instrument] on ensure_session_opened /
warmup_session / send_message / cancel. take_stdio ok_or_else gets
an error log. connect / kill errors use ErrorChain.
- protocol/acp.rs: broadcast send failure (event_tx.send) is no longer
ignored — logs at debug when no subscribers (expected post-turn).
- Other managers (aionrs / openclaw / remote / nanobot) + idle_scanner:
ErrorChain migration for existing error! / warn! calls. No structural
changes — these already carried conversation_id.
Verified: cargo check / clippy / test all green across the three
crates (common 65 + conversation 231 + ai-agent 337 tests passing).
0 commit comments