Skip to content

fix(logs): stop loading execution data and snapshots that reads do not use - #9349

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/log-read-paths
Oct 23, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/log-read-paths

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Status polls no longer select execution_data on every poll: a CASE returns it only for the statuses the poll reads it for (failed for the error; completed when output is requested; always for selected outputs). The rule is one shared function, so the SQL and the in-memory check cannot drift
  • The execution snapshot view no longer loads execution_data while resolving its context. It is read after authorization, so a refused caller never fetches the payload; parent and child snapshots share one chunked reader
  • The paused execution list projects execution_snapshot->'triggerIds' instead of loading whole rows with the serialized executor snapshot (only triggerIds was used)
  • One shared terminal-status predicate replaces the copies in the HITL manager and run-file reads
  • These read paths stay on the primary: a finished run's row can still change (a forced failure, a later cost write), so a replica read would not be self-checking

Type of Change

  • Bug fix

Testing

  • New execution-read-payloads.integration.ts (real Postgres, records every value the client receives): status polls for a running run with output and a completed run without output, the paused list, and a refused snapshot caller all fetch no execution payload (4 cases fail on the pre-fix code); completed-with-output and failed polls still fetch it
  • Unit: lib/logs, lib/workflows/executor, app/api/v1/logs (51 files, 672 tests)
  • check:test-patterns, check:utils, check:comment-hygiene, check:unused-exports, check:file-names, check:explicit-any, check:source-conventions; generators in sync. Type-check and full audits run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…t use

- Status polls select execution_data through a CASE only for the statuses the poll
  reads it for (failed; completed when output is requested; always for selected
  outputs), from one shared status rule.
- The execution snapshot view no longer loads execution_data while resolving its
  context; it is read only after authorization, so a refused caller never fetches it.
- The paused execution list projects execution_snapshot->'triggerIds' instead of
  loading whole rows with the serialized executor snapshot.
- One shared terminal-status predicate replaces the copies in the HITL manager and
  run-file reads.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 23, 2026 9:28pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/logs/application/read-execution-snapshot.ts
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

This PR avoids fetching large execution payloads when readers do not use them.

  • Status polls fetch execution data only when the response needs it.
  • Execution snapshots load run data inside the authorized read.
  • Paused-run summaries fetch trigger IDs without loading the full snapshot.
  • Resume checks and run-file reads share one terminal-status rule.

No new actionable issues were found. No previous review threads were supplied. Tests were inspected but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resolve execution context without payload] --> B{Caller authorized?}
  B -->|No| C[Return not found]
  B -->|Yes| D{Job execution?}
  D -->|Yes| E[Return job metadata]
  D -->|No| F[Read workflow state]
  F --> G[Read execution data, timing, and cost together]
  G --> H[Read child snapshots]
  H --> I[Return snapshot and metadata]
Loading

Reviews (2) · Last reviewed commit: "fix(logs): read a snapshot view's execut..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 60f7996 into staging Oct 23, 2026
67 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/log-read-paths branch October 23, 2026 21:40

This branch was previously deployed

1 inactive deployment
Preview — 944f24d0 Deployed Oct 23, 2026 by vercel[bot]
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.

1 participant