Skip to content

Commit 05f3c8a

Browse files
committed
dogfooding: Update prompts with model selection
1 parent 81ba93a commit 05f3c8a

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Screen files
2+
screenlog.*
3+
14
# SQLite database files
25
*.db
36
*.db-wal

build_tools/shared/backends/copilot.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,13 +263,9 @@ def _build_command(self, prompt: str, config: BackendConfig) -> list[str]:
263263
tool_name = tool.value.lower()
264264
cmd.extend(["--allow-tool", tool_name])
265265

266-
# Note: Copilot CLI doesn't support model selection via CLI flags
267-
# If model is specified, we log a warning but proceed
268-
if config.model and self._heartbeat_callback:
269-
self._heartbeat_callback(
270-
f"Warning: Copilot CLI doesn't support model selection. "
271-
f"Ignoring model: {config.model}"
272-
)
266+
# Add model if specified
267+
if config.model:
268+
cmd.extend(["--model", config.model])
273269

274270
return cmd
275271

build_tools/sharpy_dogfood/backends.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ async def execute(
200200
shared_config = SharedBackendConfig(
201201
timeout_seconds=int(effective_timeout),
202202
allowed_tools={ToolPermission.READ}, # Read-only for validation
203+
model=self.config.model, # Use model from backend config
203204
)
204205

205206
# Execute via shared backend (includes heartbeat logging)
@@ -273,6 +274,7 @@ async def execute(
273274
shared_config = SharedBackendConfig(
274275
timeout_seconds=int(effective_timeout),
275276
allowed_tools={ToolPermission.READ}, # Read-only for validation
277+
model=self.config.model, # Use model from backend config
276278
)
277279

278280
# Execute via shared backend (includes heartbeat logging)
@@ -292,7 +294,7 @@ async def execute(
292294
class BackendManager:
293295
"""Manages multiple AI backends with automatic failover."""
294296

295-
BACKEND_PRIORITY = ["claude", "copilot"]
297+
BACKEND_PRIORITY: list[BackendType] = ["claude", "copilot"]
296298

297299
def __init__(self, config: Config):
298300
self.config = config

build_tools/sharpy_dogfood/config.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ class BackendConfig:
4242
claude_cli_path: Optional[str] = None
4343
copilot_cli_path: Optional[str] = None
4444

45+
# Model to use for this backend (if None, uses backend default)
46+
model: Optional[str] = None
47+
48+
49+
# Default models for dogfooding
50+
CLAUDE_CLI_MODEL = "claude-sonnet-4-5-20250929" # Full model name for Claude CLI
51+
COPILOT_CLI_MODEL = "claude-sonnet-4.5" # Copilot CLI model format
52+
4553

4654
@dataclass
4755
class Config(BaseConfig):
@@ -77,8 +85,8 @@ class Config(BaseConfig):
7785
# Backend configuration
7886
backends: dict[BackendType, BackendConfig] = field(
7987
default_factory=lambda: {
80-
"claude": BackendConfig(name="claude"),
81-
"copilot": BackendConfig(name="copilot"),
88+
"claude": BackendConfig(name="claude", model=CLAUDE_CLI_MODEL),
89+
"copilot": BackendConfig(name="copilot", model=COPILOT_CLI_MODEL),
8290
}
8391
)
8492

build_tools/sharpy_dogfood/prompts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def get_code_generation_prompt(
155155
spec_context: str,
156156
feature_focus: str = "general",
157157
complexity: str = "simple",
158-
example_snippets: list[str] = None,
158+
example_snippets: list[str] | None = None,
159159
existing_fixtures_section: str = "",
160160
) -> str:
161161
"""Generate a prompt for creating Sharpy code.

0 commit comments

Comments
 (0)