-
-
Notifications
You must be signed in to change notification settings - Fork 32
Optimize message handling and clean comments #1047
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
Optimize message handling and clean comments #1047
Conversation
This commit refactors the way standard input/output logs are processed and sent to the Spotlight sidecar. It introduces a new `EventContainer` and `getBuffer` utility for managing events and streamlines the integration with the sidecar server by returning the server instance and an `onEnvelope` callback. This change also removes redundant code and improves error handling. Co-authored-by: burak.kaya <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Add comments to clarify log levels and payload length calculation. Ensure server port is available and set SENTRY_TRACES_SAMPLE_RATE. Handle remaining buffered output on process close. Co-authored-by: burak.kaya <[email protected]>
Co-authored-by: burak.kaya <[email protected]>
Co-authored-by: burak.kaya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Inverted Logic on Successful Upstream Connection
The code treats a falsy serverInstance return value from tail() as a failure and exits with an error. However, in tail.ts, when successfully connecting to an upstream sidecar, the function now returns undefined (line 94). This causes the logic to be inverted: successful upstream connections are treated as failures. The conditional check should either allow undefined as a valid return value indicating successful upstream connection, or the return value semantics in tail() should be changed to consistently return a truthy value on success.
packages/sidecar/src/cli/run.ts#L100-L105
spotlight/packages/sidecar/src/cli/run.ts
Lines 100 to 105 in ec5e8f8
| const serverInstance = await tail({ port, cmdArgs: [], basePath, filesToServe, format }, logChecker); | |
| if (!serverInstance) { | |
| logger.error("Failed to start Spotlight sidecar server."); | |
| process.exit(1); | |
| } |
This pull request contains changes generated by Cursor background composer.