refactor: name the terminal display helper after its setting

The two helpers behind the backend terminal file display default used two different words for one thing: `is_terminal_file_display_inline` after the `terminalFileDisplay` setting, and `apply_display_file_inline_default` after the tool. The second also dropped the `terminal_` prefix every neighbour in this file carries (`build_terminal_file_tool_result`, `terminal_event_handler`), so it read as a generic helper despite only ever firing for `terminal:` tools.

Renamed it to `apply_terminal_file_display_default` so both helpers speak the settings key's vocabulary and both carry the prefix. Identifier only, no behaviour change: substituting the old name back makes the file byte-identical to the previous commit, and ruff reports the same 62 diagnostics before and after.
This commit is contained in:
Classic298 2026-08-31 03:50:13 +02:00
parent b7c8082965
commit 6fd5807344

View file

@ -311,7 +311,7 @@ async def is_terminal_file_display_inline(user: UserModel) -> bool:
return value == 'inline'
async def apply_display_file_inline_default(
async def apply_terminal_file_display_default(
tool_function_name: str,
tool_function_params: dict,
tool: dict | None,
@ -3204,7 +3204,7 @@ async def execute_tool_call_for_output(request, form_data, user, metadata, event
direct_tool = tool.get('direct', False)
allowed_params = spec.get('parameters', {}).get('properties', {}).keys()
params = {key: value for key, value in params.items() if key in allowed_params}
params = await apply_display_file_inline_default(name, params, tool, user)
params = await apply_terminal_file_display_default(name, params, tool, user)
try:
if direct_tool:
@ -5665,7 +5665,7 @@ async def streaming_chat_response_handler(response, ctx):
direct_tool = tool.get('direct', False)
allowed_params = spec.get('parameters', {}).get('properties', {}).keys()
params = {key: value for key, value in params.items() if key in allowed_params}
params = await apply_display_file_inline_default(name, params, tool, user)
params = await apply_terminal_file_display_default(name, params, tool, user)
try:
if direct_tool:
result = await event_caller(