Revert "[STG-1566] Flow logger schema and collection cleanup to prepare for Observability"

Merged
PI
8mo ago
+1286-1380

Reverts browserbase/stagehand#1824

See https://github.com/browserbase/stagehand/pull/1836 for context


Summary by cubic

Reverts the new flow-logging schema and event store, restoring the previous session file–based logger. Updates agents, handlers, and evals to use SessionFileLogger and removes the sessionId option from V3Options. This undoes the STG-1566 observability changes to stabilize logging.

  • Refactors

    • Remove packages/core/lib/v3/eventStore.ts and related wiring.
    • Restore SessionFileLogger in flowLogger.ts with helpers like formatCuaPromptPreview, formatLlmPromptPreview, logAction, and logStagehandStep.
    • Replace FlowLogger usage with SessionFileLogger across agents/handlers; update LLM clients (OpenAICUAClient, AnthropicCUAClient, GoogleCUAClient, AISdkClient) to log requests/responses with operation names.
    • Simplify Understudy/CDP instrumentation; remove FlowLogger context in cdp.ts; use logAction in page.ts.
    • Remove toTitleCase and log explicit action names (e.g., Understudy.<method>, Page.close).
    • Evals: switch to event-driven screenshot collection via the V3 event bus; drop interval polling.
    • Remove sessionId handling and related code in v3.ts.
  • Migration

    • Remove sessionId from V3Options if you were passing it.
    • Any direct uses of the reverted eventStore or the new observability schema are no longer available.