Skip to content

chore: add lcm lifecycle instrumentation logs#345

Merged
jalehman merged 3 commits into
mainfrom
lorde-b03ad6bb-lcm-lifecycle-overhead-deep-di
Apr 9, 2026
Merged

chore: add lcm lifecycle instrumentation logs#345
jalehman merged 3 commits into
mainfrom
lorde-b03ad6bb-lcm-lifecycle-overhead-deep-di

Conversation

@jalehman

@jalehman jalehman commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

What

Add lifecycle instrumentation to lossless-claw so live OpenClaw traces show where time is spent during engine initialization and per-turn context handling.

Why

We were investigating ongoing message latency and needed enough visibility to separate one-time startup work from per-message overhead. The existing logs were not sufficient to tell whether LCM was responsible for the slow path.

Changes

  • Add engine init and migration timing logs
  • Add per-migration-step timing logs
  • Add session queue wait timing logs
  • Log bootstrap and reconcile path decisions
  • Log maintain, assemble, and afterTurn timing
  • Keep startup banner dedupe test focused

Testing

  • npx vitest run test/session-operation-queues.test.ts test/plugin-config-registration.test.ts test/migration.test.ts
  • Expected: all 39 tests pass

@jalehman jalehman force-pushed the lorde-b03ad6bb-lcm-lifecycle-overhead-deep-di branch 2 times, most recently from debd492 to c706865 Compare April 9, 2026 20:49
jalehman added 2 commits April 9, 2026 14:10
Add lifecycle timing logs for LCM engine init, migrations, bootstrap,
maintain, assemble, and afterTurn so live OpenClaw traces can show where
latency is actually spent. Route migration step timing through the same
logger and keep the startup-banner test focused on banner deduping now
that the lifecycle markers emit at info level.

Regeneration-Prompt: |
  Investigate an LCM latency memo claim about process-global startup work
  and add instrumentation that can separate one-time engine initialization
  from per-turn overhead in a live OpenClaw deployment. Use the project's
  existing logging conventions rather than introducing a new sink. Measure
  engine initialization, migration steps, queue wait time, bootstrap,
  reconcileSessionTail outcomes, maintain, assemble, and afterTurn so the
  logs can bracket the full lifecycle for a real message. Promote the new
  markers to info level if the gateway's debug path is not reliably visible
  in production logs, and update the affected registration test so it still
  verifies startup-banner deduping without assuming the full info log set is
  limited to the banner lines.
@jalehman jalehman force-pushed the lorde-b03ad6bb-lcm-lifecycle-overhead-deep-di branch from c706865 to 82d6b7a Compare April 9, 2026 21:11
Preserve the migration ordering needed to drop a stale summaries_fts_cjk
table before standalone FTS probing runs. This keeps malformed legacy CJK
shadow tables from poisoning the self-heal probe path during migration.

Regeneration-Prompt: |
  After rebasing the LCM lifecycle instrumentation branch onto a newer main,
  rerun the focused migration tests. If the test covering stale
  summaries_fts_cjk cleanup fails again, restore the ordering that removes the
  stale CJK table before other standalone FTS probing occurs. Keep the newer
  standalone FTS self-heal helpers and instrumentation intact; only correct
  the ordering regression so malformed legacy CJK tables cannot break the
  migration probe path.
@jalehman jalehman merged commit c761a23 into main Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant