Agent-Controller WebSocket Communication#475
Open
Zakaria-Kofiro wants to merge 6 commits intomasterfrom
Open
Conversation
added 3 commits
April 20, 2026 14:38
…5.4) see .claude/CLAUDE.md for full implementation plan and context
… session security - add CDI producer to bridge Spring WS handler bean into JobManager injection - enforce fallback=false: skip HTTP when WS enabled but no session exists - bind session identity: one instanceId per WS session, reject rebind - require hello before accepting any other frame type - unknown commands now ack as failed, not ok - single-flight reconnect guard prevents parallel reconnect threads - bound appliedCommandIds set to prevent unbounded memory growth - remove wildcard origins, use setAllowedOriginPatterns - add tests: frame-before-hello, identity rebind, same-identity re-hello
- fallback=false now enforced when wsSender is null or instanceId unmatched - both sendCommand() and startTest() guard all wsEnabled branches - agentLastSeen cleaned up in afterConnectionClosed and handleTransportError
added 3 commits
April 22, 2026 15:32
ContextLoader.getCurrentWebApplicationContext() returns null in Spring Boot WAR deployment. Use static holder set at Spring bean init time instead.
TankConfig() may throw during Spring context init if settings XML is not yet loadable. Fall back to default path to prevent @EnableWebSocket from silently failing to register the WS handler.
Controller dials out to agents on :8090, establishes persistent WS, sends commands over WS. Eliminates need for agent→controller inbound SG rules on controller NLB. Agent-side: - AgentCommandWebSocketServer: WS server on :8090, sends hello on connect, handles commands via CommandListener.applyCommand() - APITestHarness: PoC mode bypasses /v2/agent/ready and status PUTs - APIMonitor: suppresses HTTP status reporting in PoC mode - CommandListener: extracted applyCommand() shared by HTTP and WS - AgentStartup: skips settings/support-files download in PoC mode Controller-side: - ControllerInitiatedAgentWsClient: outbound WS client with hello wait, ack tracking, session management - JobRequest: after EC2 launch, connects WS to agent, registers via jobManager.registerAgentForJob() on hello receipt - JobManager: routes commands via controller-initiated WS when enabled - AmazonInstance: propagates PoC flags via EC2 user data Config: - controller-initiated-ws-enabled (default false) - controller-initiated-ws-disable-agent-http (default true) - controller-initiated-ws-script-path (default script.xml) Host selection: EAST uses private IP, WEST uses public IP/DNS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…5.4)
see .claude/CLAUDE.md for full implementation plan and context
title: -
Please make sure these check boxes are checked before submitting
mvn clean test -P default** PR review process **