실제 제품을 적절한 조작 환경에서 실행해 변경 사항을 검증하고, 사용자가 확인할 수 있는 증거를 모아 인수 보고서로 게시합니다. 기존 검증 계획을 확인하거나 점검 항목을 만들고, `lh` CLI로 결과를 게시할 수 있습니다.
- 변경된 제품 동작을 실제로 확인하기
- 스크린샷 등 검증 증거 수집하기
- 검증 계획과 보고서 작성하기
작업 ID로 에이전트 실행 기록을 살펴 실패한 도구 호출과 인수·결과, 사용 가능한 도구, 실행 문맥과 대규모 언어 모델 입력을 확인합니다. 문맥 지도와 다른 모델로 기록을 재생해 비교하는 기능도 제공합니다.
Use for agent traces by operation ID (拉线上 tracing): failed tools, arguments/results, available tools, execution location, LLM calls and context.
실행 점수 미검증
설치 방법 보기이 스킬은 명령줄 도구로 에이전트 실행 스냅샷을 살펴 각 처리 단계에서 어떤 일이 있었는지 확인합니다. 작업 ID로 실행 기록을 열어 도구 호출과 결과, 대규모 언어 모델에 전달된 메시지, 실행 문맥, 사용 가능한 도구와 사용자 메모리를 확인할 수 있습니다. 개발 환경에서는 스냅샷이 .agent-tracing/에 저장되며, 실행이 끝나기 전의 중간 스냅샷도 조사할 수 있습니다. ctx-map은 각 대규모 언어 모델 호출의 문맥 구성과 이전 호출 이후 달라진 메시지 범위를 보여 줍니다. 기록된 호출을 다른 모델로 재생해 결과를 비교하는 기능도 있습니다.
에이전트의 도구 호출이 실패한 이유를 조사하거나 예상한 정보가 대규모 언어 모델에 전달되었는지 확인할 때 적합합니다. 모델별 응답을 비교하거나 장시간 목표 실행에서 어떤 작업 후보가 선택되었는지 추적할 때도 사용할 수 있습니다.
명령줄 도구는 코드 저장소의 루트에서 실행합니다. 압축 스냅샷을 읽으려면 Node 22.15 이상이 필요합니다. 원격 기록에 접근하는 방식에 따라 LobeHub 로그인, 인증 정보, TRACING_BASE_URL 설정이 필요할 수 있습니다. 기록에 없는 샘플링 설정에는 현재 기본값이 적용됩니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 26일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
@lobechat/agent-tracing is a zero-config local dev tool that records agent execution snapshots to disk and provides a CLI to inspect them.
In NODE_ENV=development, AgentRuntimeService.executeStep() automatically records each step to .agent-tracing/ as partial snapshots. When the operation completes, the partial is finalized into a complete ExecutionSnapshot JSON file.
Data flow: executeStep loop -> build StepPresentationData -> write partial snapshot to disk -> on completion, finalize to .agent-tracing/{timestamp}_{traceId}.json
Context engine capture: In RuntimeExecutors.ts, the call_llm executor calls ctx.tracingContextEngine(input, output, metadata) after serverMessagesEngine() processes messages. AgentRuntimeService.executeStep buffers the call per step and forwards it to OperationTraceRecorder.appendStep as the typed contextEngine field. CE flows through this side channel rather than the events array so its heavy payload (agentDocuments, systemRole, …) never enters the Redis state pipeline (LOBE-9110). metadata carries the pipeline's per-request decision records (trim stats, cache-warmth gates, truncation counts).
packages/agent-tracing/
src/
types.ts # ExecutionSnapshot, StepSnapshot, SnapshotSummary
store/
types.ts # ISnapshotStore interface
file-store.ts # FileSnapshotStore (.agent-tracing/*.json)
recorder/
index.ts # appendStepToPartial(), finalizeSnapshot()
viewer/
index.ts # Terminal rendering: renderSnapshot, renderStepDetail, renderMessageDetail, renderSummaryTable, renderPayload, renderPayloadTools, renderMemory
cli/
index.ts # CLI entry point (#!/usr/bin/env bun)
inspect.ts # Inspect command (default)
partial.ts # Partial snapshot commands (list, inspect, clean)
index.ts # Barrel exports
.agent-tracing/{ISO-timestamp}_{traceId-short}.json.agent-tracing/latest.json.agent-tracing/_partial/{operationId}.json.agent-tracing/_remote/{operationId}.jsonFileSnapshotStore resolves from process.cwd() — run CLI from the repo rootServer deployments also upload completed snapshots to object storage (zstd-compressed; the key is stored in agent_operations.trace_s3_key).
Preferred: lh trace op. The server resolves the key and signs the object for the caller's own scope, so a LobeHub login is the only requirement — no TRACING_BASE_URL, no bucket domain, and no SQL to turn a topic id into an operation id:
lh trace op list --topic tpc_xxx # operations of a topic, newest first, with a TRACE column
lh trace op inspect op_xxx_agt_xxx_tpc_xxx_xxxx
lh trace op inspect op_xxx_agt_xxx_tpc_xxx_xxxx -T # tool injection (enabledToolIds, manifests)
TRACE = — in list means no snapshot was recorded for that run (it predates trace upload, or upload was off). A recorded snapshot can still 404 in storage after its retention window.
Backend: the agentTrace lambda router (getSnapshotUrl / listOperations). Note it is blocked for restricted API keys, so these commands need a real session, not a scoped key.
Fallback: the standalone agent-tracing CLI. It has no LobeHub session, so it builds the object URL itself and needs the bucket's public domain configured:
TRACING_BASE_URL=https://<bucket-public-domain>/agent-traces.agent-tracing/.env in the repo root with the same TRACING_BASE_URL=... lineThe deployment-specific value is private to each deployment and intentionally not recorded in this repo. Find the operation id by hand first:
SELECT id, trace_s3_key FROM agent_operations WHERE topic_id = 'tpc_xxx';
Either way the snapshot is cached to .agent-tracing/_remote/<opId>.json, and every inspect flag works the same as for local traces.
Implementation: packages/agent-tracing/src/store/loadSnapshot.ts (resolution order: local store → _remote/ cache → injected resolveDownloadUrl → TRACING_BASE_URL) and store/remote-store.ts (URL built as {base}/{agentId}/{topicId}/{opId}.json.zst). Reading a compressed snapshot needs Node >= 22.15.
A goal is one complete goal execution the way an operation is one complete agent execution, so it gets the same trace format one level up: GoalTrajectory : AdvanceSnapshot mirrors ExecutionSnapshot : StepSnapshot. There is no table of advances, exactly as there is no agent_steps table — goal_traces holds one rollup row per goal plus the object key, and the detail lives in the object.
The leaves join back down: an advance records the operationIds it put in flight (on tick.effects[].operationId), so lh trace op inspect <opId> continues from where the goal trace stops.
agent-tracing goal # list local goal trajectories
agent-tracing goal goal_xxx # the run: triggers, outcomes, graph, gates, ops
agent-tracing goal goal_xxx -a 3 # one advance in full, with the frontier it ranked
agent-tracing goal goal_xxx -j # raw JSON
What each tick records is the decision input, not just the result: the graph it read (as a delta against the previous tick), the budget it evaluated, the responsible task's state, and every eligible work node including the ones it passed over. Without the losers a trace cannot answer "why not that node".
Storage follows the operation switch, so a deployment that keeps one keeps the other:
goal-traces/{goalId}.json.zstgoal-traces/_partial/{goalId}.json.zst (an unfinished long-horizon goal is the normal thing to inspect).goal-tracing/{goalId}.jsonReplay. replayGoalAgainstCurrentCoordinator(trajectory) re-runs the real decideNextMove over the recorded inputs and reports {advanceSeq, tickIndex, field, recorded, replayed} wherever the current coordinator would now choose differently. This reproduces the coordinator's decisions exactly; it says nothing about whether the dispatched work would have gone the same way.
Implementation: packages/agent-tracing/src/goal/, recorded through apps/server/src/services/goal/advanceGoal.ts (the single funnel every advance passes through) via the onDecision side channel on GoalService.tick.
All commands run from the repo root:
# View latest trace (tree overview, `inspect` is the default command)
agent-tracing
agent-tracing inspect
agent-tracing inspect <traceId>
agent-tracing inspect latest
# List recent snapshots
agent-tracing list
agent-tracing list -l 20
# Inspect specific step (-s is short for --step)
agent-tracing inspect <traceId> -s 0
# View messages (-m is short for --messages)
agent-tracing inspect <traceId> -s 0 -m
# View full content of a specific message (by index shown in -m output)
agent-tracing inspect <traceId> -s 0 --msg 2
agent-tracing inspect <traceId> -s 0 --msg-input 1
# View tool call/result details (-t is short for --tools)
agent-tracing inspect <traceId> -s 1 -t
# View raw events (-e is short for --events)
agent-tracing inspect <traceId> -s 0 -e
# View runtime context (-c is short for --context)
agent-tracing inspect <traceId> -s 0 -c
# View context engine input overview (-p is short for --payload)
agent-tracing inspect <traceId> -p
agent-tracing inspect <traceId> -s 0 -p
# View available tools in payload (-T is short for --payload-tools)
agent-tracing inspect <traceId> -T
agent-tracing inspect <traceId> -s 0 -T
# View user memory (-M is short for --memory)
agent-tracing inspect <traceId> -M
agent-tracing inspect <traceId> -s 0 -M
# Raw JSON output (-j is short for --json)
agent-tracing inspect <traceId> -j
agent-tracing inspect <traceId> -s 0 -j
# List in-progress partial snapshots
agent-tracing partial list
# Inspect a partial (use `inspect` directly — all flags work with partial IDs)
agent-tracing inspect <partialOperationId>
agent-tracing inspect <partialOperationId> -T
agent-tracing inspect <partialOperationId> -p
# Clean up stale partial snapshots
agent-tracing partial clean
# Map the context window composition of every LLM call (cm / map are aliases)
agent-tracing ctx-map
agent-tracing ctx-map <operationId|traceId|path.json>
agent-tracing ctx-map --html # standalone report under .agent-tracing/_reports/
agent-tracing ctx-map --html out.html
# Re-issue a recorded LLM call against other models (see "replay" below)
agent-tracing replay <operationId|traceId|path.json>
agent-tracing replay <target> -s 4 -m openai/gpt-5,anthropic/claude-sonnet-5
agent-tracing replay <target> --all-steps
A snapshot already freezes everything one LLM call saw: steps[].contextEngine.output is the
exact message array sent to the model, context.payload.tools the toolset it could reach.
replay sends that frozen payload back out with only the model swapped, so a difference in
output is attributable to the model rather than to context assembly. If every model fails the
same payload, the context is at fault; if some pass, it is model selection.
Available from both CLIs — agent-tracing replay (reads LOBEHUB_JWT) and lh trace op replay
(uses the lh login session). Both need credentials because the call goes out through the
LobeHub chat route.
# One call: defaults to the last call_llm step and the model the op ran on
lh trace op replay <operationId>
lh trace op replay <operationId> -s 4 -m openai/gpt-5,anthropic/claude-sonnet-5
lh trace op replay <operationId> --judge "answers with a concrete file path"
# Every call of the operation
lh trace op replay <operationId> --all-steps
lh trace op replay <operationId> --all-steps --concurrency 8
--all-steps answers the question the whole feature exists for: take a run that succeeded, put
another model on it, and see whether that model also gets the job done. It ends in a PASS / FAIL
verdict from an llm-rubric judge comparing the replayed outcome against the recorded one; pass
--judge "<criteria>" to define success yourself instead of using the default rubric.
The judge scores the outcome, not the route. A model that solved the same problem by calling
different tools has passed. The per-call tool comparison (toolSignature) is reported underneath
as supporting evidence — where the run took another path — and never decides pass / fail. A final
call that never reached the model is a FAIL, not a missing verdict.
Each call is replayed independently, against the payload the harness actually built for it, so a different answer at call 2 cannot contaminate call 4, a call that fails to reach the provider costs only itself, and the calls go out concurrently (4 at a time by default).
Chaining the nodes — feeding each replayed output into the next — was built and then removed. A trace cannot regenerate tool output, only hand back what was recorded, so the moment the model deviates there is no ground truth left; the run then measures nothing while still looking like it succeeded. Independent replay is the design, not a fallback.
Known limitation: sampling parameters are not recorded. The recorder stores the runtime step
context under context.payload, not the provider request body, so temperature, top_p,
max_tokens, penalties and reasoning config are absent from every trace written so far. Replays
use the server's current defaults for those. Model-to-model comparisons stay valid (every target
gets the same request); comparisons against the recorded output do not, for an operation that ran
with non-default settings. --temperature / --max-tokens override explicitly. The CLI prints a
note line whenever a replay is running without recorded parameters.
ctx-map renders one row per call_llm step: the messages that call sent to the model, split
into typed segments (system / injected block / user / reasoning / tool call / tool result) with
width proportional to tokens, laid against the model's context window.
The second axis is what ctx-lint cannot show: each row is diffed against the previous call, so
the longest identical message prefix — the part a provider's prefix cache can reuse — is
marked, along with the first message that mutated and the tokens re-processed behind it. A small
injected block carrying a relative timestamp (1m ago → now) invalidates every token after it,
which shows up as a break marker early in the row.
Reading a row:
viewer/contextMapScales.ts, with assignments in
viewer/contextMapPalette.ts. The HTML report ships both themes and follows the system theme.▓ (HTML: 60%-opaque hatch) was served
from the prefix cache; solid █ (HTML: flat) was re-processed by the model.▲ in the terminal, a red rule through the track in
HTML) at the column where reuse stopped, with the reason and the re-processed tokens.| Flag | Short | Description |
|---|---|---|
--html [path] | Standalone HTML report (hover a segment for its content) | |
--width <n> | -w | Track width in terminal columns |
--window <n> | Override the model context window used as the track | |
--full-window | Always scale to the full window, never to the largest call | |
--json | -j | Per-call segments + cache stats |
The track scales to the context window; when the window dwarfs the payloads (a 50k payload on a
1M window) it falls back to the largest call so the composition stays readable, and the header
says which basis is in use. Analysis lives in analysis/contextMap.ts and is exported as
buildContextMap() for downstream corpus work.
| Flag | Short | Description | Default Step |
|---|---|---|---|
--step <n> | -s | Target a specific step | — |
--messages | -m | Messages context (CE input → params → LLM payload) | — |
--tools | -t | Tool calls & results (what agent invoked) | — |
--events | -e | Raw events (llm_start, llm_result, etc.) | — |
--context | -c | Runtime context & payload (raw) | — |
--system-role | -r | Full system role content | 0 |
--env | Environment context | 0 | |
--payload | -p | Context engine input overview (model, knowledge, tools summary, memory summary, platform context) | 0 |
--payload-tools | -T | Available tools detail (plugin manifests + LLM function definitions) | 0 |
--memory | -M | Full user memory (persona, identity, contexts, preferences, experiences) | 0 |
--diff <n> | -d | Diff against step N (use with -r or --env) | — |
--msg <n> | Full content of message N from Final LLM Payload | — | |
--msg-input <n> | Full content of message N from Context Engine Input | — | |
--json | -j | Output as JSON (combinable with any flag above) | — |
Flags marked "Default Step: 0" auto-select step 0 if --step is not provided. All flags support latest or omitted traceId.
# 1. Trigger an agent operation in the dev UI
# 2. See the overview
agent-tracing inspect
# 3. List all traces, get traceId
agent-tracing list
# 4. Quick overview of what was fed into context engine
agent-tracing inspect -p
# 5. Inspect a specific step's messages to see what was sent to the LLM
agent-tracing inspect TRACE_ID -s 0 -m
# 6. Drill into a truncated message for full content
agent-tracing inspect TRACE_ID -s 0 --msg 2
# 7. Check available tools vs actual tool calls
agent-tracing inspect -T # available tools
agent-tracing inspect -s 1 -t # actual tool calls & results
# 8. Inspect user memory injected into the conversation
agent-tracing inspect -M
# 9. Diff system role between steps (multi-step agents)
agent-tracing inspect TRACE_ID -r -d 2
interface ExecutionSnapshot {
traceId: string;
operationId: string;
model?: string;
provider?: string;
startedAt: number;
completedAt?: number;
completionReason?:
'done' | 'error' | 'interrupted' | 'max_steps' | 'cost_limit' | 'waiting_for_human';
totalSteps: number;
totalTokens: number;
totalCost: number;
error?: { type: string; message: string };
steps: StepSnapshot[];
}
interface StepSnapshot {
stepIndex: number;
stepType: 'call_llm' | 'call_tool';
executionTimeMs: number;
content?: string; // LLM output
reasoning?: string; // Reasoning/thinking
inputTokens?: number;
outputTokens?: number;
toolsCalling?: Array<{ apiName: string; identifier: string; arguments?: string }>;
toolsResult?: Array<{
apiName: string;
identifier: string;
isSuccess?: boolean;
output?: string;
}>;
messages?: any[]; // DB messages before step
context?: { phase: string; payload?: unknown; stepContext?: unknown };
events?: Array<{ type: string; [key: string]: unknown }>;
contextEngine?: {
input?: unknown; // contextEngineInput minus messages + toolsConfig (reconstructible from baseline)
output?: unknown; // processed messages array (final LLM payload)
metadata?: unknown; // pipeline decision records (trim stats, cache gates, truncation counts)
};
}
When using --messages, the output shows three sections (if context engine data is available):
[0], [1], ... indices. Use --msg-input N to view full content.[0], [1], ... indices. Use --msg N to view full content.apps/server/src/services/agentRuntime/AgentRuntimeService/executeStep/index.ts — in executeStep(), after saveAndPublishStep builds stepPresentationData, writes partial snapshot in dev modeapps/server/src/modules/AgentRuntime/RuntimeExecutors.ts — in call_llm executor, after serverMessagesEngine() returns, calls ctx.tracingContextEngine(input, output, metadata). AgentRuntimeService.executeStep buffers it per step and passes it to traceRecorder.appendStep as the typed contextEngine field (kept off the events array to stay out of Redis state).FileSnapshotStore reads/writes to .agent-tracing/ relative to process.cwd()아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
실제 제품을 적절한 조작 환경에서 실행해 변경 사항을 검증하고, 사용자가 확인할 수 있는 증거를 모아 인수 보고서로 게시합니다. 기존 검증 계획을 확인하거나 점검 항목을 만들고, `lh` CLI로 결과를 게시할 수 있습니다.
LobeHub에 AI 모델 제공자를 추가하는 과정을 안내합니다. 런타임 연동, 모델 정보와 설정, 브랜드 표시, 문서화 및 인수 확인을 다루며, 기존 제공자에 모델만 추가하는 경우와 새 연동이 필요한 경우를 구분합니다.
서버 환경 변수로 사용자 설정의 기본값을 지정하도록 구현하는 절차를 안내합니다. 변수 검증, 서버 설정 구성, 사용자 저장소 반영부터 예시 환경 파일과 셀프 호스팅 문서 갱신까지 다룹니다.
에이전트 실행 단계, 도구 호출, 사람의 승인, 컨텍스트 압축, 하위 에이전트 호출에 훅을 등록하는 방법을 안내합니다. 이벤트를 관찰하고 로컬 도구 결과를 모의하거나 설정에 따라 웹훅으로 도구 호출을 허용 또는 거부할 수 있습니다.
에이전트의 이벤트 기반 백그라운드 작업을 설계하고 구현하도록 돕습니다. 소스, 시그널, 액션, 정책의 역할을 나누고 비동기 처리, 중복 실행 방지, 완료 기록과 관측 기능을 다룹니다.
실제 데스크톱 채팅 앱에서 봇 채널의 인수 테스트를 진행합니다. Discord, Slack, Telegram, WeChat, Lark, QQ에서 메시지를 보내고 응답을 기다린 뒤 결과 화면을 캡처합니다. iMessage는 BlueBubbles 브리지를 사용합니다.