-
Notifications
You must be signed in to change notification settings - Fork 17
fix(api-proxy): address review comments on OpenCode port 10004 routing #1984
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
+286
−21
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b0c4a73
Initial plan
Copilot 24e4cae
fix: update OpenCode proxy to default to Copilot/OpenAI routing
Copilot 7c27652
fix: address code review - correct comment to use COPILOT_AUTH_TOKEN
Copilot 6ae99bc
fix: address review comments from PR #1979
Copilot 46217c1
fix: handle null route with 503 response in OpenCode proxy handlers
Copilot 4ba4f13
refactor: eliminate code duplication in OpenCode proxy routing
Copilot 21e990d
Update containers/api-proxy/server.js
lpcox 4b76ccd
Update containers/api-proxy/server.js
lpcox 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 |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| --- | ||
| description: Smoke test workflow that validates OpenCode engine functionality by testing AWF firewall capabilities | ||
| on: | ||
| roles: all | ||
| schedule: every 12h | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| reaction: "rocket" | ||
| permissions: | ||
| contents: read | ||
| issues: read | ||
| pull-requests: read | ||
| discussions: read | ||
| name: Smoke OpenCode | ||
| engine: opencode | ||
| strict: true | ||
| imports: | ||
| - shared/gh.md | ||
| - shared/reporting.md | ||
| network: | ||
| allowed: | ||
| - defaults | ||
| - github | ||
| tools: | ||
| cache-memory: true | ||
| github: | ||
| toolsets: [repos, pull_requests] | ||
| edit: | ||
| bash: | ||
| - "*" | ||
| safe-outputs: | ||
| threat-detection: | ||
| enabled: false | ||
| add-comment: | ||
| hide-older-comments: true | ||
| max: 2 | ||
| create-issue: | ||
| expires: 2h | ||
| close-older-issues: true | ||
| add-labels: | ||
| allowed: [smoke-opencode] | ||
| hide-comment: | ||
| messages: | ||
| footer: "> 🌐 *Transmitted by [{workflow_name}]({run_url})*" | ||
| run-started: "🌐 [{workflow_name}]({run_url}) is initializing on this {event_type}..." | ||
| run-success: "✅ [{workflow_name}]({run_url}) completed successfully. All systems nominal. 🚀" | ||
| run-failure: "❌ [{workflow_name}]({run_url}) {status}. Investigation required..." | ||
| timeout-minutes: 15 | ||
| post-steps: | ||
| - name: Validate safe outputs were invoked | ||
| run: | | ||
| OUTPUTS_FILE="${GH_AW_SAFE_OUTPUTS:-${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl}" | ||
| if [ ! -s "$OUTPUTS_FILE" ]; then | ||
| echo "::error::No safe outputs were invoked. Smoke tests require the agent to call safe output tools." | ||
| exit 1 | ||
| fi | ||
| echo "Safe output entries found: $(wc -l < "$OUTPUTS_FILE")" | ||
| if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then | ||
| if ! grep -q '"add_comment"' "$OUTPUTS_FILE"; then | ||
| echo "::error::Agent did not call add_comment on a pull_request trigger." | ||
| exit 1 | ||
| fi | ||
| echo "add_comment verified for PR trigger" | ||
| fi | ||
| echo "Safe output validation passed" | ||
| --- | ||
|
|
||
| > **Note:** This workflow has not yet been compiled to a `.lock.yml` file and is **not active** in GitHub Actions. | ||
| > Compilation is pending `opencode` engine support in gh-aw. Once the engine is supported, run | ||
| > `gh-aw compile .github/workflows/smoke-opencode.md` followed by | ||
| > `npx tsx scripts/ci/postprocess-smoke-workflows.ts` to generate the lock file. | ||
|
|
||
| # Smoke Test: OpenCode Engine Validation | ||
|
|
||
| **IMPORTANT: Keep all outputs extremely short and concise. Use single-line responses where possible. No verbose explanations.** | ||
|
|
||
| ## Test Requirements | ||
|
|
||
| 1. **GitHub MCP Testing**: Review the last 2 merged pull requests in `__GH_AW_GITHUB_REPOSITORY__` | ||
| 2. **File Writing Testing**: Create a test file `/tmp/gh-aw/agent/smoke-test-opencode-${{ github.run_id }}.txt` with content "Smoke test passed for OpenCode at $(date)" (create the directory if it doesn't exist) | ||
| 3. **Bash Tool Testing**: Execute bash commands to verify file creation was successful (use `cat` to read the file back) | ||
| 4. **Build AWF**: Run `npm ci && npm run build` to verify the agent can successfully build the AWF project. If the command fails, mark this test as ❌ and report the failure. | ||
| 5. **Add Comment**: Use the `add_comment` tool to post a brief summary comment on the current pull request | ||
|
|
||
| ## Output | ||
|
|
||
| **REQUIRED**: Call `add_comment` to post a brief comment (max 5-10 lines) on the current pull request (this is validated by the post-step check) containing: | ||
| - PR titles only (no descriptions) | ||
| - ✅ or ❌ for each test result | ||
| - Overall status: PASS or FAIL | ||
|
|
||
| If all tests pass: | ||
| - Use the `add_labels` safe-output tool to add the label `smoke-opencode` to the pull request |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.