FEA-1554: Close session data collection gaps across all 5 harness parsers - #271
Conversation
…sers - Extend NormalizedSession with messages, tokenSeries, diffStats, slashCommands, artifacts fields; extend NormalizedToolUse with output, isError, mcpServer, mcpMethod, skillName, diffDelta - Add shared parser helpers: truncateText, computeLineDelta, extractRepoFromCwd, extractPrReferences, extractIssueReferences, collectArtifacts, isSyntheticModelKey - Claude parser: capture message text, per-turn tokens, tool output, diff stats, slash commands (<command-name> tags), skill names (Skill tool input.skill) - Codex parser: capture message text (remove void), reasoning, token series, tool output, MCP server/method (preserve from mcp_tool_call_begin), diff stats - Cursor parser: capture message text, token series, tool output, per-message model - Copilot parser: capture message text (both chat+CLI), token series, tool output - OpenCode parser: extend SELECT for per-message tokens/model/patch/summary columns - import-session: persist UserMessage/AssistantMessage events, enrich PostToolUse event data with output/MCP/skill/diff, extend buildMetadata with new fields - Cloud sync: add text/output/reasoning to STRIPPED_LEAF_KEYS - Wire computeTokenCost into dashboard getTokenAnalytics for per-model cost - Add event-role.ts (event_type -> human/agent/system mapping) - Add session-timing.ts (active agent vs waiting-on-user derivation) Testing: 70 new unit tests (parser-utils: 49, event-role: 14, session-timing: 7, cloud sync strip: 4). Full suite: 2,263 tests, 0 failures. Risks: Cloud-sync strip must not miss content keys; verified by round-trip test.
Compatibility Smoke Test Results
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72d023000c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…Codex patch file headers
thadeusb
left a comment
There was a problem hiding this comment.
Solid extraction work across all 5 parsers and the cloud strip additions are correct. Three things inline, none blocking.
…metadata refresh, isSynthetic, parser fixes
Feature
FEA-1554 — Session Data Collection Gaps for Desktop Session Screens
Parent: PRD-444 (Session Data Collection for Desktop Agent/Session Screens)
Summary
NormalizedSession+NormalizedToolUsetypes with 11 new fields for messages, token series, diff stats, slash commands, artifacts, tool output, MCP server/method, skill namestoken-cost.tsinto dashboard analyticsevent-role.ts(event type → human/agent/system) andsession-timing.ts(active/waiting derivation)STRIPPED_LEAF_KEYSwithtext,output,reasoningfor mandatory content strippingArchitecture
flowchart TD Sources[5 Harness Sources] --> Parsers[5 Updated Parsers] Parsers --> NS[NormalizedSession + NormalizedToolUse<br/>types.ts — 11 new fields] PU[parser-utils.ts<br/>7 new helpers] -.-> Parsers NS --> IS[import-session.ts<br/>UserMessage/AssistantMessage events<br/>enriched PostToolUse data] IS --> DB[(SQLite: metadata JSON + events.data)] DB --> SYNC[STRIPPED_LEAF_KEYS<br/>+text +output +reasoning] DB --> COST[dashboard.ts cost wiring] DB --> ROLE[event-role.ts + session-timing.ts]Plan
PLN-816 — Plan challenge: Opus PASS, Sonnet PASS, Codex PASS
Key Decisions
UserMessage/AssistantMessageevents (not metadata JSON) — too large for blob, need idempotency[absent])[absent])Decision Table
Verified at
.closedloop-ai/decision-tables/fea-1554.md— 63 delta checklist items covered.Review Summary
4 parallel review lanes (correctness, security, conventions, codex): all PASS, 0 blockers, 0 findings requiring fixes.
Downstream Updates
None — FEA-1554 is the only child of PRD-444. Sibling features (FEA-1503, FEA-1497) are DONE.
Feature Flags
None — collection-layer improvement, not a net-new user capability. Existing FEA-1407 sandbox gate controls capture.
Database/Migration Safety
No schema/migration changes. All new data stored in existing
metadataJSON andevents.dataJSON columns.Test Plan