Repository navigation
ref(chat): Drop dead turn-session model metadata - #1328
sentry-junior[bot] wants to merge 7 commits into
Conversation
Model, reasoning, and loaded skills were never restored from storage after the Redis ops-bag cutover, so stop threading them through session writes. Keep SQL channel/metrics writes as the durable runtime path and remove the stale TODO(#1267) dual-write framing. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
upsertAgentTurnSessionRecord no longer accepts model metadata, so the behavior harness resume fixtures must stop passing it. Refs #1267
Fire-and-forget running summaries can finish after a later terminal write and resurrect an unfinished recovery view. When collapsing the append-only index, keep terminal entries over lagging non-terminal ones. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
Resume discovery treats the newest recovery summary as stranded when it is still `running`. A fire-and-forget start write can land after a timeout/yield boundary and hide that pause, so collapse by lifecycle rank: running < awaiting_resume < terminal. Refs #1267
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ff1cf3b. Configure here.
Pure lifecycle rank let a stale awaiting_resume summary hide a live post-resume running upsert, blocking stranded mid-resume recovery. Collapse by version first; use rank only to break same-version races from fire-and-forget start writes. Refs #1267
Keep one same-version rank tiebreak and one higher-version win. Drop the extra terminal/pause matrix that reasserted the same collapse rule. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
The recovery-index collapse changes exposed separate continuation behavior and made this metadata-removal PR own unrelated lifecycle policy. Restore the existing newest-summary rule and remove its added component coverage. Refs #1267
Design review (post-#1344)Do not merge this branch. It is stale against main ( Ownership design (still correct)
This matches Why dropping the three fields is still rightOn current main,
So threading them through resume/checkpoint/ Design pushback (do not redo as a pure mechanical delete)
Redo targetClose or supersede this PR. Re-implement on |
|
Superseding: this branch is stale against main after #1344 moved |
Supersedes #1328 after #1344 moved `turn-session*` → turn-cursor / checkpoint. Stop threading `modelId` / skills / `reasoningLevel` through turn-cursor writes. Those fields were never restored from storage, so the write path was pretending they were checkpoint metadata. **Ownership (unchanged)** - checkpoint = resume boundary only (status, history boundary, slice) - profile + reasoning = turn route / history replacement - concrete model id = resolve at execution from profile config - skills = derive from history + catalog - channel + duration/usage = SQL conversation row **What changed** - Drop the three dead fields from `TurnRecord`, `upsertTurnRecord`, and checkpoint write args - Rename `runtimeMetadata` → `runtimeMetrics` for SQL-backed channel/metrics only - Remove the dead resume `existingSessionRecord.reasoningLevel` fallback - Explicit post-handoff contract: profile config, else inherited old route - No recovery-index policy changes Checked: `tsc --noEmit` (@sentry/junior + @sentry/junior-evals); focused vitest checkpoint + agent-resume + paused-turn **45/45**. Refs #1267 <!-- junior-request-attribution:start --> Requested by **U039RR91S**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AG6MCDB51U%3A1786211808.864869 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AG6MCDB51U%3A1786211808.864869) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AG6MCDB51U%3A1786211808.864869/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>

Stop threading model/skills/reasoning through turn-session writes. After the Redis ops-bag cutover those fields were never restored from storage, so the write path was pretending they were session metadata.
Honest write path
runtimeMetadatais nowruntimeMetricsand only carries SQL-backed channel name plus execution duration/usage. Resume still rebuilds those from the conversation row. Model, reasoning, and loaded skills stay on live turn route/diagnostics.Dead resume plumbing removed
Dropped the stale
existingSessionRecord.reasoningLevelfallback, the skill-name sync callback used only to feed session writes, and unused recovery projection/model lookups on stranded-session repark paths.Checked:
tsc --noEmit; focused vitest for turn-session-record + agent-resume (36/36).Refs #1267
Requested by David Cramer.
--
View Junior Session [Sentry]