Skip to content

[feat] agent: export conversation traces as Markdown reports (#421) - #422

Open
yefuyou wants to merge 5 commits into
ThinkFlowLab:mainfrom
yefuyou:feat/421-trace-report-export
Open

yefuyou wants to merge 5 commits into
ThinkFlowLab:mainfrom
yefuyou:feat/421-trace-report-export

Conversation

@yefuyou

@yefuyou yefuyou commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements a deliberately small first slice of #421, following @FayeSpica's review request on merged PR #409.

  • Add Export report (.md) on the conversation-wide Trace page.
  • Fetch each executed turn's trace and linked Jobs from the existing read-only APIs, including collapsed turns. No new backend endpoint or trace storage.
  • Export turn metadata, safe event types/states only, and linked Job IDs/statuses. Missing logs and unavailable Jobs are marked explicitly; running Turns are marked as partial snapshots.
  • Intentionally omit raw model request files, prompts, system messages, tool arguments/results and asset bytes. User request previews and identifiers are included; review the report before sharing.
  • Put bounded per-source log/event summaries in the report. Large trace streams are read and decoded incrementally, stopped at the report limit and marked truncated; neither the normal Trace page nor provider execution changes.
  • Add zh-CN/en-US UI labels and focused fixture tests.

Format and boundaries

Markdown is the proposed first format for human-readable reports. Issue #421 asks whether maintainers would prefer machine-readable JSON; we can adjust that without rewriting the trace pipeline.

This PR does not implement the separate per-turn duration request, which should use authoritative server-side timestamps rather than inferred log timing.

Verification

  • Current head: cb3c537bd7f732368cd981b58c4f247df247effd. All 13 GitHub checks passed, including static, frontend, Python, three browser lanes, CodeQL and check aggregation.
  • Added deterministic tests covering mixed runtimes, linked Job status, missing/unavailable logs, Markdown escaping, sensitive payload omission, bounded/infinite streams, malformed/truncated input and read errors.
  • Added a real-browser .md download test for both en-US and zh-CN, wired into the PR browser gate. It verifies downloading the full four-turn conversation with only one turn expanded, mixed runtimes, missing/unavailable trace and Job states, secret redaction, empty/error UX and old deep links. The browser flow uses a local Agent fixture, with linked Job API responses stubbed; Job lineage is tested separately in tests/test_agent_job_lineage.py.
  • Local checks passed: TypeScript compile, build, i18n, browser manifest and locale checks, focused trace tests, and the new browser test. A broader local npm test run reported 960 passes / 2 failures that were not independently reproduced on main; CI on the submitted head is green.
  • No paid model/provider was called. No new business mutation, Job submission, or conversation lease.
  • Review notes: the PR adds one browser test to .github/workflows/release-checks.yml; live streaming-turn export and real-provider calls are not covered by the browser fixture.

Related

Fixes #421
Refs #409, #407, #374, #261.

Suggested labels: type:feat, area:agent.

yefuyou and others added 3 commits November 21, 2026 20:35
…ab#421)

Add a Markdown report export across all executed turns, with bounded event metadata and linked generation-job status. Omit raw model prompts and tool payloads.
Restore the Markdown escape replace after the HTML entity escaping so the file parses again (TS1005/TS1127).

This branch has not been deployed

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

Labels

area:agent Agent runtime, assistant chat and tools type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] agent: export conversation Trace as a report

2 participants