-
Notifications
You must be signed in to change notification settings - Fork 0
diagnose(ci): isolate Bytez discovery 500 #1472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
604eed8
diagnose(ci): isolate Bytez discovery 500
seonghobae 057bfc5
chore(ci): trigger ready-state Bytez diagnostic
seonghobae 43fc21b
Merge branch 'main' into diagnose/bytez-discovery-status
opencode-agent[bot] 6b02794
chore(ci): trigger Bytez status probe
seonghobae ab77b88
fix(ci): scope Bytez diagnostic to probe PR
seonghobae 25b822a
Merge remote-tracking branch 'origin/diagnose/bytez-discovery-status'…
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,40 @@ if [ "$provider_secret_count" -lt 1 ]; then | |
| fi | ||
| log "provider secrets present: $provider_secret_count of 5" | ||
|
|
||
| # Temporary PR-only diagnostic: emit status codes, never response bodies or | ||
| # credential metadata, to isolate Bytez's persistent authenticated HTTP 500. | ||
| if [ "${PR_NUMBER:-}" = "1473" ] && [ -n "${BYTEZ_API_KEY:-}" ]; then | ||
| python3 - <<'PY' | ||
| import os | ||
| import urllib.error | ||
| import urllib.request | ||
|
|
||
| key = os.environ["BYTEZ_API_KEY"] | ||
| cases = ( | ||
| ("raw_task", key, "https://api.bytez.com/models/v2/list/models?task=chat"), | ||
| ("raw_all", key, "https://api.bytez.com/models/v2/list/models"), | ||
| ("bearer_task", f"Bearer {key}", "https://api.bytez.com/models/v2/list/models?task=chat"), | ||
| ("key_task", f"Key {key}", "https://api.bytez.com/models/v2/list/models?task=chat"), | ||
| ) | ||
| for name, authorization, url in cases: | ||
| request = urllib.request.Request( | ||
| url, | ||
| headers={"authorization": authorization, "user-agent": "contextual-orchestrator/bytez-diagnostic"}, | ||
| ) | ||
| try: | ||
| response = urllib.request.urlopen(request, timeout=30) | ||
| except urllib.error.HTTPError as exc: | ||
| code = exc.code | ||
| exc.close() | ||
| except (OSError, TimeoutError, urllib.error.URLError) as exc: | ||
| code = type(exc).__name__ | ||
|
Comment on lines
+90
to
+91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Diagnostic response aborts every review If Bytez returns a malformed HTTP response, Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| else: | ||
| code = response.status | ||
| response.close() | ||
| print(f"[contextual-orchestrator-sidecar] bytez diagnostic {name}={code}") | ||
| PY | ||
| fi | ||
|
|
||
| ORCHESTRATOR_TOKEN="${ORCHESTRATOR_TOKEN:-$($sidecar_python -c 'import secrets; print(secrets.token_urlsafe(32))')}" | ||
| case "$ORCHESTRATOR_TOKEN" in | ||
| *$'\r'*|*$'\n'*) fail "ORCHESTRATOR_TOKEN must not contain CR or LF" ;; | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Unrelated pull requests trigger diagnostics
Any repository's pull request 1473 satisfies
PR_NUMBERwithout a repository check. Its reviews send four unintended Bytez requests and can add two minutes.Was this helpful? React with 👍 or 👎 to provide feedback.