Skip to content

fix: drop idle sessions and other smaller updates - #32

Merged
rdlauer merged 6 commits into
mainfrom
rob-idle-sessions
Oct 5, 2026
Merged

rdlauer merged 6 commits into
mainfrom
rob-idle-sessions

Conversation

@rdlauer

@rdlauer rdlauer commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

A follow up from the last PR, these are some more minor issues that Claude identified. The only notable one is the idle session issue, which in theory could cause $ problems. Tested locally (re-connects with Claude Code are the main issue, and that worked). Reviewed by Codex too.

From Claude:

  • Fix: race in session tracking. Parallel tool calls in one session raced on the session's request counters (found with Go's race detector). Those reads now take the lock.
  • Expire idle MCP sessions after 24 hours. Abandoned sessions previously stayed in memory until the next deploy. The app's own session tracking now uses the same timeout instead of 1 hour.
  • Log rejected requests. Any 4xx or 5xx response on /expert/ is now logged, including the SDK's own 415, 403 and 404 rejections, which were previously invisible.
  • Route MCP SDK warnings and errors through zerolog. SDK output was previously discarded. Its Info-level lifecycle lines stay filtered out.
  • Replace deprecated Session.Log calls with server-side logging. MCP's logging feature is deprecated (SEP-2577). Ragpi errors now reach the server logs, and parameters that only fed those calls are gone.
  • Drop the unused sessionManager variable. The NewSessionManager() call stays, because tool handlers depend on it.
  • No client-facing changes. Responses match v1.1.0 exactly in side-by-side testing.

rdlauer and others added 6 commits October 5, 2026 13:39
MCP's logging feature is deprecated (SEP-2577). Ragpi status and errors now
go to zerolog instead of only to clients that requested log messages, and
parameters that only fed those calls are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parallel tool calls in one session raced on RequestCount and RequestLog
(reported by the race detector).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the NewSessionManager call; it sets the global used by TrackSession and
starts its cleanup loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds an slog-to-zerolog adapter. SDK output was previously discarded; Info
lifecycle lines stay filtered out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Makes rejections inside the SDK (415 Content-Type, 403 Host, 404 session)
visible in server logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Abandoned sessions previously stayed in memory until the next deploy. The
app's own session tracking now uses the same timeout instead of 1 hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rdlauer
rdlauer requested a review from Bucknalla October 5, 2026 18:47
@rdlauer
rdlauer merged commit 28ccd49 into main Oct 5, 2026
2 checks passed
@rdlauer
rdlauer deleted the rob-idle-sessions branch October 5, 2026 19:23
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.

2 participants