Mirror trace steps to the operational logger #32
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/per-step-logging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The trace JSONL captures every step of a research call (search, fetch, iteration boundaries, synthesis), but the structured operational log only fired at
research_started/research_completed. Administrators had no real-time visibility into agent progress.Change
TraceLogger.log_stepnow also emits a structlog event using the same action name, fields, and step counter.trace_idandresearcherare already bound in contextvars byWebResearcher.research, so every line carries them automatically — no plumbing needed at the call sites.Volume control
A curated set of milestone actions logs at INFO:
start,iteration_start,synthesis_start,synthesis_complete,synthesis_error,synthesis_build_error,budget_exhausted,completeChatty per-tool actions log at DEBUG:
web_search,web_search_complete,fetch_url,fetch_url_complete,agent_messageDefault
MARCHWARDEN_LOG_LEVEL=INFOshows ~9 lines per call.MARCHWARDEN_LOG_LEVEL=DEBUGshows everything (~13+ depending on tool calls). OpenSearch can ingest at DEBUG always.Verified end-to-end
"What is the highest peak in Utah?" at INFO:
Every line carried
trace_id=3152d79d-...andresearcher=webin the bound context.110/110 tests still passing.