Skip to content

canary: migrate the banana bot to mcp 2.x; e2e: keep failure evidence - #362

Merged
aojea merged 4 commits into
google:mainfrom
aojea:fix-cop-canary-and-e2e-diagnostics
Sep 7, 2026
Merged

canary: migrate the banana bot to mcp 2.x; e2e: keep failure evidence#362
aojea merged 4 commits into
google:mainfrom
aojea:fix-cop-canary-and-e2e-diagnostics

Conversation

@aojea

@aojea aojea commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Two independent CI/deploy fixes:

Deploy failure (run 34087805318): the cop canary installs an unpinned mcp and the 2.0 release renamed streamablehttp_client -> streamable_http_client (headers now ride an injected http_client), so the pod crash-looped on ImportError and the bananas rollout timed out. The banana bot snippet was the only place left on the 1.x API after the repo-wide migration. Migrated it the same way as sam-mcp-python's client and pinned the canary install to mcp>=2,<3.

e2e flake diagnosability (run 34085662241): the a2a label-gate test flaked with a bare 403 and no node logs. The harness dumps container logs to tests/e2e/logs/ for failed tests, but CI uploaded only ./_artifacts, which bats never populates. Now the dump directory is uploaded, and the test prints node-1's [A2A] gate verdicts inline on failure — the gate fail-closes transient biscuit-fetch errors into the same 403 as a policy denial, and next time we'll see which one it was. Deliberately no retry until the root cause is known.

The cop canary installs an unpinned 'mcp'; the 2.0 release renamed
streamablehttp_client to streamable_http_client and moved headers into
an injected http_client, so the pod crash-looped on ImportError and the
bananas deploy failed. Migrate the snippet the same way as
sam-mcp-python's client and pin the canary install to the 2.x major.
The harness already dumps container logs to tests/e2e/logs/ for tests
that did not complete, but CI only uploaded ./_artifacts, which bats
never populates - so the a2a label-gate flake left nothing to diagnose.
Upload the dump directory, and print node-1's [A2A] gate verdicts inline
when the labelled send fails, since that gate fail-closes transient
handshake errors into the same 403 as a policy denial.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request pins the mcp dependency version in the Kubernetes template, fixes an import name and client initialization in banana_bot_playground.py (introducing an explicit httpx.AsyncClient), and adds diagnostic logging to the end-to-end mesh tests on failure. Feedback was provided to wrap the connection logic in a try...except block to prevent httpx.AsyncClient resource leaks if the connection process fails.

Comment thread site/content/docs/snippets/banana_bot_playground.py Outdated
Review catch: connect() failures inside __aenter__'s 12-attempt retry
loop orphaned that attempt's httpx.AsyncClient and half-entered streams,
since the next attempt overwrites the attributes close() reaches. GC
cannot help - aclose() is async and a finalizer cannot await it, and the
pool's reference cycles defer even fd closure to an arbitrary cyclic-GC
pass. Same try/except-close pattern as sam_mcp's client.
…shakes

The uploaded verdict names the flake: 'labels unverifiable: failed to
open auth stream: ... context deadline exceeded' - the biscuit-fetch
stream open timing out under -j10 runner load, not a policy denial.
Verdicts are stable, the transport is not, and the gate caches only
positive verdicts, so a bounded retry re-fetches honestly. Each failed
attempt still prints node-1's [A2A] verdicts; the mismatched-label 403
assertion stays unretried.
@aojea
aojea merged commit 614c8dd into google:main Sep 7, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant