Repository navigation
feat(acp): backend deployment, ACP WebSocket, T5/T6 test tiers - #1498
Conversation
|
/run-e2e-openshell |
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
pdettori
left a comment
There was a problem hiding this comment.
Review Summary
Solid PoC implementation of ACP WebSocket with proper feature-flag gating, correct commit conventions, and clean CI refactor. Two concurrency/resource-management issues need fixing before merge.
Areas reviewed: Python (ACP endpoint, bridge service, tests), Shell (deploy script), CI/GitHub Actions, Docs
Commits: 4, all signed-off ✓
CI: Core checks pass. OpenShell PoC CI fails as expected (new test tiers need backend deployed).
Assisted-By: Claude Code
| try: | ||
| while True: | ||
| raw = await websocket.receive_text() | ||
|
|
There was a problem hiding this comment.
must-fix: No WebSocket disconnect handler — when a client drops the connection, sessions stored in _bridge._sessions are never cleaned up, causing unbounded memory growth.
This while True loop needs a try/finally (or try/except WebSocketDisconnect) that calls a cleanup method on the bridge to remove sessions associated with this connection.
| def __init__(self): | ||
| self._sessions: dict[str, ACPSession] = {} | ||
|
|
||
| def server_capabilities(self) -> dict: |
There was a problem hiding this comment.
must-fix: _sessions dict on the module-level singleton has no async lock. Concurrent WebSocket connections mutating self._sessions will race.
Fix: add an asyncio.Lock and acquire it around _sessions mutations, or use a connection-scoped session store instead of a shared dict.
| @@ -0,0 +1,156 @@ | |||
| """ | |||
There was a problem hiding this comment.
suggestion: The WebSocket endpoint at /ws/{namespace}/{agent_name} performs no authorization check — any client can connect to any namespace/agent. Even as a PoC, a TODO comment noting the need for namespace-level authz would help track the gap.
| try: | ||
| async with httpx.AsyncClient(timeout=120.0) as client: | ||
| async with client.stream( | ||
| "POST", |
There was a problem hiding this comment.
suggestion: The httpx timeout is hardcoded to 120s. Long-running agent operations may exceed this. Consider making it configurable via settings or at least extracting to a module-level constant.
| # Enable backend API tests if kagenti-backend is deployed and healthy | ||
| if kubectl get deploy kagenti-backend -n team1 &>/dev/null; then | ||
| READY=$(kubectl get deploy kagenti-backend -n team1 -o jsonpath='{.status.readyReplicas}' 2>/dev/null || echo "0") | ||
| if [ "${READY:-0}" -ge 1 ]; then |
There was a problem hiding this comment.
suggestion: kubectl get deploy checks existence but not actual readiness. A deployment can exist with 0 ready replicas. Consider kubectl wait --for=condition=Available --timeout=60s before setting OPENSHELL_BACKEND_AVAILABLE=true.
| context_id = event.get("result", {}).get("contextId", "") | ||
| if context_id and not session.context_id: | ||
| session.context_id = context_id | ||
|
|
There was a problem hiding this comment.
nit: Session context_id is stored in-memory only — lost on pod restart. Since PostgreSQL is deployed alongside for sessions, consider persisting it there in a follow-up to enable true multi-turn continuity across restarts.
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
1 similar comment
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
1 similar comment
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
|
/run-e2e-openshell |
1 similar comment
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
Prompt step was using a label selector that doesn't match (controller doesn't propagate CR labels to pods). Switch to name-based grep with 30s retry loop. Send all log messages to stderr so stdout is clean for machine-readable output. Fix prompt assertion to check full output. Signed-off-by: Ladislav Smola <[email protected]>
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
833d705 to
db003c8
Compare
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
… gRPC Replace kubectl exec shortcut with proper OpenShell gateway integration. The ACP bridge now calls ExecSandbox gRPC via mTLS instead of exec-ing directly into pods, providing session management, credential injection, and audit logging through the gateway. - Vendor minimal ExecSandbox proto from kagenti/openshell - Add grpcio dependency to backend - New OpenShellGatewayClient with TLS credential caching - Replace _prompt_sandbox kubectl exec with ExecSandbox streaming - 9 unit tests for TLS loading, caching, streaming, error handling Signed-off-by: Ladislav Smola <[email protected]>
|
/run-e2e-openshell |
Generated gRPC stubs use PascalCase method names (ExecSandbox) which violate N802. Exclude *_pb2*.py from both root and backend ruff config. Signed-off-by: Ladislav Smola <[email protected]>
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
Add teleport usage documentation at docs/agentic-runtime/teleport.md covering prerequisites, quick start, step-by-step usage, and test matrix. Expand T7 tests from 4 to 10: - test_teleport__full_mode (--full flag lifecycle) - test_teleport__skills_packaged (TELEPORT_SKILLS env var) - test_teleport__no_action (error: no action) - test_teleport__deploy_without_session (error: missing --session) - test_teleport__prompt_without_session (error: missing --session) - test_teleport__cleanup_without_session (error: missing --session) Add missing permissions to settings.json for teleport and git operations. Signed-off-by: Ladislav Smola <[email protected]>
Add --spawn flag for bare sandbox creation without local context, enabling remote session delegation without teleporting local files. Add credential isolation test verifying sandbox only sees LiteLLM virtual key, never real MaaS/Vertex API keys. Update teleport doc with spawn examples and credential isolation architecture diagram. 12 T7 tests pass (was 10): - test_teleport__spawn_creates_sandbox - test_teleport__spawn_credential_isolation Signed-off-by: Ladislav Smola <[email protected]>
Signed-off-by: Ladislav Smola <[email protected]>
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
Fix discrepancies between docs and script: - SKILL.md: destination path $HOME not /workspace (fixed in c39fe50) - SKILL.md: size limit 800KB not 900KB (fixed in 75a1472) - SKILL.md: add --spawn mode, TELEPORT_SKILLS, credential isolation - teleport.md: add Actions table listing all 6 flags including --spawn Signed-off-by: Ladislav Smola <[email protected]>
…te diagrams Convert stateDiagram-v2 to flowchart (mermaid state diagrams don't render visible arrowheads on GitHub). Style all nodes with explicit fill colors to prevent white-on-white invisibility. Simplify overloaded diagrams. Signed-off-by: Ladislav Smola <[email protected]>
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
pdettori
left a comment
There was a problem hiding this comment.
All review feedback from the initial round has been addressed — both must-fix items (WebSocket disconnect cleanup, async lock on _sessions) are resolved, along with the suggestions (auth check, timeout constant, deployment readiness). The only remaining item is the nit about PostgreSQL persistence for context_id, which is a reasonable follow-up.
CI note: The Kind resource exhaustion failure (Helm timeout on openshell-team2) is partially related to the expanded workload footprint. The HyperShift and flaky LLM test failures are unrelated infrastructure/test issues.
|
/run-e2e-openshell |
❌ [Experimental] OpenShell E2E Tests FailedCommit: Non-voting. Re-run: |
Add 3 T6 tests for sandbox agents via ACP WebSocket: - test_T6_sandbox__initialize: ACP handshake works for sandbox agent name - test_T6_sandbox__session_lifecycle: create/close session - test_T6_sandbox__prompt_response: send prompt, get response via ExecSandbox Initialize and session tests pass. Prompt test requires backend with ExecSandbox gRPC client (PR rossoctl#1689 — currently uses kubectl exec fallback on deployed backend from merged PR rossoctl#1498). Signed-off-by: Ladislav Smola <[email protected]>
Add 3 T6 tests for sandbox agents via ACP WebSocket: - test_T6_sandbox__initialize: ACP handshake works for sandbox agent name - test_T6_sandbox__session_lifecycle: create/close session - test_T6_sandbox__prompt_response: send prompt, get response via ExecSandbox Initialize and session tests pass. Prompt test requires backend with ExecSandbox gRPC client (PR rossoctl#1689 — currently uses kubectl exec fallback on deployed backend from merged PR rossoctl#1498). Signed-off-by: Ladislav Smola <[email protected]>
Add 3 T6 tests for sandbox agents via ACP WebSocket: - test_T6_sandbox__initialize: ACP handshake works for sandbox agent name - test_T6_sandbox__session_lifecycle: create/close session - test_T6_sandbox__prompt_response: send prompt, get response via ExecSandbox Initialize and session tests pass. Prompt test requires backend with ExecSandbox gRPC client (PR rossoctl#1689 — currently uses kubectl exec fallback on deployed backend from merged PR rossoctl#1498). Signed-off-by: Ladislav Smola <[email protected]>
Summary
/api/v1/acp/ws/{namespace}/{agent_name}with JSON-RPC 2.0 protocol bridging to A2A agents, gated behindKAGENTI_FEATURE_FLAG_ACPe2e-openshell-pending.yamlworkflow, resolving 4 TokenPermissions alerts from PR fix(openshell): ADK policy port 4000, Claude flake guard, workflow paths #1489ACP Protocol Methods
initializeauthenticatesession/newsession/promptsession/closesession/listsession/resumesession/request_permissionDAM Integration
The ACP endpoint is designed to be compatible with DAM (formerly Humr, now at dam-agents/dam) which uses ACP as its sole agent protocol via WebSocket. Detailed integration plan will follow in the design doc update.
Test plan
uv run pytest test_T5_1_backend_api.py --collect-onlyshows ~15 test itemsuv run pytest test_T6_1_acp_protocol.py --collect-onlyshows ~15 test itemsOPENSHELL_BACKEND_AVAILABLE=trueAssisted-By: Claude Code