@@ -1088,19 +1088,13 @@ def memory_clear(memory_scope_key: str | None, confirm_clear: bool, output_json:
10881088# Search Command
10891089# =============================================================================
10901090
1091- # Search mode translation. V1 accepts turbo/fast/basic/advanced natively; the
1092- # Beta-only values stay accepted CLI inputs and are translated so existing
1093- # scripts keep working. Beta's `fast` used to downgrade to basic, but V1 now has
1094- # a native fast mode of its own, so the name passes through.
1095- _SEARCH_MODE_MAP = {
1096- "turbo" : "turbo" ,
1097- "fast" : "fast" ,
1098- "basic" : "basic" ,
1099- "advanced" : "advanced" ,
1091+ # V1 modes are listed first in CLI help; fast is now native and passes through.
1092+ # Beta-only names remain deprecated aliases so existing scripts keep working.
1093+ _SEARCH_MODES = ("turbo" , "fast" , "basic" , "advanced" )
1094+ _DEPRECATED_SEARCH_MODE_ALIASES = {
11001095 "one-shot" : "basic" ,
11011096 "agentic" : "advanced" ,
11021097}
1103- _DEPRECATED_SEARCH_MODES = {"one-shot" , "agentic" }
11041098
11051099
11061100def _emit_deprecation (message : str ) -> None :
@@ -1135,7 +1129,7 @@ def build_search_v1_kwargs(
11351129 if objective :
11361130 kwargs ["objective" ] = objective
11371131 if mode :
1138- kwargs ["mode" ] = _SEARCH_MODE_MAP .get (mode , mode )
1132+ kwargs ["mode" ] = _DEPRECATED_SEARCH_MODE_ALIASES .get (mode , mode )
11391133 if excerpt_max_chars_total is not None :
11401134 kwargs ["max_chars_total" ] = excerpt_max_chars_total
11411135 if session_id :
@@ -1165,10 +1159,12 @@ def build_search_v1_kwargs(
11651159@click .option ("-q" , "--query" , multiple = True , help = "Keyword search query (can be repeated)" )
11661160@click .option (
11671161 "--mode" ,
1168- type = click .Choice (list ( _SEARCH_MODE_MAP . keys ()) ),
1162+ type = click .Choice ([ * _SEARCH_MODES , * _DEPRECATED_SEARCH_MODE_ALIASES ] ),
11691163 default = "basic" ,
1170- help = "Search mode: turbo (fastest), fast (high quality within ~1s), basic, "
1171- "or advanced (highest quality; one-shot → basic, agentic → advanced)" ,
1164+ help = (
1165+ "Search mode: turbo (fastest), fast (high quality within ~1s), basic, "
1166+ "or advanced (highest quality). Deprecated aliases: one-shot → basic, agentic → advanced"
1167+ ),
11721168 show_default = True ,
11731169)
11741170@click .option ("--max-results" , type = int , help = "Maximum results (defaults to server-side default of 10)" )
@@ -1222,12 +1218,9 @@ def search(
12221218 if not objective and not query :
12231219 raise click .UsageError ("Provide an OBJECTIVE argument or at least one --query option." )
12241220
1225- if mode in _DEPRECATED_SEARCH_MODES :
1226- new_mode = _SEARCH_MODE_MAP [mode ]
1227- _emit_deprecation (
1228- f"--mode { mode } is a Beta value and will stop working after the Beta API sunset (June 2026). "
1229- f"Use --mode { new_mode } instead."
1230- )
1221+ if mode in _DEPRECATED_SEARCH_MODE_ALIASES :
1222+ new_mode = _DEPRECATED_SEARCH_MODE_ALIASES [mode ]
1223+ _emit_deprecation (f"--mode { mode } is a deprecated alias. Use --mode { new_mode } instead." )
12311224
12321225 source_policy : dict [str , Any ] = {}
12331226 if include_domains :
0 commit comments