Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Oct 27, 2025

This pull request contains changes generated by Cursor background composer.

Open in Cursor Open in Web

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
Copy link

cursor bot commented Oct 27, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Oct 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
spotlightjs Skipped Skipped Oct 27, 2025 1:40pm

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]>
@BYK BYK marked this pull request as ready for review October 27, 2025 13:35
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a 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

const serverInstance = await tail({ port, cmdArgs: [], basePath, filesToServe, format }, logChecker);
if (!serverInstance) {
logger.error("Failed to start Spotlight sidecar server.");
process.exit(1);
}

Fix in Cursor Fix in Web


@BYK BYK merged commit 15d3921 into byk/feat/run-auto-log-stdio Oct 27, 2025
16 checks passed
@BYK BYK deleted the cursor/optimize-message-handling-and-clean-comments-47ee branch October 27, 2025 13:45
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.

3 participants