Repository navigation
fix(connectors): pass the GitHub token under the name the server reads - #4359
Conversation
Catalog MCP servers launched at whatever npm served that day, so an upstream tool rename broke users' connectors with no GAIA change; they now launch at tested, exact versions and a unit test rejects any unpinned or @latest spec. - Tavily, GitHub, and Memory are pinned to their current releases; each was launched and its tool list checked. - The Git connector pointed at an npm package that was never published, so it could not start at all. It now runs the reference server from PyPI via uvx. - The Tavily docs named tools that no longer exist (tavily-search); they are tavily_search / tavily_extract in the pinned release. - docs/reference/dependency-management.mdx gains the manual refresh steps, since Dependabot can't read pins held in Python string literals. Fixes amd#4351
…t reads The GitHub connector saved the user's token as GITHUB_TOKEN, but @modelcontextprotocol/[email protected] only reads GITHUB_PERSONAL_ACCESS_TOKEN, so every call went out anonymous: private repos were invisible and users hit the unauthenticated rate limit. - The catalog entry now stores and launches with GITHUB_PERSONAL_ACCESS_TOKEN; the connectors-demo agent reads the same key. - configure and disconnect also clear keyring slots the saved entry still references under a renamed env var, so reconnecting or disconnecting an old install leaves no orphaned token behind. - Docs and examples that launched server-github with GITHUB_TOKEN now use the variable it reads, and the GitHub connector page tells existing users to reconnect. Fixes amd#4357
|
Verdict: Approve with suggestions The core fix is right, and I confirmed it against the real package: the GitHub MCP server only reads One thing worth a second look before merge: this PR quietly brings the Git connector back from the dead. It was pointing at an npm package that has never existed, so it could never start; it now launches the real Python server — which can commit, stage, reset, and switch branches in the user's repository, not just read it. The catalog blurb and the connectors index still read like a read-only tool and group it with "no setup needed", so someone enabling it for an agent won't expect writes. Please make the write capability explicit in both places. Second, nothing here shows the two surfaces this actually changes working. The Git connector swapped its launcher from Real-world evidenceNo Every pin matches the current upstream release and every renamed tool name in the docs matches the shipped package. 🔍 Technical details🟡 Important1.
2. No real-world evidence for either changed surface (rubric §Real-world evidence — flagged once, not per-file) The CLI surface changed ( echo '{"mcpServers": {"check": {"command": "uvx", "args": ["mcp-server-git==2026.8.18"]}}}' > /tmp/pin-check.json
gaia mcp tools check --config /tmp/pin-check.jsonPasting that output would confirm both the 🟢 Minor3. Pin guard only sees one catalog module (
…then parametrize over 4. New test file re-implements fixtures the package conftest already provides (
5. Adjacent Acknowledged in the PR body as out of scope, but it's one line below a line this PR fixes, and leaving it means the block still teaches a non-existent id: 6. GitHub connector page doesn't mention the package is deprecated ( The page links Strengths
|
…3707) Typing during an answer was starved and Enter mid-turn could not actually send, so a correction to a five-minute task ("actually, only the unread ones") arrived after the work it was meant to redirect. The composer now stays responsive while text streams, and Enter hands the message to the turn *already running* — the agent folds it in at its next step boundary and answers it alongside what it was doing. Nothing is interrupted and no second turn starts. Three independent causes, all fixed here: - **Typing was starved, not blocked.** Every streamed token rebuilt the whole transcript, and Bubble Tea runs `Update` on one goroutine — so that work and your keystrokes shared a queue. Tokens now coalesce onto the repaint tick that already runs ten times a second. - **Enter only parked the message locally** until the turn ended. It now POSTs to the running turn via a new route (contract **2.15**), which the daemon relays as-is. - **A one-step turn accepted the message and threw it away.** The queue was drained only at the top of each agent-loop iteration, so a turn that formed its answer in a single step — the commonest shape — had nothing left to pick up what you typed during it. The route had already returned `delivered: true` and the transcript already showed it. The loop now looks again once the answer is formed and takes one more step when something arrived. Delivery is never assumed: the transcript line appears only once the sidecar has the message, a refusal says why and puts the text back, and a peer below 2.15 keeps today's queue and is named along with the command to update it. Two notes for the reviewer: - The text is **labelled as arriving mid-task** before it reaches the model. Unlabelled, a user message landing in the middle of a tool sequence is indistinguishable from a new request and the model abandons the work already done. - Type-ahead beside the **tool-permission modal** was considered and deliberately left out. Its answers are the single letters `y`/`n`/`a`, so letting prose through would let "check the c**a**lendar too" approve a destructive tool call. Doing it safely needs a focus model on a documented security control — its own PR. ## Test plan - [x] `cd tui && go vet ./... && go test ./... -race -count=1` — passes, including the `tui/test` integration package - [x] `pytest tests/unit/agents/ hub/agents/gaia/python/tests/ -q` — 1887 passed, 53 skipped - [x] `python util/lint.py --black --isort` - [x] Live against a real model (Gemma-4-E4B on a Strix Halo GPU, sidecar built from this branch): `POST /v1/gaia/query/{run_id}/followup` mid-stream returns `200 {"delivered":true}`, the stream shows `Picked up your follow-up: …`, the turn takes a second step, and the answer obeys the correction. Same run on the pre-fix commit never picks it up and ignores the correction — see the evidence comment below. - [x] Live: a follow-up for a run that is not in flight is a loud `404` naming what to do instead, not a quiet accept - [ ] Live in the TUI: type through the streaming answer (keystrokes keep up), press Enter, and confirm the row reads `⏎ sends to the running turn` — the route path above is verified end-to-end; the keystroke path is still covered only by `tui/internal/ui/chat` tests - [ ] Live against a pre-2.15 sidecar: Enter still queues, and the notice names the version floor and `gaia hub uninstall/install gaia` > `Unit Tests (Windows smoke)` is red here and on unrelated open PRs (amd#4359, amd#4353) — a pre-existing `main` failure in a Windows symlink test, not this branch. --------- Co-authored-by: Kalin Ovtcharov <[email protected]> Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Ovtcharov <[email protected]> Co-authored-by: Tomasz Iniewicz <[email protected]>
# Conflicts: # src/gaia/connectors/catalog/mcp_servers.py
|
Unblocked: #4356 merged, so I merged The review's main ask, making the Git connector's write capability explicit, is no longer this PR's to answer: the I did not add the end-to-end evidence (the PAT round-trip and the 🔍 Technical detailsThe conflict was one hunk in Tests: CI: the red Windows smoke check is Not addressed, all 🟢: the |
## Summary Connectors you already set up now pick up catalog fixes (a new version pin, command or env var name) the next time GAIA loads them, without reconnecting. GitHub connections saved before amd#4359 work again: their saved token is passed under the name the server reads. ## Why `~/.gaia/mcp_servers.json` kept the command, version pin and env names from when the user connected, so catalog fixes like amd#4356's pins never reached existing users until they ran `gaia connectors configure` again. After amd#4359 renamed the GitHub token variable, older GitHub connections send it as `GITHUB_TOKEN`, which the server ignores, so every call goes out anonymous. The connector's **Test** also reported the token as missing. ## Linked issue Closes amd#4358 ## Changes - Each catalog connector's `command`, `args` and `env` are rebuilt from the current catalog when the global `mcp_servers.json` loads. The user's own fields (`disabled`, `timeout`) are kept. Hand-added servers and a project-local `mcp_servers.json` are used as written. - A renamed env key (exactly one key gone and one new) reads the secret from the slot it was saved under. The connector's **Test** and `get_credential` find it there too, so the user isn't asked to reconfigure. - Updated the GitHub connector troubleshooting note and the pin-bump note in the dependency docs, which both said existing users had to reconfigure. <details> <summary>🔍 Technical details</summary> - Nothing is written back at load time, so `configure` / `disconnect` / `set_enabled` stay the only writers of the file (`test_no_dual_writer`). Since the daemon, Agent UI and CLI all read the file, loading also never races to write it. - The new env name points at the old keyring slot instead of copying the secret. The next `configure` or `disconnect` already deletes the old slot (amd#4359). - With more than one changed key it doesn't guess. It points at the new slots, and the existing "reconfigure" error appears. - Refs are only followed inside the connector's own `gaia.connections:<id>:` namespace. - `get_credential` and `test` read `mcp_servers.json` only when the new slot is empty, so a normal lookup (including Tavily web search) doesn't change. - Skipped when `keyring` isn't installed (base install). `configure` can't run without it, so no entry in the file came from the catalog. - Not covered: the C++ client (`cpp/src/mcp_registry.cpp`) reads the file on its own. It already refuses connector entries with `$keyring` env (amd#2819), so it only matters there for the no-secret connectors (memory, git). </details> ## Test plan - [x] `python -m pytest tests/unit/connectors/test_catalog_rederive.py -q`: 11 passed. The old-pin and renamed-token tests fail without the `config.py` change, and the **Test** / `get_credential` tests fail without the handler change. - [x] `python -m pytest tests/unit/mcp tests/unit/connectors tests/unit/test_mcp_and_agents_follow_gaia_home.py tests/unit/test_gaia_mcp_stub.py tests/unit/test_amd_gaia_urls.py -q`: 1585 passed, 15 skipped - [x] black, isort, flake8, pylint and bandit (repo settings from `util/lint.py`) on the changed files, `util/check_added_lines.py`, `util/check_test_lane_coverage.py`, and `util/check_module_skips.py --workflow test_unit.yml --job unit-tests`: all pass. I didn't finish a full `util/lint.py --all` or `pytest tests/unit/` run on Windows. Both are left to CI. ## Evidence - [ ] **Agent exposed in the Agent UI**: N/A, no UI change. - [x] **MCP tools / servers**: a saved `mcp-memory` entry pinned to a version that doesn't exist, with the user's `"timeout": 60`, then `gaia mcp tools mcp-memory`: ``` # main 📡 Connecting to MCP server 'mcp-memory'... ❌ MCP server 'mcp-memory' not found # this branch 📡 Connecting to MCP server 'mcp-memory'... 🔧 Tools from 'mcp-memory' (9): 🔹 create_entities 🔹 create_relations 🔹 add_observations ... ``` The file on disk is byte-for-byte unchanged after the run. - [x] **CLI**: a GitHub connection saved before amd#4359 (`GITHUB_TOKEN` env, token in the old keyring slot), then `gaia connectors test mcp-github`: ``` # main mcp-github: FAIL missing keyring entries: ['GITHUB_PERSONAL_ACCESS_TOKEN'] # this branch mcp-github: OK keyring_entries_present ``` - [ ] **HTTP API / REST**: N/A, no route changed. The connector Test route calls the same handler method as the CLI above. ## Checklist - [x] I have linked a GitHub issue above (`Closes #N` / `Fixes #N` / `Refs #N`). - [x] I have described **why** this change is being made, not just what changed. - [x] I have run linting and tests locally (`python util/lint.py --all`, `pytest tests/unit/`). The lint tools ran on the changed files and the tests on `tests/unit/mcp` and `tests/unit/connectors`; see the Test plan. - [x] I have attached **real-world evidence matched to the surface I changed** (see Evidence above), or marked each surface N/A. - [x] I have updated documentation if user-visible behavior changed (see [CONTRIBUTING.md](../CONTRIBUTING.md)). --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
Stacked on #4356 — merge that first.
Connecting GitHub did nothing: GAIA passed the token as
GITHUB_TOKEN, but the GitHub MCP server only readsGITHUB_PERSONAL_ACCESS_TOKEN, so every call went out anonymous. Private repos were invisible and users hit the unauthenticated rate limit. After this change, a newly connected GitHub account authenticates, and disconnecting or reconnecting an old connection also removes the token it stored under the old name.~/.gaia/mcp_servers.jsonentry still namesGITHUB_TOKEN, so they stay unauthenticated until the user reconnects GitHub. The GitHub connector page now tells them to.@modelcontextprotocol/server-githubis deprecated upstream, and 2025.4.8 is its final release. Moving to GitHub's maintained server (github/github-mcp-server) needs its own PR.🔍 Technical details
npm pack @modelcontextprotocol/[email protected]→dist/common/utils.jsreads onlyprocess.env.GITHUB_PERSONAL_ACCESS_TOKEN.connectors/providers/has only Google and Microsoft), so there is no shared token storage to reconcile. The config key, keyring username (mcp-github:<key>),$keyringref, and launch env var are all the same string, so renaming the catalog key moves all four together.configure/disconnectnow also delete keyring slots that the saved entry's$keyringrefs point to within the connector's owngaia.connections:<id>:namespace. Without this, the rename would orphan the oldmcp-github:GITHUB_TOKENsecret. Refs outside that namespace are never touched.env["GITHUB_TOKEN"]fromget_credential("mcp-github"), so it would have broken. It's updated, and a test now ties it to the catalog key.server-githubwithGITHUB_TOKENwere fixed the same way. The CLI and SDK connector docs also used connector idgithub, which doesn't exist; they now usemcp-github. The adjacentconfigure braveexample names a connector that isn't in the catalog either. That one is left for a separate fix.Test plan
python -m pytest tests/unit/connectors/test_github_mcp_env.py -q: the two launch-env tests fail on the base branch and pass after the fix. The legacy-slot disconnect test fails with the key renamed but without the cleanup.python -m pytest tests/unit/connectors/ tests/mcp/ tests/unit/chat/ui/test_chat_helpers.py tests/unit/test_amd_gaia_urls.py -q: 998 passed, 17 skippedPYTHONPATH=hub/agents/connectors-demo/python python -m pytest hub/agents/connectors-demo/python/tests -q: the new catalog-key test fails with the old key and passes with the new one. 3TestRegistrytests fail locally only because the package isn't pip-installed (entry-point discovery); CI installs it.gaia connectors configure mcp-github --set GITHUB_PERSONAL_ACCESS_TOKEN=<pat>, then list a private repo through the GitHub MCP toolsFixes #4357