@@ -279,6 +279,44 @@ describe("new_task thinking_effort validation (DTE series 5/5)", () => {
279279 expect ( delegateParentAndOpenChild ) . not . toHaveBeenCalled ( )
280280 } )
281281
282+ it ( "filters unknown capability strings out of the supported levels (DTE series 5/5)" , async ( ) => {
283+ const { task } = makeTask ( {
284+ supportsReasoningEffort : [ "turbo" , "low" , "disable" ] ,
285+ askEffort : "low" ,
286+ } )
287+ const callbacks = makeCallbacks ( )
288+
289+ await runNewTask ( task , { thinking_effort : "low" } , callbacks )
290+
291+ // Registry data is normalized to the known level set: the unknown "turbo"
292+ // and the settings off-switch "disable" never reach the ask payload.
293+ expect ( callbacks . askApproval ) . toHaveBeenCalledTimes ( 1 )
294+ const [ askType , toolMessage ] = vi . mocked ( callbacks . askApproval ) . mock . calls [ 0 ]
295+ expect ( askType ) . toBe ( "tool" )
296+ const payload = JSON . parse ( toolMessage as string ) as {
297+ tool : string
298+ supportedThinkingEfforts ?: string [ ]
299+ }
300+ expect ( payload . tool ) . toBe ( "newTask" )
301+ expect ( payload . supportedThinkingEfforts ) . toEqual ( [ "low" ] )
302+ } )
303+
304+ it ( "treats a capability array of only unknown values as unsupported (DTE series 5/5)" , async ( ) => {
305+ const { task, delegateParentAndOpenChild } = makeTask ( {
306+ supportsReasoningEffort : [ "turbo" ] ,
307+ } )
308+ const callbacks = makeCallbacks ( )
309+
310+ await runNewTask ( task , { thinking_effort : "low" } , callbacks )
311+
312+ // Normalization drops the unknown value, leaving no start level: the
313+ // unsupported-model wording is the accurate hint.
314+ expect ( callbacks . pushToolResult ) . toHaveBeenCalledWith (
315+ expect . stringContaining ( "does not support thinking_effort" ) ,
316+ )
317+ expect ( delegateParentAndOpenChild ) . not . toHaveBeenCalled ( )
318+ } )
319+
282320 it ( "pre-fills the ask payload with the effort and the supported levels, filtering 'disable'" , async ( ) => {
283321 const { task } = makeTask ( {
284322 supportsReasoningEffort : [ "disable" , "low" , "medium" ] ,
0 commit comments