fix(usage): roll up session lineage history#76116
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Source inspection gives a high-confidence reproduction for the main gap: trigger a normal Next step before merge Security Review findings
Review detailsBest possible solution: Land a lineage fix that records family metadata on every logical session rotation path, preserves instance-mode compatibility, and keeps the new UI controls backed by green protocol, Gateway, and Control UI validation. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence reproduction for the main gap: trigger a normal Is this the best way to solve the issue? No. The direction is maintainable, but this patch is incomplete until the primary session reset path records lineage and the UI compatibility retry accounts for the new Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 10ebcbdb9986. |
3605585 to
8645787
Compare
Summary
sessionIdduring reset/compaction paths.sessions.usagewithgroupBy,includeHistorical, and presetrangesupport, and aggregate known family session ids from transcript-backed usage instead of relying only on the currentsessions.jsonmapping.Current instancevsHistorical lineage, plus90d,1y, andAllrange shortcuts and detail text for included lineage instances.Issue Review
Reviewed #50701. This was not already resolved on current
main: archive-aware transcript usage scanning exists, butsessions.usagestill returned current-instance rows and the Control UI had no lineage scope selector.Duplicate Search
gitcrawl threads/neighbors/searchfound adjacent session-history and restart-recovery issues, but no confirmed duplicate with the same usage-history lineage surface and fix direction.prtagsduplicate write was made because the duplicate evidence did not meet the confirmed-duplicate bar.Bug/Security Review
groupBy: "family"orincludeHistorical: trueis requested.Validation
pnpm test src/gateway/server-methods/usage.sessions-usage.test.ts ui/src/ui/controllers/usage.node.test.ts ui/src/ui/views/usage-render-details.test.ts ui/src/ui/views/usage-metrics.test.tspnpm exec oxfmt --check --threads=1 src/config/sessions/types.ts src/shared/usage-types.ts src/gateway/protocol/schema/sessions.ts src/gateway/server-methods/usage.ts src/gateway/server-methods/usage.sessions-usage.test.ts src/auto-reply/reply/agent-runner-session-reset.ts src/auto-reply/reply/session-updates.ts ui/src/ui/controllers/usage.ts ui/src/ui/app-view-state.ts ui/src/ui/app.ts ui/src/ui/views/usageTypes.ts ui/src/ui/app-render-usage-tab.ts ui/src/ui/controllers/usage.node.test.ts ui/src/ui/views/usage.ts ui/src/ui/views/usage-render-details.ts ui/src/i18n/locales/en.ts ui/src/styles/usage.cssgit diff --checkpnpm check:changelog-attributionstbx_01kqmj7a0717287m4a1j7j10z2:OPENCLAW_TESTBOX=1 pnpm check:changedCloses #50701.