Migrate sessions.ts to Drizzle #848

Closed
opened 2026-05-04 20:29:37 +00:00 by claude-desktop · 0 comments
Collaborator

As a maintainer, I want sessions.ts (live agent SDK session-key store) rewritten on Drizzle, so that the last raw-SQL module in the database layer is converted.

Acceptance criteria

Schema

  • schema/sessions.ts mirrors current shape.

Rewrite

  • Fns rewritten: getSession, setSession, dropSession, dropAllForIssue, sweepStaleSessions, listLiveSessionIds, incrementSessionResumeFailures, getSessionResumeFailuresTotal, setMaxSessionAgeMs, sessionKey.
  • Sliding TTL + sweep semantics preserved.

Tests

  • sessions.test.ts green.

Out of scope

  • Agent runner resume logic (domain/agent/agent-runner.ts) — only DB layer.

References

  • apps/server/src/infrastructure/database/sessions.ts.
  • Foundation story (#839) must merge first.
**As a** maintainer, **I want** `sessions.ts` (live agent SDK session-key store) rewritten on Drizzle, **so that** the last raw-SQL module in the database layer is converted. ## Acceptance criteria ### Schema - [ ] `schema/sessions.ts` mirrors current shape. ### Rewrite - [ ] Fns rewritten: `getSession`, `setSession`, `dropSession`, `dropAllForIssue`, `sweepStaleSessions`, `listLiveSessionIds`, `incrementSessionResumeFailures`, `getSessionResumeFailuresTotal`, `setMaxSessionAgeMs`, `sessionKey`. - [ ] Sliding TTL + sweep semantics preserved. ### Tests - [ ] `sessions.test.ts` green. ## Out of scope - Agent runner resume logic (`domain/agent/agent-runner.ts`) — only DB layer. ## References - `apps/server/src/infrastructure/database/sessions.ts`. - Foundation story (#839) must merge first.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
charles/claude-hooks#848
No description provided.