Skip to content

Commit f29dff1

Browse files
committed
walkthroughs: Update with model selection and refresh walkthroughs
1 parent 7a88363 commit f29dff1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+25414
-10666
lines changed

build_tools/generate_code_walkthroughs.py

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ class Config:
331331
force_regenerate: bool = False # regenerate all docs regardless of timestamps
332332
execution_log_path: str = "docs/implementation_walkthrough/execution_log.jsonl"
333333
spec_dir: str = "docs/language_specification"
334+
claude_model: Optional[str] = "claude-sonnet-4-5-20250929" # Model for Claude CLI
335+
copilot_model: Optional[str] = "claude-sonnet-4.5" # Model for Copilot CLI
336+
337+
def get_model_for_provider(self, provider: str) -> Optional[str]:
338+
"""Get the appropriate model for the given provider."""
339+
if provider == "claude":
340+
return self.claude_model
341+
elif provider == "copilot":
342+
return self.copilot_model
343+
return None
334344

335345
def __post_init__(self):
336346
if self.source_dirs is None:
@@ -672,7 +682,7 @@ def log_execution(
672682

673683

674684
def _build_cli_command(
675-
cli_provider: str, prompt: str
685+
cli_provider: str, prompt: str, model: Optional[str] = None
676686
) -> Tuple[List[str], Optional[str]]:
677687
"""
678688
Build the command line arguments for the specified CLI provider.
@@ -690,39 +700,42 @@ def _build_cli_command(
690700
Args:
691701
cli_provider: Either "copilot" or "claude"
692702
prompt: The prompt to send to the AI
703+
model: Optional model identifier for the CLI
693704
694705
Returns:
695706
Tuple of (command arguments, stdin input or None)
696707
"""
697708
if cli_provider == "copilot":
698709
# GitHub Copilot CLI: explicitly allow only read and write tools
699710
# This prevents shell access, file deletion, or editing existing files
700-
return (
701-
[
702-
"/opt/homebrew/bin/copilot",
703-
"--prompt",
704-
prompt,
705-
"--allow-tool",
706-
"read",
707-
"--allow-tool",
708-
"write",
709-
],
710-
None,
711-
)
711+
cmd = [
712+
"/opt/homebrew/bin/copilot",
713+
"--prompt",
714+
prompt,
715+
"--allow-tool",
716+
"read",
717+
"--allow-tool",
718+
"write",
719+
]
720+
# Add model if specified
721+
if model:
722+
cmd.extend(["--model", model])
723+
return (cmd, None)
712724
elif cli_provider == "claude":
713725
# Claude Code CLI: explicitly allow only Read and Write tools
714726
# Do NOT use --dangerously-skip-permissions as it bypasses all safety checks
715727
# Only Read and Write are allowed - no Bash, Edit, or other tools
716728
# The prompt is passed via stdin when using --print mode
717-
return (
718-
[
719-
"claude",
720-
"--print",
721-
"--allowedTools",
722-
"Read,Write",
723-
],
724-
prompt,
725-
)
729+
cmd = [
730+
"claude",
731+
"--print",
732+
"--allowedTools",
733+
"Read,Write",
734+
]
735+
# Add model if specified
736+
if model:
737+
cmd.extend(["--model", model])
738+
return (cmd, prompt)
726739
else:
727740
raise ValueError(f"Unknown CLI provider: {cli_provider}")
728741

@@ -848,7 +861,9 @@ async def analyze_file_with_cli(
848861
8. **Cross-References**: If this file is a partial class or heavily depends on other files, include links to related documentation files."""
849862

850863
# Build the command for the specified CLI provider
851-
cmd, stdin_input = _build_cli_command(cli_provider, prompt)
864+
# Get the appropriate model for this provider
865+
model = config.get_model_for_provider(cli_provider)
866+
cmd, stdin_input = _build_cli_command(cli_provider, prompt, model=model)
852867

853868
# Determine label for heartbeat logging
854869
heartbeat_label = "Claude" if cli_provider == "claude" else "Copilot"
@@ -1474,6 +1489,19 @@ def main():
14741489
help="Force regeneration of all documentation, even if up-to-date",
14751490
)
14761491

1492+
parser.add_argument(
1493+
"--claude-model",
1494+
default="claude-sonnet-4-5-20250929",
1495+
help="Model for Claude CLI (default: claude-sonnet-4-5-20250929)",
1496+
)
1497+
1498+
parser.add_argument(
1499+
"--copilot-model",
1500+
default="claude-sonnet-4.5",
1501+
help="Model for Copilot CLI. Choices: claude-sonnet-4.5, gpt-5.1, "
1502+
"gemini-3-pro-preview, etc. (default: claude-sonnet-4.5)",
1503+
)
1504+
14771505
args = parser.parse_args()
14781506

14791507
# Validate arguments
@@ -1497,6 +1525,8 @@ def main():
14971525
output_dir=args.output_dir,
14981526
cli_provider=args.cli,
14991527
force_regenerate=args.force,
1528+
claude_model=args.claude_model,
1529+
copilot_model=args.copilot_model,
15001530
)
15011531

15021532
# Run async main

0 commit comments

Comments
 (0)