feat(runner,manifests): add gRPC transport, credential system, SSE enhancements, and Kustomize overlays from alpha#1421
feat(runner,manifests): add gRPC transport, credential system, SSE enhancements, and Kustomize overlays from alpha#1421markturansky wants to merge 12 commits intomainfrom
Conversation
…hancements, and Kustomize overlays from alpha PR 6 of alpha-to-main migration (combined with PR 7 — manifests). Runners: - gRPC transport for session message streaming - gRPC client for control-plane token endpoint - Inbox and session messages APIs with delta buffer - Credential system: fetch/populate/clear, gh CLI wrapper - SSE flush-per-chunk, unbounded tap queue - CP OIDC token for backend credential fetches (RSA keypair auth) - New deps: cryptography, grpcio, protobuf - Tests: grpc_client, grpc_transport, grpc_writer, events_endpoint, app_initial_prompt, expanded bridge_claude and shared_session_credentials Manifests: - mpp-openshift overlay: NetworkPolicy, gRPC Route, CP token Service, RBAC, MCP sidecar, RoleBinding namespace fixes - production overlay updates - openshift-dev overlay - Removed deprecated cluster-reader overlay - All overlays pass kustomize build Migration plan updated: PRs 1-5 marked merged, PR 6+7 combined. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
TestGhWrapper._cleanup() used stale top-level imports of _GH_WRAPPER_PATH
(always ""), causing Path(".").unlink() → IsADirectoryError. Now reads from
the module object with empty-string guards. Also fixes e2e workflow Docker
build context from components/runners to components/runners/ambient-runner
so pyproject.toml is found during image build.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
clear_runtime_credentials was deleting the Google Workspace credentials file between turns, causing workspace-mcp to fall back to an inaccessible localhost OAuth flow. The file is now intentionally preserved. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Tests were refactored to remove CREDENTIAL_IDS but _fetch_credential
still requires it to look up the credential_id and build the API URL.
Without it, the function returns {} immediately without hitting the
test HTTP server. Also restores credential_id-based response matching
in the lifecycle test.
713 passed, 11 skipped locally.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
…hot tests The session-list screenshot test failed because setTheme clicked the toggle button before it was visible in the DOM. Add explicit visibility wait with 10s timeout to setTheme, matching the pattern already used in the waitForThemeToggle setup step. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…requests
The websocket package's agui_proxy.go used plain http.Transport / ad-hoc
http.Client instances that bypassed the runnerTransport session-token layer.
Every runner call from the websocket handlers (connectToRunner, interrupt,
feedback, capabilities, mcp-status, task stop/output/list, between-run
listener) lacked the X-Ambient-Session-Token header, causing HTTP 401s
from runners with AGUI_TOKEN middleware enabled.
- Export NewRunnerTransport from handlers package
- Wrap runnerHTTPClient with handlers.NewRunnerTransport
- Add runnerShortClient (10s) and runnerMediumClient (30s) with token transport
- Replace all 7 ad-hoc http.Client{} calls with the named clients
- Add TDD tests: transport type assertion, end-to-end token injection,
missing-secret graceful degradation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
|
| File | Component | Mode |
|---|---|---|
components/runners/ambient-runner/.mcp.json |
runner | warn |
components/runners/ambient-runner/architecture.md |
runner | warn |
components/runners/ambient-runner/pyproject.toml |
runner | warn |
No action required — these components are in warn mode. Consider using the component's agent workflow for future changes.
📖 Specs: Runner Spec · Runner Constitution
📝 WalkthroughWalkthroughRefactored HTTP client construction across session and WebSocket handlers to centralize transport initialization and ensure consistent per-request session-token header injection to runner pods via a new exported Changes
🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
components/backend/websocket/agui_proxy_test.go (1)
52-54: Avoid mutating package globals without test isolation.These cases overwrite
handlers.K8sClientMwandrunnerHTTPClient, both of which are package-level singletons. That makes the new assertions vulnerable to cross-test interference if anything in this package runs concurrently. A shared test mutex or injectable client dependency would keep them deterministic.Also applies to: 65-72, 88-90, 101-108
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/backend/websocket/agui_proxy_test.go` around lines 52 - 54, The tests mutate package globals handlers.K8sClientMw and runnerHTTPClient which can cause cross-test interference; instead, protect those mutations with a shared test mutex or make the clients injectable. Concretely, add a package-level sync.Mutex (e.g., testMu) and acquire it before replacing handlers.K8sClientMw or runnerHTTPClient and release it after restoring the original (use t.Cleanup to restore oldClient/oldRunner), or refactor the code under test to accept a client argument so tests can pass fakeClient without touching package globals; apply this change for the spots touching handlers.K8sClientMw and runnerHTTPClient (including the occurrences around fakeClient and oldClient).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@components/backend/websocket/agui_proxy_test.go`:
- Around line 52-54: The tests mutate package globals handlers.K8sClientMw and
runnerHTTPClient which can cause cross-test interference; instead, protect those
mutations with a shared test mutex or make the clients injectable. Concretely,
add a package-level sync.Mutex (e.g., testMu) and acquire it before replacing
handlers.K8sClientMw or runnerHTTPClient and release it after restoring the
original (use t.Cleanup to restore oldClient/oldRunner), or refactor the code
under test to accept a client argument so tests can pass fakeClient without
touching package globals; apply this change for the spots touching
handlers.K8sClientMw and runnerHTTPClient (including the occurrences around
fakeClient and oldClient).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 923020e3-88fe-474c-b723-097ae4f1ad1e
📒 Files selected for processing (3)
components/backend/handlers/sessions.gocomponents/backend/websocket/agui_proxy.gocomponents/backend/websocket/agui_proxy_test.go
Summary
Alpha migration PR 6/7 — Runner infrastructure and deployment manifests.
X-Ambient-Session-TokenviaNewRunnerTransport, fixing HTTP 401 errors from runners with AGUI_TOKEN middleware enabled (was using plainhttp.Transport)Auth token fix details
The websocket package's
agui_proxy.goused plainhttp.Transport/ ad-hochttp.Clientinstances that bypassed therunnerTransportsession-token layer. Every runner call from the websocket handlers (connectToRunner, interrupt, feedback, capabilities, mcp-status, task stop/output/list, between-run listener) lacked theX-Ambient-Session-Tokenheader, causing HTTP 401s.Fix:
NewRunnerTransportfrom handlers packagerunnerHTTPClientwithhandlers.NewRunnerTransportrunnerShortClient(10s) andrunnerMediumClient(30s) with token transporthttp.Client{}calls with the named clientsTDD tests added:
Test plan
go test ./websocket/ -v— all tests pass including 3 new session token testsgo vet ./...— clean🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Refactor
Tests