Token导航 LogoToken导航

Agent Skill · 开发

langfuse(langfuse 测试)

langfuse 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

langfuse 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,593。

总安装 682周安装 29GitHub Stars 55下载 239核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:langfuse(langfuse 测试)
来源仓库:https://github.com/joelhooks/joelclaw
仓库路径:skills/langfuse
安装命令:
npx skills add https://github.com/joelhooks/joelclaw --skill langfuse
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/joelhooks/joelclaw --skill langfuse

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

langfuse 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或代码变更进行整理。通过 npx skills add 命令从指定仓库安装并使用。

建议确认权限范围和维护状态,注意是否触发联网或文件读写。可结合来源仓库和 README 进一步核验具体用法。

来源仓库内路径:skills/langfuse

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/joelhooks/joelclaw --skill langfuse;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

langfuse 怎么安装?

在终端执行 npx skills add https://github.com/joelhooks/joelclaw --skill langfuse。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

langfuse 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

langfuse 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

langfuse 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

langfuse 用的人多吗?

公开数据是累计安装 682 次,近一周安装 29 次,下载 239 次,GitHub 55 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

langfuse 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
langfuse

langfuse 测试 · 本页

68255需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Langfuse Observability

Langfuse is the LLM observability layer for joelclaw. Every LLM call produces a Langfuse trace with nested hierarchy, I/O, usage, cost, and attribution.

Architecture

joelclaw has two Langfuse integration points:

1. Pi-session extension (langfuse-cost)

  • Source: pi/extensions/langfuse-cost/index.ts (canonical, git-tracked in this repo)
  • Runtime: loaded as a pi extension from the same source tree
  • What it traces: Every gateway + interactive pi session LLM call
  • How: Hooks into pi session events (session_start, message_start, message_end, tool_call, tool_result, session_shutdown)
  • Dedup: globalThis.__langfuse_cost_loaded__ guard prevents duplicate extension instances
  • Optional dependency behavior: langfuse is lazily loaded (no top-level hard import). Missing module must disable telemetry, not crash extension import. Regression test: pi/extensions/langfuse-cost/index.test.ts
  • Runtime dependency location: because the extension is loaded from pi/extensions/ at repo root instead of a workspace package, the langfuse npm package must be available from the repo root package.json. If root install drift drops it, gateway/session telemetry silently degrades to the optional-dependency warning again.

2. System-bus OTEL bridge (langfuse.ts)

  • Source: packages/system-bus/src/lib/langfuse.ts
  • What it traces: All Inngest function LLM calls (reflect, triage, email cleanup, docs ingest)
  • How: @langfuse/otel LangfuseSpanProcessor + @langfuse/tracing startObservation()
  • Produces: joelclaw.inference traces with generation children

Current Trace Hierarchy (pi-session)

The langfuse-cost extension produces a 4-level nested span hierarchy:

joelclaw.session (trace)
  └── session (span) — entire session lifetime
        └── turn-1 (span) — user message → final assistant response
        │     ├── tool:bash (span) — individual tool execution
        │     ├── tool:read (span)
        │     └── llm.call (generation) — the LLM API call with usage/cost
        └── turn-2 (span)
              ├── tool:edit (span)
              ├── tool:bash (span)
              └── llm.call (generation)

What each level captures

LevelCreated onEnded onContains
joelclaw.session tracesession_startsession_shutdownuserId, sessionId, tags, turn count
session spansession_startsession_shutdownChannel, session type, turn count
turn-N spanmessage_start[user]message_end[assistant] with text outputUser input (clean), sourceChannel metadata
tool:name spantool_call eventtool_result eventTool input, output (truncated 500 chars)
llm.call generationmessage_end[assistant]immediateModel, usage, cache tokens, cost, I/O

Channel header stripping

User messages from Telegram arrive with a ---\nChannel:...\n--- header. The extension:

  1. Strips the header from trace input (clean user text only)
  2. Parses known keys (channel, date, platform_capabilities) into sourceChannel metadata
  3. Skips multi-line values (e.g. formatting_guide)

Credentials

Langfuse creds in agent-secrets:

  • langfuse_public_key — pk-lf-cb8b...
  • langfuse_secret_key — sk-lf-c86f...
  • langfuse_base_url — https://us.cloud.langfuse.com

Gateway gets them via gateway-start.sh env exports. System-bus resolves via env → secrets lease fallback.

Trace Conventions

Naming

  • Pi-session: joelclaw.session (trace) → session → turn-N → tool:name → llm.call
  • System-bus: joelclaw.inference (trace) → generation children

Required Attributes

Every trace MUST have:

  • userId: "joel"
  • sessionId — pi session ID for grouping
  • tags — minimum: ["joelclaw", "pi-session"]
  • Dynamic tags: provider:anthropic, model:anthropic/claude-opus-4-6, channel:central, session:central

Metadata Shape (flat, filterable)

{
  channel: "central",           // GATEWAY_ROLE env
  sessionType: "central",       // "gateway" | "interactive" | "codex" | "central"
  component: "pi-session",
  model: "anthropic/claude-opus-4-6",
  provider: "anthropic",
  stopReason: "toolUse",        // or "endTurn"
  turnCount: 5,                 // Updated on each turn
  sourceChannel: {              // Only on first user message per turn
    channel: "telegram",
    date: "...",
    platform_capabilities: "..."
  },
  tools: ["bash", "read"],      // Tool names used this turn
}

Generation usageDetails

{
  input: 1,                      // Non-cached input tokens
  output: 97,                    // Output tokens
  total: 68195,                  // Total tokens
  cache_read_input_tokens: 67877, // 90% discount
  cache_write_input_tokens: 220,  // 25% premium (NOT priced by Langfuse — known gap)
}

Pi session guardrails (alert-only)

Long-running pi sessions can dominate Langfuse spend. The extension now tracks per-session totals and emits warnings only on first threshold breach per guardrail type:

  • JOELCLAW_LANGFUSE_ALERT_MAX_LLM_CALLS (default: 120)
  • JOELCLAW_LANGFUSE_ALERT_MAX_TOTAL_TOKENS (default: 1200000)
  • JOELCLAW_LANGFUSE_ALERT_MAX_COST_USD (default: 20)

Behavior:

  • no automatic model switch
  • no forced compaction
  • no stop/interruption
  • emits console.warn(...) with session ID + current counters
  • records breach flags and first breach turn index in trace metadata (guardrails)

Model/provider normalization

Both the pi-session extension and system-bus Langfuse bridge normalize provider/model before writing tags, trace metadata, and generation model fields. This keeps provider:* + model:* tags aligned with metadata after model switches and for provider-prefixed IDs such as:

  • anthropic/claude-opus-4-6
  • openai-codex/gpt-5.4

Normalization is fail-open: tracing continues even if normalization cannot resolve a value.

Output-contract + usage-coverage signals (2026-03-02)

System-bus inference now emits explicit coverage/output-contract metadata so low-yield calls are queryable:

  • usageCoverage: "present"|"missing"
  • usageCaptured: boolean
  • jsonRequested, jsonParsed, outputChars
  • warning OTEL event: model_router.usage_missing

For strict machine-readable paths, callers can require output contracts:

  • requireJson: true — parse failure becomes inference failure
  • requireTextOutput: true — empty text becomes inference failure

Recall rewrite traces now include rewriteReason in addition to strategy (disabled|skipped|haiku|openai|fallback) to separate deliberate skips from failure fallbacks.

Known Gaps

IssueSeverityNotes
cache_write_input_tokens not pricedMediumLangfuse platform limitation — no cache write rate in their pricing table
No completionStartTime on first turnLowlastAssistantStartTime not set before first message_start[assistant]
tool_result matchingLowRelies on toolCallId — if pi changes the field name, spans won't close

Debugging

Check recent traces

LF_PK=$(secrets lease langfuse_public_key --ttl 5m)
LF_SK=$(secrets lease langfuse_secret_key --ttl 5m)
curl -s -u "$LF_PK:$LF_SK" "https://us.cloud.langfuse.com/api/public/traces?limit=5" \
  | jq '[.data[] | {name, ts: .timestamp[:19], obs: (.observations | length), output: (.output // "" | tostring | .[0:60])}]'

Check nested observations on a trace

TRACE_ID="<id>"
curl -s -u "$LF_PK:$LF_SK" "https://us.cloud.langfuse.com/api/public/observations?traceId=$TRACE_ID" \
  | jq '[.data[] | {name, type, model, startTime: .startTime[:19], endTime: .endTime[:19]}]'

Common Issues

SymptomCauseFix
Double tracesExtension loaded twice via symlink/realpath splitglobalThis dedup guard (already fixed)
[toolUse] output instead of tool namestool_call events not firingCheck pi version, verify toolName field on event
No traces at allLangfuse creds missingCheck LANGFUSE_PUBLIC_KEY/LANGFUSE_SECRET_KEY env
channel:interactive on gatewayGATEWAY_ROLE not setMust be in gateway-start.sh
Stale extension codeGateway/interactive session not reloaded after changeRestart gateway and start a fresh interactive session
OTEL emit errors in gatewaysystem-bus-worker port-forward downkubectl port-forward -n joelclaw svc/system-bus-worker 3111:3111

Key Files

  • Pi extension: pi/extensions/langfuse-cost/index.ts
  • Pi extension tests: pi/extensions/langfuse-cost/index.test.ts
  • System-bus bridge: packages/system-bus/src/lib/langfuse.ts
  • Gateway ops notes: docs/gateway.md

Deployment Workflow

After editing the pi extension:

  1. Commit changes in this repo (source of truth).
  2. Restart gateway so the updated extension is loaded.
  3. Start a new interactive pi session (or reload) so per-session tracing uses the new code.

ADRs

  • ADR-0146: Inference Cost Monitoring and Control — shipped
  • ADR-0147: Named Agent Profiles (trace attribution by role)

平台分布

Codex

38.35%
按下载量换算92

Claude

28.99%
按下载量换算69

Cursor

20.01%
按下载量换算48

Gemini CLI

8.72%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills