Kill hung runs early when a pinned pool model is delisted#621
Open
seonghobae wants to merge 1 commit into
Open
Kill hung runs early when a pinned pool model is delisted#621seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
Extend the model-pool watchdog and fatal-failure classification with model-unavailable signatures (OpenRouter 'No endpoints found' / 'not a valid model ID', OpenAI-style model_not_found, ProviderModelNotFoundError) so a delisted pinned free model is killed within the poll interval and skipped instead of burning the candidate run budget. Sanitize ':' in per-candidate file names so ':free' candidates survive Windows and actions/upload-artifact. Review timing (timeouts, deadlines, context caps) is untouched. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the OpenCode model-pool runner so it can fail over quickly when a pinned OpenRouter free-tier model is delisted (model-unavailable errors), avoiding long hangs that consume the entire retry budget and delay org-wide PR governance workflows.
Changes:
- Extend fatal-provider detection to include model-unavailable signatures (e.g., “No endpoints found”, “not a valid model”,
model_not_found) and treat them as non-retryable for the current model candidate. - Classify these failures as
class=model-unavailablein sanitized diagnostics while keeping provider-controlled content suppressed. - Sanitize per-candidate filenames to replace
:as well as/, preventing Windows andactions/upload-artifactpath issues for:freemodel suffixes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/ci/run_opencode_review_model_pool.sh | Detects model-unavailable error events to kill hung runs early, skips futile retries for delisted models, emits model-unavailable diagnostics, and sanitizes : in candidate-derived filenames. |
| tests/test_opencode_model_pool_runner.py | Adds a regression test ensuring an OpenRouter “No endpoints found … :free” error kills a hung run quickly, skips remaining attempts, and logs class=model-unavailable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening after #619 pinned OpenRouter free models in the OpenCode review pool.
Problem
If a pinned free model is delisted, OpenRouter answers with a model-unavailable error (
No endpoints found for <model>,not a valid model ID) and some provider paths then hang instead of exiting.has_fatal_provider_error_eventonly recognized context-window/quota signatures, so a delisted candidate would burn its full run budget before the pool fell through.Changes (
scripts/ci/run_opencode_review_model_pool.sh)has_fatal_provider_error_eventnow also matches model-unavailable signatures (no endpoints,not a valid model,model_not_found/model not found,ModelNotFoundError) — still only on structured"type":"error"events, so model prose quoting these strings never kills a healthy run.is_fatal_provider_failurematches the same signatures, so a delisted model returns the skip-remaining-attempts path instead of retrying a model that cannot recover.emit_sanitized_opencode_failure_detailclassifies these asclass=model-unavailable(metadata only, provider content stays suppressed).:(OpenRouter:freesuffix), which Windows andactions/upload-artifactreject.Review timing (timeouts / deadlines / context caps) is untouched.
Tests
test_delisted_openrouter_model_error_kills_hung_run_early: openrouter-shaped candidate (openrouter/nvidia/nemotron-3-ultra-550b-a55b:free) with an OpenRouter-shapedNo endpoints founderror event; asserts the hung fake run is killed in seconds, remaining attempts are skipped, andclass=model-unavailableis logged.tests/test_opencode_model_pool_runner.py: 18 passed;tests/test_opencode_agent_contract.py: 34 passed (1 deselected locally: pre-existing WSL-bash hang on Windows, unrelated); shell-syntax tests +bash -npass.