verify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVerifying changes in Honcho
在Honcho中验证变更
Prerequisites
前提条件
Docker Compose is the preferred way to run the stack — at
the repo root brings up Postgres (pgvector), Redis, the API server, and the
deriver worker together. If Docker Compose isn't available, the stack can also
run directly on the host (see Launch below); you'll need Postgres with pgvector
and Redis reachable, plus a with connection strings and an LLM provider
key for any flow that hits a model (deriver, dialectic, dreamer).
docker-compose.yml.envWorking in a worktree? It carries neither nor . Copy
from the main checkout (that's where the provider keys live), and run
in if you'll run the full test suite —
otherwise the pre-push gate fails on a phantom .
.envnode_modules.envbun installsdks/typescriptCannot find package 'zod'Docker Compose是运行该栈的首选方式——仓库根目录下的会启动Postgres(pgvector)、Redis、API服务器以及deriver worker。如果无法使用Docker Compose,该栈也可以直接在主机上运行(参见下文的启动部分);你需要可访问的带pgvector的Postgres和Redis,此外还需要一个包含连接字符串的文件,以及用于任何调用模型的流程(deriver、dialectic、dreamer)的LLM提供商密钥。
docker-compose.yml.env使用工作树(worktree)?它不会携带或。从主检出目录复制(提供商密钥存储在那里),如果要运行完整测试套件,在中执行——否则预推送检查会因出现不存在的错误而失败。
.envnode_modules.envsdks/typescriptbun installCannot find package 'zod'Launch
启动
First check whether the stack is already running via Docker Compose:
bash
docker compose ps # look for api / deriver / database / redis
docker compose up -d # start it if notA running stack is not the same as your branch's code running — check the
CREATED column; the images may be weeks old. For verifying a diff, the cheap
path is to reuse the stack's Postgres/Redis containers but run the branch's
API as a host process on a spare port:
bash
uv run uvicorn src.main:app --port 8901 # branch code, stack's DB/Redis
uv run python -m src.deriver # if the diff touches the workerThis avoids both an image rebuild and the port/project-name conflicts a second
compose stack in a worktree would cause. Without Docker at all, run the two
processes the same way against host Postgres + Redis (API default port 8000
via ).
uv run fastapi dev src/main.pyWhen reading server logs, note that with the main the telemetry emitter
spams connection warnings at an unreachable endpoint — before looking for the real error.
.envgrep -v telemetry.emitter首先通过Docker Compose检查栈是否已在运行:
bash
docker compose ps # 查看api / deriver / database / redis
docker compose up -d # 如果未运行则启动它运行中的栈并不等同于运行你的分支代码——查看CREATED列;镜像可能已经是几周前的了。要验证代码差异,简便的方法是复用栈的Postgres/Redis容器,但在空闲端口上以主机进程运行分支的API:
bash
uv run uvicorn src.main:app --port 8901 # 分支代码,使用栈的DB/Redis
uv run python -m src.deriver # 如果代码差异涉及worker这样既避免了镜像重建,也避免了工作树中第二个compose栈会导致的端口/项目名称冲突。完全不使用Docker的话,以相同方式运行这两个进程,对接主机上的Postgres + Redis(API默认端口8000,通过启动)。
uv run fastapi dev src/main.py查看服务器日志时请注意,使用主文件时,遥测发射器会向无法访问的端点发送大量连接警告——在查找真实错误前先执行过滤。
.envgrep -v telemetry.emitterDrive it
运行验证
Prefer driving through the skill; fall back to the SDKs
(, ), then raw REST against , in that order
when a method isn't available at the higher level. The
skill covers how to use the SDKs.
honcho-clisdks/pythonsdks/typescript/v3honcho-integrationWhen a change updates endpoints or makes schema changes, verify across all
three surfaces — CLI, SDKs, and REST — since they can drift independently.
For LLM-path changes, the fastest synchronous surface is dialectic at the
reasoning level: send a couple of messages, then hit
and observe the response.
minimal/v3/.../peers/{peer_id}/chat优先通过 skill进行验证;如果更高层级没有可用方法,再回退到SDK(、),最后直接调用的REST接口。 skill涵盖了SDK的使用方法。
honcho-clisdks/pythonsdks/typescript/v3honcho-integration当变更更新了端点或修改了 schema 时,需在三个层面(CLI、SDK和REST)都进行验证,因为它们可能会各自出现偏差。
对于LLM路径的变更,最快的同步层面是推理级别的dialectic:发送几条消息,然后调用并观察响应。
minimal/v3/.../peers/{peer_id}/chatConfiguration
配置
Configuration is central to both driving the app and running tests: it's how
API keys reach the server and how a config-related change gets exercised at
all. Settings come from environment variables or files, with precedence
env > > > defaults. To verify a configuration change,
set the relevant option through one of these layers, restart the affected
process, and observe the behavioral difference at the surface — the same
mechanism lets you point provider base URLs, model choices, and timeouts at
credentials and proxies you actually have.
.envconfig.tomlTwo concrete levers: deep-nested settings (e.g.
) are
miserable as env vars — drop a partial in the repo root instead.
And for load-time config behavior,
is faster than booting the server.
[dialectic.levels.minimal.model_config.overrides.provider_params]config.tomluv run python -c "import src.config; ..."配置对于运行应用和测试都至关重要:它是API密钥传递到服务器的方式,也是配置相关变更得以生效的途径。设置来自环境变量或文件,优先级为环境变量 > > > 默认值。要验证配置变更,通过其中一个层级设置相关选项,重启受影响的进程,然后观察运行时层面的行为差异——同样的机制可以让你将提供商基础URL、模型选择和超时时间指向你实际拥有的凭据和代理。
.envconfig.toml两个实用技巧:深层嵌套的设置(例如)作为环境变量使用起来非常麻烦——可以在仓库根目录放置一个部分配置的文件代替。而对于加载时的配置行为,比启动服务器更快。
[dialectic.levels.minimal.model_config.overrides.provider_params]config.tomluv run python -c "import src.config; ..."Test suites
测试套件
Three test types matter here. All run in CI, but they're also runnable locally
with whatever API keys and configuration you have — Honcho's config surface is
large, so options like per-agent timeouts and provider base URLs can be pointed
at your own keys/proxies to exercise a change:
bash
undefined这里有三种重要的测试类型。所有测试都会在CI中运行,但你也可以使用自己的API密钥和配置在本地运行——Honcho的配置层面很广泛,因此诸如每个agent的超时时间和提供商基础URL等选项可以指向你自己的密钥/代理,以验证变更:
bash
undefinedUnit tests (pytest; spins up its own infra via fixtures)
单元测试(pytest;通过fixture启动自己的基础设施)
uv run pytest tests/
uv run pytest tests/
Unified tests — step-based end-to-end flows defined in JSON
统一测试——基于步骤的端到端流程,以JSON定义
(config hierarchy, multi-turn interactions, LLM-as-judge assertions)
(配置层级、多轮交互、LLM作为判断者的断言)
uv run python -m tests.unified.run
uv run python -m tests.unified.run --test-dir tests/unified/test_cases
uv run python -m tests.unified.run
uv run python -m tests.unified.run --test-dir tests/unified/test_cases
Live LLM tests — real provider calls, for testing specific backends.
实时LLM测试——真实的提供商调用,用于测试特定后端。
Needs provider API keys AND model vars — without LIVE_LLM_*_MODELS the
需要提供商API密钥和模型变量——如果没有设置LIVE_LLM_*_MODELS,
tests silently deselect that provider. See tests/live_llm/README.md.
测试会自动跳过该提供商。参见tests/live_llm/README.md。
export LLM_ANTHROPIC_API_KEY=...
export LIVE_LLM_ANTHROPIC_45_PLUS_MODELS=claude-sonnet-4-5
uv run pytest tests/live_llm -n 0 --live-llm --no-header -q
undefinedexport LLM_ANTHROPIC_API_KEY=...
export LIVE_LLM_ANTHROPIC_45_PLUS_MODELS=claude-sonnet-4-5
uv run pytest tests/live_llm -n 0 --live-llm --no-header -q
undefined