Skip to content

fix(agent): stop the agent and close redis on shutdown, document the single bean - #19

Merged
rennf93 merged 2 commits into
masterfrom
fix/agent-lifecycle-followups
Oct 13, 2026
Merged

rennf93 merged 2 commits into
masterfrom
fix/agent-lifecycle-followups

Conversation

@rennf93

@rennf93 rennf93 commented Oct 13, 2026

Copy link
Copy Markdown
Member

Follow-ups from the review of #18. GuardMiddleware.shutdown() now runs under the initialization mutex, so it cannot interleave with a first-request initialize(), and is safe to call twice. It also closes the middleware's own redisHandler, and when initialize() never ran it stops the injected agent handler directly, so a GuardAgent created with cfg.redis no longer leaks its persistence connection and daemon thread. The README now states that exactly one AgentHandlerProtocol bean is used (two fail startup unless one is @Primary) and gives the guard-agent-jvm dependency line. I added tests for context close, shutdown without initialize, double shutdown and the redis close.

@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 13, 2026
@github-actions github-actions Bot added the documentation Docs site, README, CHANGELOG, license files label Oct 13, 2026
@rennf93
rennf93 merged commit b04a713 into master Oct 13, 2026
8 checks passed
@rennf93
rennf93 deleted the fix/agent-lifecycle-followups branch October 13, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Docs site, README, CHANGELOG, license files no-issue Chore or dependency PR that does not need an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant