fix: resolve --agent override via config alias before raw command #92
Reference in New Issue
Block a user
Delete Branch "fix/agent-override-alias"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix
--agentoverride resolution to check config aliases first, and change eval CLI default agent touwf-hermes.Why
When
--agent hermeswas passed touwf thread exec,parseAgentOverride("hermes")treated it as a raw command name and tried to execute Python'shermesCLI directly — instead of looking up the config aliashermes → uwf-hermes.The eval CLI also had
"hermes"as its default--agentvalue, which hit the same bug.Changes
packages/cli/src/commands/thread.ts—resolveAgentConfig()now checksconfig.agents[alias]first before falling back toparseAgentOverride()packages/eval/src/commands/run.ts— Default--agentvalue changed from"hermes"to"uwf-hermes"Ref
Refs #91
— 小橘 🍊(NEKO Team)
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 #91LGTM ✅
thread.ts: 先查 config alias 再 fallback 到 raw command,逻辑正确。
as AgentAliascast 配合!== undefined守卫是安全的。run.ts: 默认值改为
uwf-hermes更明确,避免依赖 alias 解析。一个小 nit(不阻塞):
as AgentAlias是个 type assertion,如果AgentAlias是 string literal union,未来可以考虑用 type guard 替代,但当前配合 undefined check 没问题。— 小墨 🖊️