fix(server): bound thread activity hydration #6153
Mergedt3-code-bot[bot](GitHub profile, opens in a new tab)merged 2 commits into
main fromrefs/pull/6153/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
- apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts line 1298OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1234,0 +1278,21 @@1278+ CROSS JOIN projection_thread_activities AS activity1279+ WHERE activity.thread_id = pending.thread_id1280+ AND activity.kind = 'approval.requested'1281+ AND json_extract(activity.payload_json, '$.requestId') = pending.request_id1282+ ),1283+ pending_user_input_thread AS (1284+ SELECT thread_id1285+ FROM projection_threads1286+ WHERE thread_id = ${threadId}1287+ AND pending_user_input_count > 01288+ ),1289+ user_input_lifecycle AS (1290+ SELECT1291+ activity.activity_id,1292+ activity.kind,1293+ ROW_NUMBER() OVER (1294+ PARTITION BY json_extract(activity.payload_json, '$.requestId')1295+ ORDER BY1296+ activity.created_at DESC,1297+ CASE WHEN activity.kind = 'user-input.requested' THEN 0 ELSE 1 END DESC,1298+ activity.activity_id DESC
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this71c6f82
juliusmarminge closed this
Sign in to join this conversation.


Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
f5fce74· PR result:d866815· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.