mixseek-debug

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MixSeek デバッグ機能

MixSeek 调试功能

概要

概要

MixSeek-Plusは複数のデバッグ用環境変数を提供しています。これらを使用して、エージェント実行時の詳細なログ出力を有効化し、問題の診断や動作確認を行うことができます。
MixSeek-Plus提供多个调试用环境变量,可通过这些变量启用Agent执行时的详细日志输出,用于问题诊断和运行验证。

環境変数一覧

环境变量一览

環境変数効果スコープ
MIXSEEK_VERBOSE
1
または
true
統合デバッグモードMCPツールログ +
mixseek.member_agents
(DEBUG) +
claudecode_model
(DEBUG)
CLAUDECODE_MODEL_LOG_LEVEL
DEBUG
claudecode-model単体のログclaudecode-modelパッケージのみ
MIXSEEK_LOGFIRE
1
または
true
Logfireインストルメンテーションpydantic-ai トレース(要Logfire設定)
环境变量取值效果作用范围
MIXSEEK_VERBOSE
1
true
集成调试模式MCP工具日志 +
mixseek.member_agents
(DEBUG) +
claudecode_model
(DEBUG)
CLAUDECODE_MODEL_LOG_LEVEL
DEBUG
仅claudecode-model的日志仅claudecode-model包
MIXSEEK_LOGFIRE
1
true
Logfire埋点pydantic-ai 追踪(需Logfire配置)

推奨設定

推荐设置

通常のデバッグには
MIXSEEK_VERBOSE=1
のみで十分です。
MIXSEEK_VERBOSE=1
を設定すると、以下のログが有効化されます:
  • MCPツール呼び出しの開始/完了ログ
  • mixseek.member_agents
    ロガーのDEBUGレベル出力
  • claudecode_model
    ロガーのDEBUGレベル出力
常规调试仅需设置
MIXSEEK_VERBOSE=1
即可。
设置
MIXSEEK_VERBOSE=1
后,将启用以下日志:
  • MCP工具调用的开始/完成日志
  • mixseek.member_agents
    日志器的DEBUG级别输出
  • claudecode_model
    日志器的DEBUG级别输出

使用方法

使用方法

Step 1: 環境変数の確認

Step 1: 确认环境变量

現在の環境変数設定を確認するには、以下のスクリプトを実行してください:
bash
bash skills/mixseek-debug/scripts/check-debug-env.sh
要查看当前环境变量设置,执行以下脚本:
bash
bash skills/mixseek-debug/scripts/check-debug-env.sh

Step 2: CLI実行時の使用

Step 2: CLI执行时的使用

方法A: 環境変数を設定してCLI実行

方法A: 设置环境变量后执行CLI

bash
undefined
bash
undefined

統合デバッグモード(推奨)

集成调试模式(推荐)

MIXSEEK_VERBOSE=1 uv run mskp team "タスク" --config configs/agents/team.toml
MIXSEEK_VERBOSE=1 uv run mskp team "任务" --config configs/agents/team.toml

claudecode-model単体のデバッグ

仅调试claudecode-model

CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "タスク" --config configs/agents/team.toml
CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "任务" --config configs/agents/team.toml

複数の環境変数を組み合わせ

组合多个环境变量

MIXSEEK_VERBOSE=1 MIXSEEK_LOGFIRE=1 uv run mskp team "タスク" --config configs/agents/team.toml
undefined
MIXSEEK_VERBOSE=1 MIXSEEK_LOGFIRE=1 uv run mskp team "任务" --config configs/agents/team.toml
undefined

方法B: シェルセッション全体に設定

方法B: 为整个Shell会话设置

bash
undefined
bash
undefined

現在のセッションに設定

为当前会话设置

export MIXSEEK_VERBOSE=1
export MIXSEEK_VERBOSE=1

以降のコマンドはすべてverboseモードで実行される

后续所有命令都将以verbose模式运行

uv run mskp team "タスク" --config configs/agents/team.toml
uv run mskp team "任务" --config configs/agents/team.toml

無効化

关闭调试模式

unset MIXSEEK_VERBOSE
undefined
unset MIXSEEK_VERBOSE
undefined

Step 3: Python APIでの使用

Step 3: Python API中的使用

python
import mixseek_plus
python
import mixseek_plus

方法A: enable_verbose_mode()を使用(推奨)

方法A: 使用enable_verbose_mode()(推荐)

mixseek_plus.enable_verbose_mode() mixseek_plus.patch_core()
mixseek_plus.enable_verbose_mode() mixseek_plus.patch_core()

これ以降のClaudeCodeエージェントはverboseログを出力

此后的ClaudeCode Agent将输出verbose日志

コンソール出力例:

控制台输出示例:

[Tool Start] fetch_page: url=https://example.com

[Tool Start] fetch_page: url=https://example.com

[Tool Done] fetch_page: success in 1234ms

[Tool Done] fetch_page: success in 1234ms

ファイル出力先: $WORKSPACE/logs/member-agent-YYYY-MM-DD.log

文件输出路径: $WORKSPACE/logs/member-agent-YYYY-MM-DD.log

verboseモードを無効化

关闭verbose模式

mixseek_plus.disable_verbose_mode()

```python
import os
import mixseek_plus
mixseek_plus.disable_verbose_mode()

```python
import os
import mixseek_plus

方法B: 環境変数を直接設定

方法B: 直接设置环境变量

os.environ["MIXSEEK_VERBOSE"] = "1" mixseek_plus.patch_core()
os.environ["MIXSEEK_VERBOSE"] = "1" mixseek_plus.patch_core()

方法C: 一時的に有効化(コンテキストマネージャは非提供、手動管理)

方法C: 临时启用(无上下文管理器,需手动管理)

os.environ["MIXSEEK_VERBOSE"] = "1" try: # デバッグしたい処理 pass finally: del os.environ["MIXSEEK_VERBOSE"]
undefined
os.environ["MIXSEEK_VERBOSE"] = "1" try: # 要调试的处理逻辑 pass finally: del os.environ["MIXSEEK_VERBOSE"]
undefined

ログ出力先

日志输出位置

コンソール出力

控制台输出

MIXSEEK_VERBOSE=1
時、以下のフォーマットでコンソールに出力されます:
[Tool Start] <tool_name>: <params>
[Tool Done] <tool_name>: <status> in <time>ms
[Tool Result Preview] <result_preview>
例:
[Tool Start] fetch_page: url=https://example.com/docs
[Tool Done] fetch_page: success in 2345ms
[Tool Result Preview] # Documentation\n\nWelcome to...
设置
MIXSEEK_VERBOSE=1
时,将以以下格式输出到控制台:
[Tool Start] <tool_name>: <params>
[Tool Done] <tool_name>: <status> in <time>ms
[Tool Result Preview] <result_preview>
示例:
[Tool Start] fetch_page: url=https://example.com/docs
[Tool Done] fetch_page: success in 2345ms
[Tool Result Preview] # Documentation\n\nWelcome to...

ファイル出力

文件输出

Member Agentのログは以下のファイルに出力されます:
$MIXSEEK_WORKSPACE/logs/member-agent-YYYY-MM-DD.log
出力内容:
  • ツール呼び出しの詳細(パラメータ、実行時間、ステータス)
  • エージェント実行のトレース情報
  • エラーとスタックトレース
Member Agent的日志将输出到以下文件:
$MIXSEEK_WORKSPACE/logs/member-agent-YYYY-MM-DD.log
输出内容:
  • 工具调用详情(参数、执行时间、状态)
  • Agent执行的追踪信息
  • 错误及堆栈追踪

claudecode_model ログ

claudecode_model 日志

MIXSEEK_VERBOSE=1
時、
claudecode_model
ロガーも自動的にDEBUGレベルに設定され、以下が出力されます:
claudecode_model - DEBUG - <message>
设置
MIXSEEK_VERBOSE=1
时,
claudecode_model
日志器将自动设置为DEBUG级别,输出如下内容:
claudecode_model - DEBUG - <message>

組み合わせ例

组合示例

1. 基本的なデバッグ(最も一般的)

1. 基础调试(最常用)

bash
MIXSEEK_VERBOSE=1 uv run mskp team "Webページを取得して要約して" --config configs/agents/team.toml
bash
MIXSEEK_VERBOSE=1 uv run mskp team "获取网页并总结" --config configs/agents/team.toml

2. Logfireトレースを追加

2. 追加Logfire追踪

bash
undefined
bash
undefined

事前にLogfireの設定が必要

需预先配置Logfire

MIXSEEK_VERBOSE=1 MIXSEEK_LOGFIRE=1 uv run mskp team "タスク" --config configs/agents/team.toml
undefined
MIXSEEK_VERBOSE=1 MIXSEEK_LOGFIRE=1 uv run mskp team "任务" --config configs/agents/team.toml
undefined

3. claudecode-model単体のデバッグ

3. 仅调试claudecode-model

他のログを抑制してclaudecode-modelのみをデバッグしたい場合:
bash
CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "タスク" --config configs/agents/team.toml
若需屏蔽其他日志,仅调试claudecode-model:
bash
CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "任务" --config configs/agents/team.toml

トラブルシューティング

故障排查

ログが出力されない

无日志输出

原因1: 環境変数が正しく設定されていない
bash
undefined
原因1: 环境变量设置不正确
bash
undefined

確認

检查

echo $MIXSEEK_VERBOSE
echo $MIXSEEK_VERBOSE

正しく設定

正确设置

export MIXSEEK_VERBOSE=1

**原因2: patch_core()が呼び出されていない**

Python APIを使用する場合、`patch_core()` を呼び出す必要があります:

```python
import mixseek_plus
mixseek_plus.enable_verbose_mode()
mixseek_plus.patch_core()  # これを忘れないこと
原因3: ログハンドラーが設定されていない
Pythonのロギング設定を確認してください:
python
import logging
logging.basicConfig(level=logging.DEBUG)
export MIXSEEK_VERBOSE=1

**原因2: 未调用patch_core()**

使用Python API时,必须调用`patch_core()`:

```python
import mixseek_plus
mixseek_plus.enable_verbose_mode()
mixseek_plus.patch_core()  # 请勿遗漏
原因3: 未配置日志处理器
请检查Python的日志设置:
python
import logging
logging.basicConfig(level=logging.DEBUG)

ファイルログが見つからない

找不到文件日志

原因: MIXSEEK_WORKSPACEが設定されていない
bash
undefined
原因: 未设置MIXSEEK_WORKSPACE
bash
undefined

確認

检查

echo $MIXSEEK_WORKSPACE
echo $MIXSEEK_WORKSPACE

設定

设置

export MIXSEEK_WORKSPACE=/path/to/workspace
export MIXSEEK_WORKSPACE=/path/to/workspace

ログファイルの場所

查看日志文件位置

ls -la $MIXSEEK_WORKSPACE/logs/
undefined
ls -la $MIXSEEK_WORKSPACE/logs/
undefined

ログ出力が多すぎる

日志输出过多

MIXSEEK_VERBOSE=1
は多くのログを出力します。特定のコンポーネントのみをデバッグしたい場合:
bash
undefined
MIXSEEK_VERBOSE=1
会输出大量日志。若仅需调试特定组件:
bash
undefined

claudecode-model単体のみ

仅调试claudecode-model

CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "タスク" --config configs/agents/team.toml

または、Pythonでロガーレベルを個別に制御:

```python
import logging
CLAUDECODE_MODEL_LOG_LEVEL=DEBUG uv run mskp team "任务" --config configs/agents/team.toml

或在Python中单独控制日志器级别:

```python
import logging

特定のロガーのみDEBUGに

仅将特定日志器设为DEBUG

logging.getLogger("claudecode_model").setLevel(logging.DEBUG)
logging.getLogger("claudecode_model").setLevel(logging.DEBUG)

他はINFOに抑制

其他日志器设为INFO以屏蔽冗余日志

logging.getLogger("mixseek.member_agents").setLevel(logging.INFO)
undefined
logging.getLogger("mixseek.member_agents").setLevel(logging.INFO)
undefined

Logfireトレースが表示されない

Logfire追踪不显示

原因: Logfireが設定されていない
Logfireを使用するには、事前に設定が必要です:
python
import logfire
logfire.configure()
詳細は Logfire公式ドキュメント を参照してください。
原因: 未配置Logfire
使用Logfire需预先配置:
python
import logfire
logfire.configure()
详情请参考 Logfire官方文档

関連ドキュメント

相关文档

  • MixSeek-Plus README
  • ClaudeCode Provider
  • Member Agent ログ
  • MixSeek-Plus README
  • ClaudeCode Provider
  • Member Agent 日志

次のステップ

后续步骤

デバッグが完了したら、環境変数を削除または無効化してください:
bash
unset MIXSEEK_VERBOSE
unset CLAUDECODE_MODEL_LOG_LEVEL
unset MIXSEEK_LOGFIRE
または、Python APIで:
python
import mixseek_plus
mixseek_plus.disable_verbose_mode()
调试完成后,请删除或关闭环境变量:
bash
unset MIXSEEK_VERBOSE
unset CLAUDECODE_MODEL_LOG_LEVEL
unset MIXSEEK_LOGFIRE
或通过Python API关闭:
python
import mixseek_plus
mixseek_plus.disable_verbose_mode()