Skip to content

chore(kitchen-sink): configurable endpoint#4766

Merged
NathanFlurry merged 1 commit intomainfrom
04-24-chore_kitchen-sink_configurable_endpoint
Apr 27, 2026
Merged

chore(kitchen-sink): configurable endpoint#4766
NathanFlurry merged 1 commit intomainfrom
04-24-chore_kitchen-sink_configurable_endpoint

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

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

This was referenced Apr 24, 2026
Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 24, 2026

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

@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

Code Review: chore(kitchen-sink): configurable endpoint

Overview

This PR makes two functional changes to the kitchen-sink example:

  1. Replaces the hardcoded rivetEndpoint logic with a configurable VITE_RIVET_ENDPOINT env var
  2. Adds an onSleep lifecycle hook (with a 1-second delay) to the counter lifecycle actor

The rest of the diff is purely mechanical reformatting (JSX attribute wrapping, arrow function parens, etc.) which looks correct and consistent.


Functional Changes

rivetEndpoint - potential regression for production deployments

Before, the endpoint was automatically resolved for production builds using window.location.origin/api/rivet. Now it always falls back to http://localhost:6420 if VITE_RIVET_ENDPOINT is unset, which would silently break any production deployment that does not explicitly set the env var.

  • No .env.example or README update appears to document the new VITE_RIVET_ENDPOINT variable. This should be added so deployers know to set it.
  • If this example is intended to only be run locally or with an explicit env var, the fallback to localhost is fine but warrants a comment or doc note explaining that.

onSleep lifecycle addition (lifecycle.ts)

The 1-second setTimeout inside onSleep is a nice demonstration of async sleep hooks and the grace period mechanism. A brief inline comment explaining it is a simulated async operation (not an accident) would help readers unfamiliar with the actor lifecycle.

Note: onSleep:end will only be pushed if sleep is not aborted during the grace period. If you want to explicitly demonstrate the abort case, that behavior is implicitly present but not currently surfaced in the UI or README.


Minor Style Notes

The backtick template literal reformatting for the status-dot className produces a slightly odd closing brace indentation. Cosmetic and formatter-driven, the one spot that looks inconsistent with the rest of the file.


Summary

Area Status
Correctness Endpoint fallback silently breaks production if VITE_RIVET_ENDPOINT is unset
Code quality Formatting improvements are clean and consistent
Test coverage N/A (example app)
Documentation New env var should be documented in .env.example or README

The main concern is the missing documentation for VITE_RIVET_ENDPOINT. Everything else looks good.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4766

All packages published as 0.0.0-pr.4766.33e5654 with tag pr-4766.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-33e5654
docker pull rivetdev/engine:full-33e5654
Individual packages
npm install rivetkit@pr-4766
npm install @rivetkit/react@pr-4766
npm install @rivetkit/rivetkit-napi@pr-4766
npm install @rivetkit/workflow-engine@pr-4766

Base automatically changed from sleep-cleanup/17-stop-reason-and-fallthrough-fix to main April 27, 2026 07:13
@NathanFlurry NathanFlurry merged commit db4224a into main Apr 27, 2026
39 of 45 checks passed
@NathanFlurry NathanFlurry deleted the 04-24-chore_kitchen-sink_configurable_endpoint branch April 27, 2026 07:14
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