Skip to content

Commit 9928680

Browse files
committed
agents: include allow-list hint in disallowed model override error
Mirror the existing helpful hint from src/auto-reply/reply/get-reply-directives-apply.ts:72 onto the parallel error thrown in src/agents/agent-command.ts when an explicit model override is rejected by the visibility policy. Existing test (src/commands/agent.test.ts:1068) uses toThrow(string) substring matching, so appending the hint is backward compatible and no test changes are required. See #82979 review thread for the broader context: this PR was originally larger but ClawSweeper correctly pointed out that #82864 already lands the routing fixes I had documented as a workaround, so the docs hunks have been dropped.
1 parent 1f6abab commit 9928680

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/agents/agent-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ async function agentCommandInternal(
923923
const explicitKey = modelKey(explicitRef.provider, explicitRef.model);
924924
if (!visibilityPolicy.allowsKey(explicitKey)) {
925925
throw new Error(
926-
`Model override "${sanitizeForLog(explicitRef.provider)}/${sanitizeForLog(explicitRef.model)}" is not allowed for agent "${sessionAgentId}".`,
926+
`Model override "${sanitizeForLog(explicitRef.provider)}/${sanitizeForLog(explicitRef.model)}" is not allowed for agent "${sessionAgentId}". Add it to agents.defaults.models or pick an allowed model with "openclaw models list".`,
927927
);
928928
}
929929
provider = explicitRef.provider;

0 commit comments

Comments
 (0)