Skip to content

feat(kitchen-sink): add actor probe controls#4946

Merged
NathanFlurry merged 1 commit intomainfrom
05-04-feat_kitchen_sink_probe_controls
May 5, 2026
Merged

feat(kitchen-sink): add actor probe controls#4946
NathanFlurry merged 1 commit intomainfrom
05-04-feat_kitchen_sink_probe_controls

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 May 4, 2026
Copy link
Copy Markdown
Member Author

NathanFlurry commented May 4, 2026

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

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

Code Review: feat(kitchen-sink): add actor probe controls

Overview

This PR adds actor probe controls to the kitchen-sink example, including:

  • A new HealthPanel component for gateway health checks on individual actors
  • Test HTTP and Test WS buttons (non-bypass variants) in the MockAgenticLoopPanel
  • A Health Check button in MockAgenticLoopPanel for gateway health probes
  • Server-mode auto-detection in server.ts to switch between serverless and direct-start modes

Issues

Commented-out code (server.ts)

The request logging middleware is commented out rather than removed. Either restore it, remove it, or guard it with an env flag.

Mixed state: testHttp / testWebSocket write to lastBypass

Both new functions call setLastBypass(message), so their results are mixed with the bypass test results in the same UI element. They should each have their own state variables (like lastHealth does) or share a clearly named combined state variable.

Significant code duplication

testHttp is a near-copy of testHttpBypass with the sole difference of omitting gateway: { bypassConnectable: true }. Similarly, testWebSocket duplicates testWebSocketBypass. The shared scaffolding (latency timing, error classification, stopping-actor detection, stats update) could be extracted into a small helper to reduce drift risk.

Auth inconsistency in HealthPanel

MockAgenticLoopPanel.checkHealth passes the auth token via x-rivet-token, but HealthPanel.checkHealth issues the same gateway fetch without any auth header. If the gateway requires a token, the HealthPanel ping will silently fail with a 401.

Fragile error string matching in testWebSocket

Matching on human-readable substrings like "actor.stopping" or "Server Error" is fragile. Prefer checking a structured close code or a parsed JSON code field, the same way testHttpBypass already parses the response body.

Double cast as unknown as AgenticHandle

The cast at line ~1492 signals a real type mismatch between what getOrCreate returns and the local AgenticHandle interface. The interface should be made compatible with the actual return type rather than suppressing the error through unknown.

serverlessMode naming

RIVET_RUN_ENGINE === "1" spins up the engine locally, which is semantically the opposite of serverless. The condition logic is correct, but the name is confusing. Something like useHttpHandler or externalEngineMode would be clearer.


Minor observations

  • The Unicode middle-dot loading indicator in HealthPanel works but is harder to read in source than a plain "...".
  • The noteActorStopping signature simplification (building the full message outside and passing it in) is a good cleanup.
  • Adding httpOk / wsOk stats alongside the bypass counters is a useful addition for distinguishing probe paths in the stats panel.

@NathanFlurry NathanFlurry force-pushed the 05-04-feat_kitchen_sink_probe_controls branch from 4d9300e to c0b45b3 Compare May 4, 2026 15:36
Base automatically changed from 05-04-fix_gateway_specific_response_errors to main May 5, 2026 14:58
@NathanFlurry NathanFlurry merged commit c0b45b3 into main May 5, 2026
22 of 24 checks passed
@NathanFlurry NathanFlurry deleted the 05-04-feat_kitchen_sink_probe_controls branch May 5, 2026 14:58
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