Skip to content

Normalize Python trace agent types#120

Merged
sebzhao merged 1 commit into
mainfrom
codex/python-trace-agent-type-normalization
May 12, 2026
Merged

Normalize Python trace agent types#120
sebzhao merged 1 commit into
mainfrom
codex/python-trace-agent-type-normalization

Conversation

@xTRam1
Copy link
Copy Markdown
Contributor

@xTRam1 xTRam1 commented May 12, 2026

Summary

  • normalize narada-pyodide sub-agent trace events so SDK enum agents emit frontend-compatible string agent types such as operator instead of legacy numeric values like 2
  • make narada-core trace parsing backward-compatible with already-persisted numeric agent_type values in Python sub-agent and Agent Studio agent traces
  • add public TypedDict coverage for pythonAgentRun traces and keep Pyodide emission regression coverage in the existing Cloud Browser test file
  • bump publish versions: narada-core 0.0.23, narada-pyodide 0.0.52, and narada 0.1.53a2

Why

Deep nested Python APA traces in Cloud Browser can return nested pythonAgentRun traces whose subAgentCall.agent_type is the SDK enum value 2. The trace parser expects the frontend trace contract (operator, generalist, coreAgent, or slash command strings), so parsing fails before the nested trace can complete.

Validation

  • uv run pytest packages/narada-pyodide/tests packages/narada/tests -q
  • uv run ruff check $(git ls-files '*.py')\n- uv run ruff format --check $(git ls-files '*.py')\n- python -m compileall -q packages/narada-core/src packages/narada-pyodide/src packages/narada-pyodide/tests\n\nNote: whole-repo uv run ruff check . currently walks the untracked .worktrees/ directory in this checkout, so I validated tracked Python files directly.

@xTRam1 xTRam1 changed the title [codex] Normalize Python trace agent types Normalize Python trace agent types May 12, 2026
@xTRam1 xTRam1 marked this pull request as ready for review May 12, 2026 22:23
@xTRam1 xTRam1 force-pushed the codex/python-trace-agent-type-normalization branch from 431facc to cfd6449 Compare May 12, 2026 22:26
Copy link
Copy Markdown
Contributor

@sebzhao sebzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sebzhao sebzhao merged commit d2e72c5 into main May 12, 2026
5 checks passed
@sebzhao sebzhao deleted the codex/python-trace-agent-type-normalization branch May 12, 2026 22:51
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.

2 participants