Skip to content

fix: add max param to prune signals cmd#4190

Open
MasterPtato wants to merge 1 commit into02-11-fix_reduce_metrics_aggregator_cardinalityfrom
02-12-fix_add_max_param_to_prune_signals_cmd
Open

fix: add max param to prune signals cmd#4190
MasterPtato wants to merge 1 commit into02-11-fix_reduce_metrics_aggregator_cardinalityfrom
02-12-fix_add_max_param_to_prune_signals_cmd

Conversation

@MasterPtato
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link

railway-app bot commented Feb 12, 2026

🚅 Deployed to the rivet-pr-4190 environment in rivet-frontend

Service Status Web Updated (UTC)
ladle ❌ Build Failed (View Logs) Web Feb 18, 2026 at 2:30 am
website 😴 Sleeping (View Logs) Web Feb 14, 2026 at 7:41 pm
frontend-cloud ❌ Build Failed (View Logs) Web Feb 12, 2026 at 10:22 pm
frontend-inspector ❌ Build Failed (View Logs) Web Feb 12, 2026 at 10:22 pm
mcp-hub ✅ Success (View Logs) Web Feb 12, 2026 at 10:21 pm

Copy link
Contributor Author

MasterPtato commented Feb 12, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Feb 12, 2026

PR Review: fix: add max param to prune signals cmd

Summary

This PR makes three improvements:

  1. Changes parallelization parameter type from u128 to u16 across workflow/signal prune commands.
  2. Adds a --max-per-txn / -m CLI flag to the signal prune command to cap how many signals are deleted per transaction.
  3. Fixes a Grafana dashboard query from rivet_gasoline_workflow_total to rivet_gasoline_workflow_sleeping.

Issues Found

max_per_txn caps per-transaction, not total — behavior should be documented

max_per_txn caps how many signals are collected per transaction batch, not in total across all transactions. The outer loop in prune_signals_inner continues to the next transaction after each cap is hit, so a user passing --max-per-txn 100 will prune 100 signals per transaction but potentially unbounded totals across all transactions. If this is intentional (to reduce individual transaction size without limiting overall pruning), the --help text and naming should make this clear. If the intent is to limit total pruning, the implementation needs to propagate a remaining budget across transactions.

Missing --help text for the new flag

The --max-per-txn flag has no #[clap(help = "...")] annotation. Without documentation in the CLI help output, users cannot easily understand the semantics of this parameter. Please add a help string.

Type inconsistency: max_per_txn uses usize

max_per_txn: Option<usize> is platform-dependent (32-bit vs 64-bit). For a CLI parameter representing a count, consider using Option<u32> or Option<u64> for consistency with the u16 used for parallelization.

parallelization < 1024 validation is now implicit

The ensure!(parallelization < 1024) validation still works correctly with u16 (since u16::MAX is 65535), but the upper bound is no longer communicated by the type. A comment explaining the 1024 cap would help future maintainers.


Positive Changes

Type improvement: Changing parallelization from u128 to u16 is correct — these are worker-count parameters, not hash-space identifiers. The internal casts to u128 for arithmetic are preserved appropriately.

Loop refactor: Converting while let Some(entry) = stream.try_next().await? to loop { let Some(entry) = ... else { break }; ... } is idiomatic Rust and cleanly enables the early return path for max_per_txn.

Grafana fix: The rename from rivet_gasoline_workflow_total to rivet_gasoline_workflow_sleeping fixes a stale metric reference. Worth confirming rivet_gasoline_workflow_sleeping is defined elsewhere in the codebase.


Minor Suggestions

  • The PR description template was not filled in. Please document what was tested and the expected behavior of --max-per-txn.
  • Consider adding a comment in prune_signals_inner explaining that max_per_txn limits collection per-transaction and that the outer loop handles pagination.

Overall this is a reasonable, focused change. The main thing to clarify before merging is the intended semantics of max_per_txn (per-transaction vs. total) and adding help text to document it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4190

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4190

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4190

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4190

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4190

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4190

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4190

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4190

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4190

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4190

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4190

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4190

commit: 9f9271d

@graphite-app graphite-app bot force-pushed the 02-11-fix_reduce_metrics_aggregator_cardinality branch 2 times, most recently from 4bf0ef8 to 81cc8b3 Compare February 18, 2026 02:28
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

Comments