mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 08:45:50 +00:00
* feat: langfuse tracing 增加 thinking 参数记录 在 recordLLMObservation 中添加 thinking 配置(type/budgetTokens), 所有 provider(claude/gemini/openai)及 tokenEstimation、sideQuery 调用处同步传递 thinking 信息,便于 Langfuse 面板观察 thinking 使用情况。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: langfuse tracing 兼容 budget_tokens snake_case 格式 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: 统一传递完整 thinking 配置而非仅 thinkingType Langfuse 追踪直接传递整个 thinking 对象(含 type 和 budget_tokens), Analytics 日志同步补充 thinkingBudgetTokens 字段,logAPIQuery 改为 接收 ThinkingConfig 类型参数。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat: 省略旧消息的代码 diff 展示,仅保留最新消息的完整 diff * fix: Edit 工具增加 Tab/空格规范化匹配,修复中文和缩进文件编辑失败 Read 工具输出将 Tab 渲染为空格,用户复制后 Edit 工具无法匹配。 在 findActualString 中增加 Tab→空格规范化回退匹配,并精确映射回原始文件位置。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs: README 添加安装/更新失败的解决方案提示 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,16 @@ export function recordLLMObservation(
|
||||
endTime?: Date
|
||||
completionStartTime?: Date
|
||||
tools?: unknown
|
||||
/** Thinking depth configuration used for this request.
|
||||
* Accepts the full API thinking config object. Fields:
|
||||
* - type: thinking mode ("enabled", "adaptive", "disabled")
|
||||
* - budget_tokens (snake_case, from Anthropic API) or budgetTokens (camelCase)
|
||||
*/
|
||||
thinking?: {
|
||||
type: string
|
||||
budget_tokens?: number
|
||||
budgetTokens?: number
|
||||
}
|
||||
},
|
||||
): void {
|
||||
if (!rootSpan || !isLangfuseEnabled()) return
|
||||
@@ -97,6 +107,7 @@ export function recordLLMObservation(
|
||||
metadata: {
|
||||
provider: params.provider,
|
||||
model: params.model,
|
||||
...(params.thinking && { thinking: params.thinking }),
|
||||
},
|
||||
...(params.completionStartTime && { completionStartTime: params.completionStartTime }),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user