From ac26fb261c70a002ca74171140a0c1d4f008074f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 6 Jul 2026 18:21:55 -0500 Subject: [PATCH] refac --- cptr/utils/prompt_templates.py | 1 + cptr/utils/tools.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cptr/utils/prompt_templates.py b/cptr/utils/prompt_templates.py index 7ea728f..8d82e95 100644 --- a/cptr/utils/prompt_templates.py +++ b/cptr/utils/prompt_templates.py @@ -168,6 +168,7 @@ def _format_cptr_context(workspace: str, model: str = "") -> str: "Tool behavior:", f"- {host_control}", "- Use the available tools before claiming you cannot inspect or change something.", + "- If the user asks to show a file in chat, use display_file.", "- For machine-level requests such as volume, brightness, apps, services, packages, " "network state, or files, check the runtime and use appropriate shell commands or " "configured tools when available.", diff --git a/cptr/utils/tools.py b/cptr/utils/tools.py index e2268bc..1abb9a1 100644 --- a/cptr/utils/tools.py +++ b/cptr/utils/tools.py @@ -849,8 +849,8 @@ async def write_file(path: str, content: str, *, workspace: str) -> str: async def display_file(path: str, *, workspace: str) -> str: - """Display an existing real file from the computer in chat. - Use only for files you have just created or verified with file tools. + """Display a workspace file inline in chat. + Use when the user asks to see, preview, render, or display a file you created or found. :param path: Path relative to workspace root. """ if not path: