Commit c37821d
fix(sandbox): KISS lifecycle claim — combiner under lib/sessions, IfMatch via updateSession
Two review fixes:
1) Move `claimSessionLifecycleRunId.ts` from `lib/supabase/sessions/`
to `lib/sessions/`. The combiner doesn't directly query Supabase —
it composes two underlying helpers, so per api convention it
belongs alongside other domain composers, not under the Supabase
namespace.
2) KISS: delete `claimSessionLifecycleRunIdIfMatch.ts` and use the
existing `updateSession` helper for the lease-refresh path. The
refresh writes the same `lifecycle_run_id` value back, so an
unconditional `updateSession({ lifecycle_run_id: runId })` does the
work — accepts a small race where a concurrent stale-reclaim could
be overwritten, but the kick path (which DOES use the atomic
`claimSessionLifecycleRunIdIfNull`) remains the primary
concurrency guard.
Two callers (runKick, computeLifecycleWakeDecision) updated to import
from the new path. No behavior change at the workflow level.
Tests: 2579 / 2579 still pass. lint + tsc clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 22095c2 commit c37821d
5 files changed
Lines changed: 34 additions & 56 deletions
File tree
- app/workflows
- lib
- sandbox
- sessions
- supabase/sessions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
This file was deleted.
Lines changed: 0 additions & 31 deletions
This file was deleted.
0 commit comments