Skip to content

Add agent execution tracing and structured logging #38

Description

@Syedumer-97

Summary

CortexON currently lacks a unified execution tracing mechanism across agent runs. This makes debugging, observability, and future replay difficult.

This issue proposes adding:

  • A run_id per user request
  • A step_id per agent/tool execution
  • Structured logs correlated via these IDs
  • Integration with Pydantic Logfire

Motivation

  • Debugging multi-agent workflows
  • Observability in production
  • Agent behavior introspection
  • Foundation for future replay & analytics

Proposed Design

TraceContext

A lightweight context object containing:

  • run_id
  • agent_name
  • step_id
  • tool_name (optional)

Logging

  • Structured JSON logs
  • Every log includes run_id and step_id
  • Configurable via ENV

Scope (Initial)

  • Backend only
  • No persistence (in-memory / logs only)
  • No breaking changes

Acceptance Criteria

  • Each request generates a run_id
  • Each agent action generates a step_id
  • Logs are structured and correlated
  • Minimal performance impact

Future Work

  • Trace persistence
  • Frontend visualization
  • Execution replay

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions