@devries-cameron20 / t3code Mirror · read-only / commits / 89ac1b8ed1
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

feat(server): pairing-link sessions renew with the device's DPoP key (#37980) (#38739)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 18, 2026 at 12:44 UTC 89ac1b8ed1acedf7036701a19241f2aaa0b19a23
4 files changed +46 -4
infra/relay/migrations/postgres/20261118203809_relay_write_churn/migration.sql new
+6
@@ -0,0 +1,6 @@
1 +-- Pruning never used this index (last scan 2026-10-16), but every DPoP proof insert maintained it.
2 +DROP INDEX IF EXISTS "idx_relay_dpop_proofs_expires_at";--> statement-breakpoint
3 +-- Each attempt is inserted, then completed moments later. Page headroom lets the completion,
4 +-- which only touches unindexed columns, stay a HOT update instead of writing all three indexes.
5 +-- Applies to pages written from now on, which is the whole table within the 1-day retention.
6 +ALTER TABLE "relay_delivery_attempts" SET (fillfactor = 80);
infra/relay/migrations/postgres/20261118203809_relay_write_churn/snapshot.json new
+36
@@ -0,0 +1,36 @@
1 +{
2 + "type": "diff",
3 + "version": "9",
4 + "dialect": "postgres",
5 + "id": "4a3b409a-6315-41e4-bd97-a2659709bf35",
6 + "prevIds": ["4413755a-63f1-4f93-bdc9-d1357283c23e"],
7 + "footprints": [
8 + {
9 + "statementType": "drop_index",
10 + "statementTarget": [
11 + "index",
12 + "public",
13 + "relay_dpop_proofs",
14 + "idx_relay_dpop_proofs_expires_at"
15 + ],
16 + "writes": [
17 + "s|idx|public.idx_relay_dpop_proofs_expires_at",
18 + "n|idx|public.idx_relay_dpop_proofs_expires_at",
19 + "e|idx|public.idx_relay_dpop_proofs_expires_at",
20 + "n|rel|public.idx_relay_dpop_proofs_expires_at"
21 + ],
22 + "reads": [
23 + "e|tbl|public.relay_dpop_proofs",
24 + "n|sch|public",
25 + "e|col|public.relay_dpop_proofs.expires_at"
26 + ],
27 + "sharedWrites": []
28 + }
29 + ],
30 + "deltas": [
31 + {
32 + "op": "drop",
33 + "key": "indexes\u0000[\"public\",\"idx_relay_dpop_proofs_expires_at\"]"
34 + }
35 + ]
36 +}
infra/relay/src/agentActivity/DeliveryAttempts.ts
+2 -3
@@ -62,7 +62,7 @@ export class DeliveryAttempts extends Context.Service<
62 readonly completeSourceJob: (
63 input: DeliveryAttemptCompletionInput,
64 ) => Effect.Effect<void, DeliveryAttemptRecordPersistenceError>;
65 - /** Delete attempts untouched for the retention period; returns how many were removed. */
65 + /** Delete attempts claimed before the retention period; returns how many were removed. */
66 readonly pruneExpired: Effect.Effect<number, DeliveryAttemptRecordPersistenceError>;
67 }
68 >()("t3code-relay/agentActivity/DeliveryAttempts") {}
@@ -195,11 +195,10 @@ const make = Effect.gen(function* () {
195 }),
196 completeSourceJob: Effect.fn("relay.delivery_attempts.complete_source_job")(function* (input) {
197 yield* Effect.annotateCurrentSpan({ "relay.delivery.job_id": input.sourceJobId });
198 - const completedAt = DateTime.formatIso(yield* DateTime.now);
198 + // Only unindexed columns change, so with the table's fillfactor headroom this stays a HOT update.
199 yield* db
200 .update(relayDeliveryAttempts)
201 .set({
202 - createdAt: completedAt,
202 apnsStatus: input.apnsStatus ?? null,
203 apnsReason: input.apnsReason ?? null,
204 apnsId: input.apnsId ?? null,
infra/relay/src/persistence/schema.ts
+2 -1
@@ -195,7 +195,8 @@ export const relayDpopProofs = pgTable(
195 createdAt: varchar("created_at", { length: 64 }).notNull(),
196 },
197 (table) => [
198 + // No index on expires_at: pruning a few minutes of proofs is cheaper as a scan than
199 + // maintaining a second index on every request's insert.
200 primaryKey({ columns: [table.thumbprint, table.jti] }),
199 - index("idx_relay_dpop_proofs_expires_at").on(table.expiresAt),
201 ],
202 );