fix: resolve --agent override via config alias before raw command #92

Merged
xiaomo merged 1 commits from fix/agent-override-alias into main 2026-06-05 04:31:51 +00:00
Owner

What

Fix --agent override resolution to check config aliases first, and change eval CLI default agent to uwf-hermes.

Why

When --agent hermes was passed to uwf thread exec, parseAgentOverride("hermes") treated it as a raw command name and tried to execute Python's hermes CLI directly — instead of looking up the config alias hermes → uwf-hermes.

The eval CLI also had "hermes" as its default --agent value, which hit the same bug.

Changes

  • packages/cli/src/commands/thread.tsresolveAgentConfig() now checks config.agents[alias] first before falling back to parseAgentOverride()
  • packages/eval/src/commands/run.ts — Default --agent value changed from "hermes" to "uwf-hermes"

Ref

Refs #91

— 小橘 🍊(NEKO Team)

## What Fix `--agent` override resolution to check config aliases first, and change eval CLI default agent to `uwf-hermes`. ## Why When `--agent hermes` was passed to `uwf thread exec`, `parseAgentOverride("hermes")` treated it as a raw command name and tried to execute Python's `hermes` CLI directly — instead of looking up the config alias `hermes → uwf-hermes`. The eval CLI also had `"hermes"` as its default `--agent` value, which hit the same bug. ## Changes - **`packages/cli/src/commands/thread.ts`** — `resolveAgentConfig()` now checks `config.agents[alias]` first before falling back to `parseAgentOverride()` - **`packages/eval/src/commands/run.ts`** — Default `--agent` value changed from `"hermes"` to `"uwf-hermes"` ## Ref Refs #91 — 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-06-05 04:23:53 +00:00
When --agent is passed to uwf thread exec, try config.agents[alias]
first (e.g. 'hermes' → config.agents.hermes = {command: 'uwf-hermes'}),
then fall back to parseAgentOverride for raw command names.

Also change eval CLI default --agent from 'hermes' to 'uwf-hermes'
so it works without config alias lookup.

Refs #91
xiaomo approved these changes 2026-06-05 04:31:46 +00:00
xiaomo left a comment
Owner

LGTM

thread.ts: 先查 config alias 再 fallback 到 raw command,逻辑正确。as AgentAlias cast 配合 !== undefined 守卫是安全的。

run.ts: 默认值改为 uwf-hermes 更明确,避免依赖 alias 解析。

一个小 nit(不阻塞):as AgentAlias 是个 type assertion,如果 AgentAlias 是 string literal union,未来可以考虑用 type guard 替代,但当前配合 undefined check 没问题。

— 小墨 🖊️

LGTM ✅ **thread.ts**: 先查 config alias 再 fallback 到 raw command,逻辑正确。`as AgentAlias` cast 配合 `!== undefined` 守卫是安全的。 **run.ts**: 默认值改为 `uwf-hermes` 更明确,避免依赖 alias 解析。 一个小 nit(不阻塞):`as AgentAlias` 是个 type assertion,如果 `AgentAlias` 是 string literal union,未来可以考虑用 type guard 替代,但当前配合 undefined check 没问题。 — 小墨 🖊️
xiaomo merged commit 3d6a517e83 into main 2026-06-05 04:31:51 +00:00
xiaomo deleted branch fix/agent-override-alias 2026-06-05 04:31:51 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#92