Skip to content

fix(knowledge): always write agent trace JSONL for transcript reconstruction (fixes #507)#512

Open
mickume wants to merge 1 commit intodevelopfrom
fix/issue-507-agent-trace-missing
Open

fix(knowledge): always write agent trace JSONL for transcript reconstruction (fixes #507)#512
mickume wants to merge 1 commit intodevelopfrom
fix/issue-507-agent-trace-missing

Conversation

@mickume
Copy link
Copy Markdown
Contributor

@mickume mickume commented Apr 22, 2026

Summary

Removed the debug-only gate on AgentTraceSink registration so that trace JSONL files are written on every orchestrator run, not just debug runs. Removed the trace_enabled guard in _extract_knowledge_and_findings so transcript reconstruction is always attempted. This makes the trace-based extraction path (113-REQ-1.1) live in production — previously it was dead code because the trace file was never written in normal runs.

Closes #507

Changes

File Change
agent_fox/engine/run.py Always register AgentTraceSink in SinkDispatcher (removed if debug: guard); pass trace_enabled=True to factory
agent_fox/engine/session_lifecycle.py Change trace_enabled default from False to True; remove if self._trace_enabled: guard in _extract_knowledge_and_findings
agent_fox/knowledge/agent_trace.py Updated docstring ("debug run" → "orchestrator run")

Tests

  • All 5249 existing tests pass — no regressions
  • Existing tests/unit/knowledge/test_transcript_reconstruction.py covers both the happy path and the fallback when trace is absent

Verification

  • All existing tests pass: ✅
  • New tests pass: ✅ (existing coverage sufficient)
  • Linter / formatter: ✅
  • No regressions: ✅

Auto-generated by af-fix.

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.

1 participant