Skip to content

fix(tasks): speed up resumed task log loading - #73092

Merged
tatoalo merged 3 commits into
masterfrom
posthog-code/faster-task-session-logs
Jul 23, 2026
Merged

fix(tasks): speed up resumed task log loading#73092
tatoalo merged 3 commits into
masterfrom
posthog-code/faster-task-session-logs

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Opening a task with a long resume chain repeatedly reads the full history for each small response page. This keeps the task view loading much longer as its history grows.

Changes

  • Read resume-chain log objects through a process-wide bounded executor while preserving chronological order.
  • Read single-run logs directly without executor overhead.
  • Increase the bounded session-log response page size to reduce repeated full-history scans.

Benchmark

Local benchmark using a representative multi-run JSONL fixture. The storage benchmark injects 25 ms of latency per object read to compare sequential and bounded-parallel behavior.

Path Before After Speedup
Session-log parsing and pagination 7.99 s 1.17 s 6.8×
Resume-chain storage reads 0.184 s 0.040 s 4.6×
Modeled combined backend path 14.06 s 1.33 s 10.6×

Generated-By: PostHog Code
Task-Id: a9c061a3-575e-42c6-815e-c0b6edd4b846
@tatoalo tatoalo self-assigned this Jul 23, 2026
@trunk-io

trunk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

😎 Merged manually by @tatoalo - details.

Generated-By: PostHog Code
Task-Id: a9c061a3-575e-42c6-815e-c0b6edd4b846
@PostHog PostHog deleted a comment from github-actions Bot Jul 23, 2026
@tatoalo tatoalo added the stamphog Request AI approval (no full review) label Jul 23, 2026
@tatoalo
tatoalo marked this pull request as ready for review July 23, 2026 09:33
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 23, 2026 09:33
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(tasks): bound concurrent log reads" | Re-trigger Greptile

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small, contained perf fix within the author's own owning area (bounded thread-pool for parallel log reads, larger page size); no risky territory touched and author has strong familiarity with this code.

  • Author wrote 100% of the modified lines and has 31 merged PRs in these paths (familiarity STRONG).
  • 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 17L, 2F substantive — within ceiling
tier T1-agent / T1a-trivial (17L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ a679e1b · reviewed head 959e582

@tatoalo
tatoalo enabled auto-merge (squash) July 23, 2026 09:54
@tatoalo
tatoalo merged commit b2103fb into master Jul 23, 2026
234 checks passed
@tatoalo
tatoalo deleted the posthog-code/faster-task-session-logs branch July 23, 2026 10:20
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-23 10:44 UTC Run
prod-us ✅ Deployed 2026-07-23 10:59 UTC Run
prod-eu ✅ Deployed 2026-07-23 11:03 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant