Skip to content

@W-22167805@ Add trace session utilities (listSessionTraces, readSessionTrace, readTurnIndex)#273

Open
WillieRuemmele wants to merge 2 commits intomainfrom
wr/listTraces
Open

@W-22167805@ Add trace session utilities (listSessionTraces, readSessionTrace, readTurnIndex)#273
WillieRuemmele wants to merge 2 commits intomainfrom
wr/listTraces

Conversation

@WillieRuemmele
Copy link
Copy Markdown
Member

@WillieRuemmele WillieRuemmele commented Apr 30, 2026

Work Item

@W-22167805@

Summary

Adds utility functions to the agents library for local trace file access, supporting the sf agent trace commands in plugin-agent.

Changes

  • listSessionTraces(agentId, sessionId) — lists all trace files for a session with metadata (planId, path, size, mtime)
  • readSessionTrace(agentId, sessionId, planId) — reads a single trace file by planId, returns PlannerResponse | null
  • readTurnIndex(agentId, sessionId) — reads turn-index.json for a session, returns TurnIndex | null
  • Exports PlannerResponse, PlanStep, FunctionStep, TurnIndex, TurnIndexEntry types (previously unexported)

Files Changed

  • src/utils.ts
  • src/index.ts

Test Plan

  • npm run build passes cleanly
  • All functions exercised via esmock stubs in plugin-agent consumer tests
  • Consumed by plugin-agent PR (see dependent PR)

@WillieRuemmele WillieRuemmele changed the title @W-21785101@ add listSessionTraces utility @W-22167805@ Add trace session utilities (listSessionTraces, readSessionTrace, readTurnIndex) Apr 30, 2026
Copy link
Copy Markdown
Contributor

@EstebanRomero84 EstebanRomero84 left a comment

Choose a reason for hiding this comment

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

Looks good. Can you add UTs for the new utility functions?

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