Skip to content

Preserve conversation history with activity summaries#363

Merged
marccampbell merged 4 commits into
mainfrom
fix-history-activity-summaries
Jun 6, 2026
Merged

Preserve conversation history with activity summaries#363
marccampbell merged 4 commits into
mainfrom
fix-history-activity-summaries

Conversation

@marccampbell

Copy link
Copy Markdown
Contributor

Summary

  • add a timeline endpoint that pages conversation messages while representing activity runs as summary items
  • add an activity detail endpoint for lazy expansion of summarized tool calls
  • move dashboard/full history loading to timeline units so activity rows do not crowd out user/claw messages
  • add tests covering activity-heavy history and activity expansion

Closes #362

Tests

  • env GOCACHE=/private/tmp/elasticclaw-go-build go test ./...
  • npm run build (from web/)

@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Cover activity-heavy timeline state" | Re-trigger Greptile

Comment thread web/components/conversation-view.tsx
Comment thread pkg/hub/server.go
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (1)

  1. web/hooks/use-windowed-messages.ts, line 54-56 (link)

    P1 Pagination cursor points to summary timestamp instead of first conversation message

    When the oldest item in the timeline is a leading activity_summary (activities that predate the first conversation message), msgs[0].timestamp is the synthetic summary timestamp — MAX(activity.created_at) — which is earlier than the first real conversation message. When the user triggers "load older", before = that_timestamp is sent to the server, which finds zero conversation messages before it and falls into the len(rows) == 0 path. That path returns a new summary counting activities with created_at < max_activity, i.e., all but the last activity in the range. The client then prepends this near-duplicate summary (with count - 1), leaving the user with two conflicting leading summaries and hasOlder immediately set back to false.

    A related issue on the same block: setHasOlder(apiMsgs.length >= PAGE_SIZE) counts interleaved activity_summary items toward the threshold, so conversations with enough summaries trigger hasOlder = true even when all conversation messages fit on a single page — directly enabling the incorrect cursor scenario above. The correct signal is whether the number of conversation messages returned equaled the requested limit.

Reviews (2): Last reviewed commit: "Address activity summary review feedback" | Re-trigger Greptile

@marccampbell

Copy link
Copy Markdown
Contributor Author

Addressed the Greptile activity-summary feedback in 0ef616c:

  • timeline now prepends a summary for activity before the first conversation message when that first message is the oldest conversation row
  • activity expansion supports order=desc, and oversized summaries fetch/display the latest 500 activities
  • UI now labels partial expansions as "Showing latest 500 of N tool calls"
  • added regression tests for pre-conversation activity summaries and newest-first activity expansion

Tests:

  • env GOCACHE=/private/tmp/elasticclaw-go-build go test ./...
  • npm run build (from web/)

@marccampbell

Copy link
Copy Markdown
Contributor Author

Addressed the pagination cursor review in 1cc7bca:

  • scrollback now uses the oldest real conversation message as the before cursor, not a leading activity summary timestamp
  • hasOlder is based on returned conversation-message count, not total timeline unit count
  • a leading activity summary is treated as the start-of-history marker, avoiding duplicate near-identical summaries

Tests:

  • env GOCACHE=/private/tmp/elasticclaw-go-build go test ./...
  • npm run build (from web/)

@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "Fix timeline pagination cursor" | Re-trigger Greptile

@marccampbell marccampbell merged commit 658e1b9 into main Jun 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve conversation history when activity rows dominate message timeline

1 participant