Skip to content

chore(rivetkit): log inspector errors + standardize pino errorKey error#4986

Merged
abcxff merged 1 commit into
mainfrom
05-06-fix_log_error_on_failed_inspector_requests
May 13, 2026
Merged

chore(rivetkit): log inspector errors + standardize pino errorKey error#4986
abcxff merged 1 commit into
mainfrom
05-06-fix_log_error_on_failed_inspector_requests

Conversation

@abcxff
Copy link
Copy Markdown
Contributor

@abcxff abcxff commented May 6, 2026

Adds error logs to inpector requests + standardizes error errorKey for pino (was being used but not configured in base logger)

@railway-app
Copy link
Copy Markdown

railway-app Bot commented May 6, 2026

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

Service Status Web Updated (UTC)
frontend-inspector ❌ Build Failed (View Logs) Web May 13, 2026 at 6:38 pm
kitchen-sink ❌ Build Failed (View Logs) Web May 13, 2026 at 6:38 pm
frontend-cloud 🕒 Building (View Logs) Web May 13, 2026 at 6:37 pm
website 😴 Sleeping (View Logs) Web May 7, 2026 at 5:48 am
ladle ❌ Build Failed (View Logs) Web May 6, 2026 at 7:42 pm
mcp-hub ✅ Success (View Logs) Web May 6, 2026 at 7:41 pm

@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 6, 2026 19:40 Destroyed
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 6, 2026

Code Review: chore(rivetkit): log inspector errors + standardize pino errorKey error

Overview

This PR does two related things:

  1. Adds errorKey: "error" to pino logger configs so the error field is properly serialized as a structured error object.
  2. Renames catch variable errerror and log field key err:error: throughout several files for consistency with the now-configured errorKey.

The motivation is sound — without errorKey: "error" configured, passing an Error object to the error field would not get pino's special serialization treatment (stack trace, type, etc.), making structured error logging inconsistent.


Issues

Bug: Variable shadowing in inline-websocket-adapter.ts

The inner catch (error) shadows the outer error parameter in #handleError. The semantics are actually correct (inner logs the handler error, outer fires to both sides), but this will likely trigger a lint warning. Should rename the inner catch variable to handlerError or similar.

Incomplete rename in registry/index.ts

One catch block was only half-updated — the variable remains err but the log field was changed to error: err. All other sites in this PR rename the variable too. Looks like an oversight.

Log message capitalization in native.ts

Two of the three new log messages use sentence-case, violating the CLAUDE.md rule that log messages should be lowercase:

  • "Error handling inspector action request" should be "error handling inspector action request"
  • "Error handling inspector request" should be "error handling inspector request"

The third new message ("error replaying workflow history") is correctly lowercase.

Inconsistent approach in actor-driver.ts

Only the log field key is renamed (err:error:) but the catch variable names remain err. This creates within-file inconsistency where the catch variable and the field name differ. The rest of the PR renames both together.


Minor Notes

  • Redundant fields in inline-websocket-adapter.ts: With errorKey: "error" now configured, pino will auto-serialize .message and .stack from the Error object. The explicit errorMessage and stack fields alongside error are now redundant (not wrong, just noisy).

  • Pino call style: registry/index.ts mixes logger().warn({ error }, "message") and logger().warn({ msg: "...", error }). The codebase convention appears to prefer the { msg: "...", error } style.

  • Deprecated runner files: Changes to engine/sdks/typescript/runner/src/mod.ts and rivetkit-typescript/packages/engine-runner/src/mod.ts are cosmetic renames only, but CLAUDE.md marks these as deprecated paths. Worth confirming this is intentional.

  • actor-driver.ts stringifyError calls: Most other sites now pass the raw Error object, but actor-driver.ts still stringifies before logging. If stringifyError returns a plain string, pino will not apply error serialization to it. Likely intentional for cleanup paths, but worth double-checking.


Summary

The core change (adding errorKey: "error" + field name standardization) is correct and worthwhile. Main items to address before merging:

  1. Rename inner catch variable in #handleError to avoid shadowing (handlerError)
  2. Complete the variable rename in the registry/index.ts mode-B shutdown catch block
  3. Lowercase the two new log messages in native.ts

@abcxff abcxff force-pushed the 05-06-fix_log_error_on_failed_inspector_requests branch from 1b843f0 to b150344 Compare May 6, 2026 20:28
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 6, 2026 20:28 Destroyed
@abcxff abcxff changed the base branch from 05-06-_slop_fix_rivetkit_surface_raw_error_messages_instead_of_generic to graphite-base/4986 May 6, 2026 22:03
@abcxff abcxff force-pushed the graphite-base/4986 branch from e506879 to abb6ff1 Compare May 6, 2026 22:03
@abcxff abcxff force-pushed the 05-06-fix_log_error_on_failed_inspector_requests branch from b150344 to fc4756e Compare May 6, 2026 22:03
@abcxff abcxff changed the base branch from graphite-base/4986 to 05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxy May 6, 2026 22:03
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 6, 2026 22:03 Destroyed
@abcxff abcxff changed the base branch from 05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxy to graphite-base/4986 May 7, 2026 01:26
@abcxff abcxff force-pushed the graphite-base/4986 branch from abb6ff1 to c58ef25 Compare May 7, 2026 20:16
@abcxff abcxff force-pushed the 05-06-fix_log_error_on_failed_inspector_requests branch from fc4756e to 5ec0839 Compare May 7, 2026 20:16
@abcxff abcxff changed the base branch from graphite-base/4986 to 05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxy May 7, 2026 20:16
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 7, 2026 20:19 Destroyed
@abcxff abcxff changed the title fix: log error on failed inspector requests chore(rivetkit): log inspector errors + standardize pino errorKey error May 7, 2026
@abcxff abcxff marked this pull request as ready for review May 7, 2026 20:21
@abcxff abcxff requested a review from NathanFlurry May 7, 2026 20:23
@abcxff abcxff force-pushed the 05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxy branch from c58ef25 to b999f59 Compare May 11, 2026 03:41
@abcxff abcxff force-pushed the 05-06-fix_log_error_on_failed_inspector_requests branch from 5ec0839 to 4ff7adb Compare May 11, 2026 03:41
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 11, 2026 03:42 Destroyed
Copy link
Copy Markdown
Contributor Author

abcxff commented May 13, 2026

Merge activity

  • May 13, 6:35 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 13, 6:38 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 13, 6:39 PM UTC: @abcxff merged this pull request with Graphite.

@abcxff abcxff changed the base branch from 05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxy to graphite-base/4986 May 13, 2026 18:36
@abcxff abcxff changed the base branch from graphite-base/4986 to main May 13, 2026 18:36
@abcxff abcxff force-pushed the 05-06-fix_log_error_on_failed_inspector_requests branch from 4ff7adb to 4400c90 Compare May 13, 2026 18:37
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-4986 May 13, 2026 18:37 Destroyed
@abcxff abcxff merged commit 321ad1d into main May 13, 2026
11 of 18 checks passed
@abcxff abcxff deleted the 05-06-fix_log_error_on_failed_inspector_requests branch May 13, 2026 18:39
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