Skip to content

[feat] agent: show conversation-wide execution traces (#407) - #409

Open
yefuyou wants to merge 4 commits into
ThinkFlowLab:mainfrom
yefuyou:feat/407-conversation-trace
Open

yefuyou wants to merge 4 commits into
ThinkFlowLab:mainfrom
yefuyou:feat/407-conversation-trace

Conversation

@yefuyou

@yefuyou yefuyou commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements #407, the conversation-wide Agent Trace view requested by @FayeSpica in the approved review of #374:

As a follow-up, could we show all turns in a conversation on one trace page, like DSH does?

A single Trace page now groups all executed turns for the selected conversation, with per-turn expansion and lazy-loaded native/model logs and the linked generation Jobs introduced in #374.

Changes

  • Read-only API: GET .../assistant/conversations/{id}/trace returns turns in conversation order, including a bounded user-text preview, runtime, model and status. It resolves active and archived conversations and existing reusedCreateIds aliases without activating a conversation, taking an edit lease or loading JSONL bodies.
  • Legacy links: GET .../assistant/traces/{turn}/conversation locates the conversation associated with an old single-turn link. If no conversation is found, the previous single-turn view remains available.
  • Stable turn identity: Matches a user message ID with its assistant message identified by uuid5(user_id, 'assistant'), rather than assuming messages always alternate. Queued/unexecuted messages and orphan replies are not presented as executed turns.
  • Conversation UI: Per-turn sections with expandable details and on-demand fetching of traces and linked Jobs; previously fetched historical turns are reused. Each turn selects its own runtime normalizer. Raw model requests remain available for Default runtime where supported.
  • Deep links and i18n: Existing trace links now include the conversation ID and retain the selected turn. English and Chinese labels are included.

The existing TraceEntries, TraceRow, TraceJobs, normalizers and #374 job-lineage endpoint remain unchanged.

Screenshots

The screenshots use DEMO data from a local provider double, not live model execution.

English 中文
Conversation Trace, EN Conversation Trace, ZH
Linked Jobs, EN Linked Jobs, ZH

Narrow viewport checks: EN · 中文

Verification

Reported against fork HEAD 2de2acc0:

  • Passed: 47 relevant Python tests across three test files (rerun on the final commit); lint-imports; tsc --noEmit; check:i18n (3,244 keys, 0 issues); git diff --check.
  • Browser: Headless Chromium against running FastAPI and Vite with demo data. Reviewed EN/ZH screenshots, turn expansion, linked Jobs (including success/error), deep links, legacy fallback, archive separation, refresh and 420px layout. A missing-log 404 is expected for the demo turn without a trace file.
  • npm test (upstream GitHub Actions, verified from raw job logs): 932/932 passed, 0 failed on PR head 2de2acc0 (PR frontend job). The same command (node --test tests/*.test.ts) passed 929/929, 0 failed on upstream base ab3f0585 (base frontend job). These match the three added frontend tests. A separate earlier local run reported 930/932, but its failing test names/stack traces were not supplied; the failures are not reproduced in GitHub CI and have not been established as pre-existing baseline failures. No code change is warranted on that evidence alone.
  • Not verified: pre-commit hooks (hook repositories unavailable in the environment), live-running-turn polling in the browser, and FFmpeg-dependent tests.
  • No paid/provider calls. Execution evidence is explicitly demo/provider-double data, not a real model run.

Scope and compatibility

The change is limited to the read-only conversation Trace experience. It does not modify generation, editing leases, accepted Job execution, recovery, or the execution behavior being developed in #375 (edit/resend), #379 / #381 (queued messages), and #402 / #403 (in-turn insertion). The open PR data shapes were not individually exercised in this branch.

Fixes #407
Refs #374, #372, #261.

@github-actions github-actions Bot added area:agent Agent runtime, assistant chat and tools type:feat New capability or behaviour labels Nov 19, 2026
@github-actions
github-actions Bot requested review from FayeSpica and wuzhf9 November 19, 2026 11:52
No source changes. The isolated browser check failed before running tests because the GitHub-hosted runner could not download libvpx7 and libx264-163 from the Ubuntu mirrors (apt exit 100).

yefuyou commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

CI rerun note for reviewers: the previous checks / browser (isolated) job failed during Ubuntu package installation, before any browser assertions ran. The runner could not download libvpx7 / libx264-163 due to azure.archive.ubuntu.com connection timeouts (apt exit 100); the remaining substantive lanes, including frontend 932/932, Python, CodeQL, and assistant/voice browser tests, passed.

I do not have permission to rerun the upstream workflow directly, so I pushed an empty-tree commit 96e74159 solely to retrigger checks. It has exactly the same file tree as 2de2acc0; no implementation or test files changed. Please review the new CI run rather than treating the original apt mirror error as a product test failure.

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: show all turns of a conversation on one Trace page

2 participants