-
Notifications
You must be signed in to change notification settings - Fork 129
fix(inspector): allow executing rpcs in inspector #3289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
How to use the Graphite Merge QueueAdd 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. |
PR ReviewSummaryThis PR refactors actor worker context to support inspector mode and standardizes HTTP header usage by replacing hardcoded strings with constants. Overall, the changes are solid and improve maintainability. ✅ Strengths
🔍 Issues & Suggestions1. Code Style: Missing semicolon (Minor)Location: The const useConnectionDetails = () => {
return match(__APP_TYPE__)
.with("inspector", () => {
return {namespace: "", engineToken: ""};
})
.otherwise(() => {
const provider = useEngineCompatDataProvider();
return {namespace: provider.engineNamespace, engineToken: provider.engineToken};
});
} // Missing semicolon hereRecommendation: Add semicolon for consistency with the rest of the codebase. 2. Code Style: Inconsistent spacing (Minor)Location: There's a trailing whitespace after the destructuring assignment: const {engineToken, namespace} = useConnectionDetails();
// Extra blank line here
const {Recommendation: Remove the trailing whitespace for consistency. 3. Code Style: Object property spacing (Minor)Location: Missing spaces after colons in object literals: return {namespace: "", engineToken: ""}; // Should be { namespace: "", engineToken: "" }
return {namespace: provider.engineNamespace, engineToken: provider.engineToken};Recommendation: Add spaces after colons to match TypeScript/JavaScript conventions. 4. Potential Runtime Issue: Hook call order (Medium)Location: The In inspector mode, Recommendation: Consider restructuring to call hooks unconditionally: const useConnectionDetails = () => {
const provider = match(__APP_TYPE__)
.with("inspector", () => null)
.otherwise(() => useEngineCompatDataProvider());
return match(__APP_TYPE__)
.with("inspector", () => ({ namespace: "", engineToken: "" }))
.otherwise(() => ({
namespace: provider?.engineNamespace ?? "",
engineToken: provider?.engineToken ?? ""
}));
}However, this still has issues. A better approach might be: const useConnectionDetails = () => {
if (__APP_TYPE__ === "inspector") {
return { namespace: "", engineToken: "" };
}
const provider = useEngineCompatDataProvider();
return {
namespace: provider.engineNamespace,
engineToken: provider.engineToken
};
}Since 5. Missing Test Coverage (Medium)No test files were found for these components. Given that this PR changes critical connection logic for both normal and inspector modes, tests would be valuable. Recommendation: Consider adding tests to verify:
📊 Performance ConsiderationsNo performance concerns. The refactoring maintains the same runtime behavior with minimal overhead. 🔒 Security Considerations✅ No security issues identified. The changes improve security by:
📝 Best PracticesThe PR follows repository conventions well:
Final VerdictApprove with minor suggestions. The core logic is sound and achieves the stated goals. The main concern is the conditional hook call, but if 🤖 Generated with Claude Code |
More templates
@rivetkit/actor
@rivetkit/cloudflare-workers
@rivetkit/core
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
Graphite Automations"Test" took an action on this PR • (10/30/25)1 assignee was added to this PR based on Kacper Wojciechowski's automation. |

TL;DR
Refactored actor worker context to support inspector mode and standardized HTTP header usage.
What changed?
useConnectionDetails()hook inactor-worker-context.tsxthat returns different connection details based on the application typeActorWorkerContextProviderto use the new hook instead of directly accessing the data providerrivetkitwith imported constants fromdriver-helpers/modHEADER_ACTOR_QUERYto the list of allowed CORS headersHow to test?
Why make this change?
This change improves the codebase by: