@@ -1782,7 +1782,7 @@ describe("activateSetupInference", () => {
17821782 defaults : { systemAgent : { agentId : "ops" } } ,
17831783 entries : {
17841784 ops : { model : "openai/gpt-5.5" } ,
1785- research : { model : "claude-cli /claude-opus-5" } ,
1785+ research : { model : "anthropic /claude-opus-5" } ,
17861786 } ,
17871787 } ) ;
17881788 } ) ;
@@ -1896,7 +1896,12 @@ describe("activateSetupInference", () => {
18961896 sourceConfig,
18971897 runtimeConfig : {
18981898 ...sourceConfig ,
1899- agents : { ...sourceConfig . agents , entries : { main : { default : true } } } ,
1899+ agents : {
1900+ ...sourceConfig . agents ,
1901+ entries : {
1902+ main : { default : true , ...sourceConfig . agents ?. entries ?. main } ,
1903+ } ,
1904+ } ,
19001905 } ,
19011906 } ;
19021907 } ) ;
@@ -1932,7 +1937,7 @@ describe("activateSetupInference", () => {
19321937 } ) ;
19331938
19341939 expect ( result ) . toMatchObject ( { ok : true , modelRef : "claude-cli/claude-opus-5" } ) ;
1935- expect ( committedConfig ?. agents ?. defaults ?. model ) . toBe ( "claude-cli /claude-opus-5" ) ;
1940+ expect ( committedConfig ?. agents ?. defaults ?. model ) . toBe ( "anthropic /claude-opus-5" ) ;
19361941 } ) ;
19371942
19381943 it ( "persists only the verified model before OpenClaw configures the rest" , async ( ) => {
@@ -1954,7 +1959,7 @@ describe("activateSetupInference", () => {
19541959 lines : [ "Inference verified: claude-cli/claude-opus-5" ] ,
19551960 } ) ;
19561961 const persistedConfig = configHarness . current ( ) ;
1957- expect ( persistedConfig . agents ?. defaults ?. model ) . toBe ( "claude-cli /claude-opus-5" ) ;
1962+ expect ( persistedConfig . agents ?. defaults ?. model ) . toBe ( "anthropic /claude-opus-5" ) ;
19581963 expect ( persistedConfig . agents ?. defaults ?. workspace ) . toBeUndefined ( ) ;
19591964 expect ( persistedConfig . gateway ) . toBeUndefined ( ) ;
19601965 } ) ;
@@ -1987,7 +1992,7 @@ describe("activateSetupInference", () => {
19871992 expect ( onCommitStarted ) . toHaveBeenCalledWith ( lockedConfig ) ;
19881993 expect ( configHarness . current ( ) ) . toMatchObject ( {
19891994 wizard : { securityAcknowledgedAt : "2026-08-03T00:00:00.000Z" } ,
1990- agents : { defaults : { model : "claude-cli /claude-opus-5" } } ,
1995+ agents : { defaults : { model : "anthropic /claude-opus-5" } } ,
19911996 } ) ;
19921997 } ) ;
19931998
@@ -2045,7 +2050,7 @@ describe("activateSetupInference", () => {
20452050 expect ( result ) . toMatchObject ( { ok : true , modelRef : "claude-cli/claude-opus-5" } ) ;
20462051 expect ( configHarness . current ( ) ) . toMatchObject ( {
20472052 agents : {
2048- defaults : { model : "claude-cli /claude-opus-5" } ,
2053+ defaults : { model : "anthropic /claude-opus-5" } ,
20492054 entries : { main : { default : true } } ,
20502055 } ,
20512056 } ) ;
@@ -2201,9 +2206,9 @@ describe("activateSetupInference", () => {
22012206 expect ( persistedConfig . agents ?. entries ) . toEqual ( {
22022207 work : {
22032208 default : true ,
2204- model : "claude-cli /claude-opus-5" ,
2209+ model : "anthropic /claude-opus-5" ,
22052210 name : "edited during probe" ,
2206- models : { "claude-cli /claude-opus-5" : { } } ,
2211+ models : { "anthropic /claude-opus-5" : { agentRuntime : { id : "claude-cli" } } } ,
22072212 } ,
22082213 "new-agent" : { model : "anthropic/claude-opus-5" } ,
22092214 } ) ;
@@ -2465,7 +2470,7 @@ describe("activateSetupInference", () => {
24652470
24662471 expect ( result ) . toMatchObject ( { ok : true } ) ;
24672472 expect ( resolveCliRuntimeOwnerFingerprint ) . toHaveBeenCalledOnce ( ) ;
2468- expect ( configHarness . current ( ) . agents ?. defaults ?. model ) . toBe ( "claude-cli /claude-opus-5" ) ;
2473+ expect ( configHarness . current ( ) . agents ?. defaults ?. model ) . toBe ( "anthropic /claude-opus-5" ) ;
24692474 } ) ;
24702475
24712476 it ( "rejects a CLI owner drift on an existing route before handoff" , async ( ) => {
@@ -2567,11 +2572,52 @@ describe("activateSetupInference", () => {
25672572 expect ( refreshPluginRegistry ) . not . toHaveBeenCalled ( ) ;
25682573 expect ( configHarness . transform ) . toHaveBeenCalledOnce ( ) ;
25692574 expect ( configHarness . current ( ) ) . toMatchObject ( {
2570- agents : { defaults : { model : "claude-cli /claude-opus-5" } } ,
2575+ agents : { defaults : { model : "anthropic /claude-opus-5" } } ,
25712576 } ) ;
25722577 expect ( configHarness . current ( ) . plugins ?. entries ?. codex ) . toBeUndefined ( ) ;
25732578 } ) ;
25742579
2580+ it ( "does not persist a legacy claude-cli key beside an existing canonical Anthropic CLI route" , async ( ) => {
2581+ const initialConfig = {
2582+ agents : {
2583+ defaults : {
2584+ models : {
2585+ "anthropic/claude-fable-5" : { } ,
2586+ "anthropic/claude-opus-5" : {
2587+ alias : "Claude Code · Opus 5" ,
2588+ agentRuntime : { id : "claude-cli" } ,
2589+ } ,
2590+ } ,
2591+ } ,
2592+ } ,
2593+ } satisfies OpenClawConfig ;
2594+ const configHarness = createConfigTransformHarness ( initialConfig ) ;
2595+ const runCliAgent = vi . fn ( successfulRunner ( "claude-cli" , "claude-opus-5" ) ) ;
2596+
2597+ const result = await activateSetupInference ( {
2598+ kind : "claude-cli" ,
2599+ deps : {
2600+ readConfigFileSnapshot : mockConfigSnapshot ( initialConfig ) ,
2601+ runCliAgent : runCliAgent as never ,
2602+ transformConfigWithPendingPluginInstalls : configHarness . transform as never ,
2603+ } ,
2604+ } ) ;
2605+
2606+ expect ( result ) . toMatchObject ( { ok : true , modelRef : "claude-cli/claude-opus-5" } ) ;
2607+ expect ( runCliAgent ) . toHaveBeenCalledWith (
2608+ expect . objectContaining ( { provider : "claude-cli" , model : "claude-opus-5" } ) ,
2609+ ) ;
2610+ const persisted = configHarness . current ( ) ;
2611+ expect ( persisted . agents ?. defaults ?. models ) . toEqual ( initialConfig . agents . defaults . models ) ;
2612+ expect ( persisted . agents ?. defaults ?. model ) . toBe ( "anthropic/claude-opus-5" ) ;
2613+ expect ( persisted . agents ?. entries ?. main ) . toMatchObject ( {
2614+ default : true ,
2615+ models : {
2616+ "anthropic/claude-opus-5" : { agentRuntime : { id : "claude-cli" } } ,
2617+ } ,
2618+ } ) ;
2619+ } ) ;
2620+
25752621 it . each ( [
25762622 [
25772623 "an explicitly disabled Codex plugin" ,
@@ -2605,7 +2651,7 @@ describe("activateSetupInference", () => {
26052651 expect ( configHarness . transform ) . toHaveBeenCalledOnce ( ) ;
26062652 expect ( configHarness . current ( ) ) . toMatchObject ( config ) ;
26072653 expect ( configHarness . current ( ) ) . toMatchObject ( {
2608- agents : { defaults : { model : "claude-cli /claude-opus-5" } } ,
2654+ agents : { defaults : { model : "anthropic /claude-opus-5" } } ,
26092655 } ) ;
26102656 } ) ;
26112657
0 commit comments