diag(TEMP): stderr trace span IDs through chat.message + session.idle

Merged
AL
5mo ago
+26-3

rc4 trace inspection still showed orphan turn parent despite the new async shutdown hook + forceFlush running cleanly (forceFlush done in 0ms). Need granular instrumentation: which span did chat.message create? did session.idle find and end it? did session.idle's forceFlush actually export it? Adds stderr writes covering both branches. Will be removed in the cleanup commit before v0.1.8 proper.


Summary by cubic

Add temporary stderr logs in bcode-laminar to trace turn span IDs across chat.message, session.idle, and server.instance.disposed. This helps debug orphan turn parent spans and confirm forceFlush/export behavior.

  • New Features
    • chat.message: log created turn span ID and session; log skip when subagent or an open span exists.
    • session.idle: log ending span ID and session; time forceFlush; log errors; log when no span exists and still forceFlush.
    • server.instance.disposed: log count of open turn spans ended.
    • Temporary diagnostics; will be removed before v0.1.8.