Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bf88cf2
feat: add agent preview trace delete command
WillieRuemmele Apr 30, 2026
05aa65d
chore: cleanup
WillieRuemmele Apr 30, 2026
dae86e0
feat: rename to agent trace delete, replace --api-name/--authoring-bu…
WillieRuemmele Apr 30, 2026
0872b94
Merge branch 'wr/listTraces' into wr/deleteTraces
WillieRuemmele Apr 30, 2026
d14d199
feat: add agent trace read command
WillieRuemmele Apr 30, 2026
4eca978
feat: add NUTs for agent trace read
WillieRuemmele Apr 30, 2026
64eb2dd
feat: add NUTs for agent trace delete
WillieRuemmele Apr 30, 2026
2a5a62f
fix: regenerate command snapshot after rebase
WillieRuemmele Apr 30, 2026
ca2a3bc
Merge branch 'wr/deleteTraces' into wr/readTraces
sreckomileta May 8, 2026
32a5448
Merge branch 'main' into wr/readTraces
WillieRuemmele May 8, 2026
79ec729
chore: merge main, resolve conflict, bump agents
WillieRuemmele May 8, 2026
1e32f60
fix(nuts): pass cwd to all preview execCmd calls so session cache is …
WillieRuemmele May 8, 2026
e9c21f9
fix(trace): scan .sfdx/agents on disk to find ended sessions
WillieRuemmele May 8, 2026
eb464aa
fix(trace): fall back to trace file order when turn index has no planId
WillieRuemmele May 8, 2026
1011ea2
Merge pull request #411 from salesforcecli/wr/readTraces
WillieRuemmele May 8, 2026
ad87965
Merge branch 'wr/listTraces' into wr/deleteTraces
WillieRuemmele May 8, 2026
7852aa4
chore: resovle conflicts
WillieRuemmele May 8, 2026
1e6c25a
chore: merge branches, resolve conflicts
WillieRuemmele May 8, 2026
47c3097
fix(trace): extract shared session scanner and fix trace list NUT cwd
WillieRuemmele May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@
],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:trace:delete",
"flagAliases": [],
"flagChars": ["a"],
"flags": ["agent", "flags-dir", "json", "no-prompt", "older-than", "session-id"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:trace:list",
Expand All @@ -262,6 +270,14 @@
"flags": ["agent", "flags-dir", "json", "session-id", "since"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:trace:read",
"flagAliases": [],
"flagChars": ["d", "f", "s", "t"],
"flags": ["dimension", "flags-dir", "format", "json", "session-id", "turn"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:validate:authoring-bundle",
Expand Down
87 changes: 87 additions & 0 deletions messages/agent.trace.delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# summary

Delete agent preview trace files.

# description

Deletes trace files recorded during agent preview sessions. By default, shows a preview of what will be deleted and prompts for confirmation. Use --no-prompt to skip confirmation.

Without filters, deletes all traces for all agents and sessions. Use flags to narrow the scope: filter by agent name (--agent), by session (--session-id), or by age (--older-than).

# flags.agent.summary

Only delete traces for this agent name (substring match). Matches against the name used when starting the session, whether that's an authoring bundle or a published agent API name.

# flags.session-id.summary

Only delete traces from this session ID.

# flags.older-than.summary

Only delete traces older than this duration. Accepts a number followed by a unit: m/minutes, h/hours, d/days, w/weeks (e.g. 7d, 24h, 2w).

# flags.no-prompt.summary

Skip the confirmation prompt and delete immediately.

# error.invalidOlderThan

Invalid --older-than value: '%s'. Use a number followed by a unit: m/minutes, h/hours, d/days, w/weeks (e.g. 7d, 24h, 30m, 2w).

# prompt.confirm

Delete %s trace file(s)? This cannot be undone.

# output.noneFound

No trace files matched the specified filters.

# output.preview

Found %s trace file(s) to delete:

# output.cancelled

Deletion cancelled.

# output.deleted

Deleted %s trace file(s).

# output.tableHeader.agent

Agent

# output.tableHeader.sessionId

Session ID

# output.tableHeader.planId

Plan ID

# examples

- Delete all traces for all agents and sessions (with confirmation prompt):

<%= config.bin %> <%= command.id %>

- Delete all traces for a specific agent:

<%= config.bin %> <%= command.id %> --agent My_Agent

- Delete traces from a specific session:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>

- Delete traces older than 7 days:

<%= config.bin %> <%= command.id %> --older-than 7d

- Delete traces older than 24 hours for a specific agent, no prompt:

<%= config.bin %> <%= command.id %> --agent My_Agent --older-than 24h --no-prompt

- Delete all traces without confirmation:

<%= config.bin %> <%= command.id %> --no-prompt
171 changes: 171 additions & 0 deletions messages/agent.trace.read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# summary

Read and analyze trace files from an agent preview session.

# description

Reads trace files recorded during an agent preview session and outputs them in one of three formats.

**--format summary** (default): A per-turn narrative showing topic routing, actions executed, and the agent's response. Use this to quickly understand what happened in a session.

**--format detail**: Diagnostic drill-down into a specific dimension (--dimension required). Filters output to only the trace steps relevant to that dimension, minimizing noise.

**--format raw**: Unprocessed trace JSON. Use this as a fallback when the trace schema has changed or you need to perform custom analysis.

Available dimensions for --format detail: actions, grounding, routing, errors.

Use --turn N to scope output to a single conversation turn.

# flags.session-id.summary

Session ID to read traces for.

# flags.format.summary

Output format: summary (default), detail, or raw. Use detail with --dimension to drill into a specific aspect of the trace.

# flags.dimension.summary

Dimension to drill into when using --format detail. One of: actions, grounding, routing, errors. Required when --format is detail.

# flags.turn.summary

Scope output to this conversation turn number.

# error.detailRequiresDimension

--format detail requires --dimension. Specify one of: actions, grounding, routing, errors.

# error.sessionNotFound

Session '%s' was not found in the local session cache. Run "sf agent trace list" to see available sessions.

# error.turnIndexNotFound

No turn index found for session '%s'. Cannot filter by --turn without a turn index.

# error.turnNotFound

Turn %s was not found in session '%s'.

# error.parseFailedAll

Trace parsing failed for all files: %s. The trace schema may have changed. Try --format raw to access unprocessed trace data.

# warn.dimensionIgnored

--dimension is ignored when --format is '%s'. Use --format detail to drill into a dimension.

# warn.parseFailed

Trace parsing failed for some files (skipped): %s. Try --format raw to access unprocessed trace data.

# output.empty

No traces found for this session.

# output.emptyDimension

No '%s' data found in the traces for this session.

# output.tableHeader.turn

Turn

# output.tableHeader.topic

Topic

# output.tableHeader.userInput

User Input

# output.tableHeader.agentResponse

Agent Response

# output.tableHeader.actionsExecuted

Actions Executed

# output.tableHeader.latencyMs

Latency

# output.tableHeader.error

Error

# output.tableHeader.action

Action

# output.tableHeader.input

Input

# output.tableHeader.output

Output

# output.tableHeader.prompt

Prompt

# output.tableHeader.response

Response

# output.tableHeader.intent

Intent

# output.tableHeader.fromTopic

From Topic

# output.tableHeader.toTopic

To Topic

# output.tableHeader.source

Source

# output.tableHeader.errorCode

Error Code

# output.tableHeader.message

Message

# examples

- Show a session summary (all turns):

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID>

- Show summary for a single turn:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --turn 2

- Drill into action execution across all turns:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension actions

- Drill into routing decisions for a specific turn:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension routing --turn 1

- Show all errors across the session:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format detail --dimension errors

- Output raw trace JSON for custom parsing:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --format raw

- Return results as JSON:

<%= config.bin %> <%= command.id %> --session-id <SESSION_ID> --json
28 changes: 28 additions & 0 deletions schemas/agent-trace-delete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/AgentTraceDeleteResult",
"definitions": {
"AgentTraceDeleteResult": {
"type": "array",
"items": {
"type": "object",
"properties": {
"agent": {
"type": "string"
},
"sessionId": {
"type": "string"
},
"planId": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": ["agent", "sessionId", "planId", "path"],
"additionalProperties": false
}
}
}
}
Loading
Loading