feat(mcp): add OAuth support to MCP install flow

Squash merge PR #1583.

This merge commit was created by an AI agent (OpenHands) on behalf of Graham Neubig.

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Graham Neubig
2026-07-07 12:03:36 +02:00
committed by GitHub
co-authored by openhands
parent d2cfffb7ef
commit c552545926
85 changed files with 5713 additions and 835 deletions
+31 -1
View File
@@ -139,6 +139,30 @@ jobs:
run: |
echo "agent_server_version=$(node -p "require('./config/defaults.json').versions.agentServer")" >> "$GITHUB_OUTPUT"
- name: Resolve linked SDK PR
id: linked_sdk
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
BODY=$(gh api "/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" --jq '.body // ""')
SDK_PR=$(
printf '%s\n' "$BODY" \
| grep -Eo 'OpenHands/software-agent-sdk(/pull/|#)[0-9]+' \
| head -n1 \
| grep -Eo '[0-9]+$' \
|| true
)
if [ -z "$SDK_PR" ]; then
echo "No linked software-agent-sdk PR found in PR description."
exit 0
fi
SDK_REF=$(gh api "/repos/OpenHands/software-agent-sdk/pulls/${SDK_PR}" --jq '.head.ref')
SDK_SHA=$(gh api "/repos/OpenHands/software-agent-sdk/pulls/${SDK_PR}" --jq '.head.sha')
echo "Using software-agent-sdk PR #${SDK_PR} branch: ${SDK_REF} (${SDK_SHA})"
echo "git_ref=${SDK_SHA}" >> "$GITHUB_OUTPUT"
# ── Wait for Docker workflow (pull_request trigger only) ────────────
# When triggered by pull_request, the Docker image may still be
# building. Poll the Docker workflow until it completes for this SHA.
@@ -256,9 +280,14 @@ jobs:
- name: Install openhands-sdk (for mock LLM server)
env:
AGENT_SERVER_VERSION: ${{ steps.defaults.outputs.agent_server_version }}
SDK_GIT_REF: ${{ steps.linked_sdk.outputs.git_ref }}
run: |
uv venv .mock-llm-venv
uv pip install -p .mock-llm-venv "openhands-sdk==$AGENT_SERVER_VERSION"
if [ -n "$SDK_GIT_REF" ]; then
uv pip install -p .mock-llm-venv "git+https://github.com/OpenHands/software-agent-sdk@${SDK_GIT_REF}#subdirectory=openhands-sdk"
else
uv pip install -p .mock-llm-venv "openhands-sdk==$AGENT_SERVER_VERSION"
fi
- name: Verify mock LLM server starts
run: |
@@ -292,6 +321,7 @@ jobs:
MOCK_LLM_PYTHON: .mock-llm-venv/bin/python3
MOCK_LLM_DOCKER_IMAGE: ${{ steps.image.outputs.tag }}
MOCK_LLM_DOCKER_GLOBAL_TIMEOUT_MS: 1200000
OH_AGENT_SERVER_GIT_REF: ${{ steps.linked_sdk.outputs.git_ref }}
run: |
set +e
MARKER_DIR=".mock-llm-markers"
+1 -1
View File
@@ -108,7 +108,7 @@ jobs:
- name: Install openhands-sdk (for mock LLM server)
env:
AGENT_SERVER_VERSION: ${{ steps.defaults.outputs.agent_server_version }}
# Pin agent-client-protocol to the range openhands-sdk 1.31.1 is
# Pin agent-client-protocol to the range openhands-sdk 1.32.0 is
# compatible with. acp 0.11.0 reordered the ACP prompt() args and
# breaks the SDK's ACP client; the mock ACP server runs from this
# venv, so keep it on the same acp version as the agent-server.