fix(core): add FlowLogger parity for Microsoft CUA

Closed
BA
7mo ago
+153-0

Title
fix(core): add FlowLogger parity for Microsoft CUA

Description

why

MicrosoftCUAClient was the only CUA provider not emitting FlowLogger LLM
request/response events.
OpenAI, Google, and Anthropic clients already emit these events, so
Microsoft CUA lacked observability parity.

what changed

  • Added FlowLogger imports and request/response logging to
    MicrosoftCUAClient:
    • FlowLogger.logLlmRequest(...) before the model call
    • FlowLogger.logLlmResponse(...) after a successful response
  • Added request ID correlation via uuidv7 so request/response pair
    correctly in logs.
  • Kept existing execution behavior unchanged (logging-only change).
  • Added unit tests for Microsoft CUA logging behavior:
    • emits request + response on success
    • emits only request when the model call fails

test plan

  • prettier --check on touched files
  • eslint on touched files
  • tsc -p packages/core/tsconfig.json --noEmit
  • Added unit test file:
    • packages/core/tests/unit/microsoft-cua-client.test.ts

Summary by cubic

Add LLM request/response logging to MicrosoftCUAClient to match other providers and improve observability. This brings Microsoft CUA to parity with OpenAI, Google, and Anthropic clients.

  • Bug Fixes
    • Emit FlowLogger.logLlmRequest before the model call and FlowLogger.logLlmResponse after success.
    • Correlate events with a requestId using uuid v7.
    • No behavior changes to execution; logging-only.
    • Added unit tests for success (request + response) and failure (request only).