Conversation
…ni fallback Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
|
Before merging PR #10, verify that the configured models are available via GitHub Models. Use the GitHub Models API to check availability of: anthropic/claude-sonnet-4.6 If both exist: If either is unavailable: Prefer the following fallback order: anthropic/claude-sonnet-4.6 and keep google/gemini-3-pro as secondary fallback if available. Push any necessary corrections to PR #10. |
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Implemented in commit I added a workflow-time GitHub Models API catalog check that resolves models before running repo_architect:
This makes PR #10 safe to merge because model selection now adapts to actual catalog availability at runtime instead of assuming fixed IDs. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🧪 CI — Python 3.10 |
🧪 CI — Python 3.11 |
There was a problem hiding this comment.
Pull request overview
This PR updates repo-architect’s GitHub Actions workflow and workflow generator to resolve preferred/fallback GitHub Models dynamically from the GitHub Models catalog at runtime, while ensuring explicit github_model overrides take precedence and keeping existing “preferred then fallback” call semantics.
Changes:
- Add a workflow step that queries
https://models.github.ai/catalog/modelsand exportsREPO_ARCHITECT_PREFERRED_MODEL/REPO_ARCHITECT_FALLBACK_MODELviaGITHUB_ENV. - Update
repo_architect.pyto preferconfig.github_modeloverconfig.preferred_modelwherever the chosen model is computed, and update default model IDs. - Add focused tests to validate config/env behavior, override precedence, and generated workflow YAML wiring.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tests/test_repo_architect.py |
Adds tests for env-based model config, explicit override precedence, and workflow YAML catalog-resolution wiring. |
repo_architect.py |
Updates default model IDs, enforces override precedence, and updates generated workflow YAML to include catalog-resolution step. |
.github/workflows/repo-architect.yml |
Adds catalog-based model resolution step and removes hard-coded preferred/fallback env values from the run step. |
.github/workflows/repo-architect.yml
Outdated
| if available: | ||
| preferred = first_available(order) | ||
| if preferred is None: | ||
| preferred = secondary if secondary in available else order[0] |
.github/workflows/repo-architect.yml
Outdated
| preferred = first_available(order) | ||
| if preferred is None: | ||
| preferred = secondary if secondary in available else order[0] | ||
| else: | ||
| preferred = order[0] | ||
|
|
||
| if secondary in available and secondary != preferred: | ||
| fallback = secondary | ||
| else: | ||
| fallback = ( | ||
| first_available([c for c in order if c != preferred]) | ||
| or (secondary if secondary in available else order[-1]) | ||
| ) | ||
|
|
||
| if not isinstance(preferred, str) or not preferred: | ||
| preferred = order[0] | ||
| if not isinstance(fallback, str) or not fallback: | ||
| fallback = secondary if secondary != preferred else order[-1] |
repo_architect.py
Outdated
| preferred = first_available(order) | ||
| if preferred is None: | ||
| preferred = secondary if secondary in available else order[0] | ||
| else: | ||
| preferred = order[0] | ||
|
|
||
| if secondary in available and secondary != preferred: | ||
| fallback = secondary | ||
| else: | ||
| fallback = ( | ||
| first_available([c for c in order if c != preferred]) | ||
| or (secondary if secondary in available else order[-1]) | ||
| ) |
repo_architect.py
Outdated
| if preferred is None: | ||
| preferred = secondary if secondary in available else order[0] | ||
| else: | ||
| preferred = order[0] | ||
|
|
||
| if secondary in available and secondary != preferred: | ||
| fallback = secondary | ||
| else: | ||
| fallback = ( | ||
| first_available([c for c in order if c != preferred]) | ||
| or (secondary if secondary in available else order[-1]) | ||
| ) | ||
|
|
||
| if not isinstance(preferred, str) or not preferred: | ||
| preferred = order[0] | ||
| if not isinstance(fallback, str) or not fallback: | ||
| fallback = secondary if secondary != preferred else order[-1] |
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Applied in commit I updated the workflow + generated template to ensure catalog-success paths never pick known-unavailable models:
|
Description
Repo architect previously relied on fixed model defaults. Based on feedback, this PR now resolves model availability at workflow runtime using the GitHub Models catalog API, while preserving explicit
github_modeloverride behavior and existing fallback semantics inrepo_architect.py.Workflow model resolution
Resolve GitHub Models configurationstep in.github/workflows/repo-architect.ymlthat queries:https://models.github.ai/catalog/modelsanthropic/claude-sonnet-4.6anthropic/claude-sonnet-4.5openai/gpt-4.1google/gemini-3-proas secondary fallback when available.GITHUB_ENVas:REPO_ARCHITECT_PREFERRED_MODELREPO_ARCHITECT_FALLBACK_MODELGITHUB_ENVcontext.permissionsremain unchanged and still includemodels: readplus write permissions.Review-thread hardening (available-only behavior)
order[0]/order[-1]unavailable picks in catalog-success paths.repo_architect.py::workflow_yaml(...)so generated workflow YAML matches checked-in workflow behavior.Runtime model selection
repo_architect.py(preferred first, retry fallback on model-unavailable errors, do not abort if preferred fails).github_modeloverride precedence.Targeted coverage
tests/test_repo_architect.pyto validate:--github-modelonly when provided)github_modelprecedence and model fallback tests remain coveredRelated Issues
Handled by system automation.
Test Evidence
source godelos_venv/bin/activate && python -m pytest tests/test_repo_architect.py::TestModelConfiguration tests/test_repo_architect.py::TestCallModelsWithFallback -v8 passedsource godelos_venv/bin/activate && python -m pytest tests/test_repo_architect.py::TestModelConfiguration -q3 passedsource godelos_venv/bin/activate && python -m pytest tests/test_repo_architect.py -v60 passed0 alerts(actions, python)Checklist
pytest tests/)black .andisort .)📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.