Skip to content

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

Open
abcxff wants to merge 1 commit into
05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxyfrom
05-06-fix_log_error_on_failed_inspector_requests
Open

chore(rivetkit): log inspector errors + standardize pino errorKey error#4986
abcxff wants to merge 1 commit into
05-06-_slop_fix_rivetkit_remove_async_drizzle_db_proxyfrom
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)
kitchen-sink ❌ Build Failed (View Logs) Web May 11, 2026 at 3:42 am
website 😴 Sleeping (View Logs) Web May 7, 2026 at 5:48 am
frontend-inspector ❌ Build Failed (View Logs) Web May 6, 2026 at 7:43 pm
ladle ❌ Build Failed (View Logs) Web May 6, 2026 at 7:42 pm
frontend-cloud ❌ Build Failed (View Logs) Web May 6, 2026 at 7:41 pm
mcp-hub ✅ Success (View Logs) Web May 6, 2026 at 7:41 pm

Copy link
Copy Markdown
Contributor Author

abcxff commented May 6, 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

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

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 6, 2026

PR Review: chore(rivetkit): log inspector errors + standardize pino errorKey error\n\n### Overview\n\nThis PR does two well-scoped things:\n1. Adds errorKey: 'error' to the base pino logger config so Pino built-in error serializer activates when an Error object is logged under the error key.\n2. Standardizes catch variable names from err to error and log field keys from err: to error: across the codebase to match that key.\n3. Adds missing logger().error(...) calls around the three inspector request handlers in native.ts so errors are no longer silently swallowed before errorResponse().\n\nThe intent is correct and the inspector logging additions are a clear improvement.\n\n### Issues\n\n#### Bug: Variable shadowing in inline-websocket-adapter.ts (lines 164-185)\n\nThe rename from err to error introduces a shadowed binding. The original code explicitly named the inner variable handlerErr to avoid this. Catch bindings are block-scoped so the behavior is correct at runtime, but the shadowing is a readability hazard and TypeScript will warn under --noShadow / strict linting. Rename the inner catch binding back to handlerError (or keep it as handlerErr).\n\n#### Style: Log message capitalization in native.ts\n\nCLAUDE.md states log messages should be lowercase unless mentioning specific code symbols. Two of the three new log messages start with a capital E: 'Error handling inspector action request' and 'Error handling inspector request'. The third is correct: 'error replaying workflow history'. Lowercase all message strings.\n\n#### Minor: Inconsistent rename in registry/index.ts Mode B shutdown handler\n\nMode A renames catch (err) to catch (error) and uses the error shorthand. Mode B keeps catch (err) but changes the field to error: err. Rename the catch variable to error for consistency with the rest of the PR.\n\n### Positive Observations\n\n- errorKey fix is correct and necessary. Without it, Pino serializes Error objects as empty objects when logged under an arbitrary key. Configuring errorKey activates the built-in error serializer (type, message, stack) automatically.\n- sleep-db.ts simplification is good. Removing the manual instanceof Error conversion is the right call now that Pino handles Error objects properly.\n- Inspector error logging additions in native.ts are a clear improvement. Errors were previously only surfaced via errorResponse() with no server-side log.\n- Runner parity is maintained. Both engine/sdks/typescript/runner/src/mod.ts and rivetkit-typescript/packages/engine-runner/src/mod.ts are updated together as required.\n- The session.ts rename is clean and correct.\n\n### Summary\n\nThe two substantive issues are the catch-variable shadowing in handleError (a readability/correctness risk if the block grows) and the capitalized log message strings. Otherwise this is a solid housekeeping PR with a real fix (errorKey) and useful new observability.

@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
@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
@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
@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
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