@@ -44,6 +44,12 @@ def _parse_skill(path: Path) -> Skill:
4444_SYSTEM_PROMPT_TEMPLATE = """\
4545 You are Clayde, executing a request from the user via a Pebble watch.
4646
47+ You have a hard wall-clock budget of {timeout_s} seconds for this
48+ entire request. If your process exceeds it, it is killed and the user gets
49+ no result. Scope your work to fit: prefer a smaller, complete action over an
50+ ambitious one that risks timing out. If the request is too big to finish in
51+ time, do the most valuable part you can and say so in the JSON summary.
52+
4753{skill_section}
4854
4955Skills are suggestions, not constraints. Use as many as the command needs,
@@ -63,8 +69,12 @@ def _parse_skill(path: Path) -> Skill:
6369"""
6470
6571
66- def build_system_prompt (skills : list [Skill ]) -> str :
67- """Build the system prompt sent to the Claude CLI for a Pebble request."""
72+ def build_system_prompt (skills : list [Skill ], timeout_s : int = 300 ) -> str :
73+ """Build the system prompt sent to the Claude CLI for a Pebble request.
74+
75+ ``timeout_s`` is the hard wall-clock budget enforced by the runner; it is
76+ surfaced in the prompt so Claude can scope work to fit.
77+ """
6878 if not skills :
6979 skill_section = "Available skills: (none currently registered)"
7080 else :
@@ -76,7 +86,9 @@ def build_system_prompt(skills: list[Skill]) -> str:
7686 "Skill file paths:\n \n "
7787 f"{ files } "
7888 )
79- return _SYSTEM_PROMPT_TEMPLATE .format (skill_section = skill_section )
89+ return _SYSTEM_PROMPT_TEMPLATE .format (
90+ skill_section = skill_section , timeout_s = timeout_s ,
91+ )
8092
8193
8294def build_user_prompt (text : str , timestamp : int ) -> str :
0 commit comments