Skip to content

fix(local): print one timestamp per event line and identify as a Spot… - #1341

Merged
MathurAditya724 merged 1 commit into
mainfrom
cursor/fix-local-timestamps-and-sidecar-27d6
Aug 2, 2026
Merged

fix(local): print one timestamp per event line and identify as a Spot…#1341
MathurAditya724 merged 1 commit into
mainfrom
cursor/fix-local-timestamps-and-sidecar-27d6

Conversation

@MathurAditya724

Copy link
Copy Markdown
Member

…light sidecar

Event tails rendered their own event timestamp and then went through logger.log(), so consola's reporter appended a second wall-clock time to every line (right-aligned on wide terminals, a [HH:MM:SS] prefix on narrow ones). Print those pre-formatted lines straight to stderr via printLine() so only the event time survives.

The local server also never advertised X-Powered-By: spotlight-by-sentry, which is what Spotlight's isSidecarRunning() probes for. Without it the desktop app treated the CLI server as 'no sidecar connected', tried to start its own on 8969, and hit EADDRINUSE. Set the header on every response and echo the ;base64 event-type suffix that Spotlight UI clients request via ?base64 on /stream.

…light sidecar

Event tails rendered their own event timestamp and then went through
logger.log(), so consola's reporter appended a second wall-clock time to
every line (right-aligned on wide terminals, a [HH:MM:SS] prefix on narrow
ones). Print those pre-formatted lines straight to stderr via printLine()
so only the event time survives.

The local server also never advertised X-Powered-By: spotlight-by-sentry,
which is what Spotlight's isSidecarRunning() probes for. Without it the
desktop app treated the CLI server as 'no sidecar connected', tried to
start its own on 8969, and hit EADDRINUSE. Set the header on every
response and echo the ;base64 event-type suffix that Spotlight UI clients
request via ?base64 on /stream.

Co-authored-by: Aditya Mathur <MathurAditya724@users.noreply.github.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 2, 2026
@MathurAditya724
MathurAditya724 enabled auto-merge (squash) August 2, 2026 22:09
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-02 22:18 UTC

@MathurAditya724
MathurAditya724 merged commit cacbc0f into main Aug 2, 2026
29 checks passed
@MathurAditya724
MathurAditya724 deleted the cursor/fix-local-timestamps-and-sidecar-27d6 branch August 2, 2026 22:17
MathurAditya724 added a commit that referenced this pull request Aug 3, 2026
…1342)

`local run` only printed events when it started the background server
itself. When something else was already listening — most often the
Spotlight desktop app's own sidecar — it injected SENTRY_SPOTLIGHT,
spawned the child, and then stayed silent for the whole session: no
logs, no traces, even though envelopes were flowing to that server.

Attach as an SSE consumer in that case, which is what `local serve`
already does, so the terminal tail works regardless of who owns the
port. The subscription is torn down when the child exits.

This became much more visible after #1341: now that the CLI server
advertises itself as a Spotlight sidecar, the desktop app keeps its own
sidecar on 8969 instead of losing the race, so `run` hits the attach
path far more often.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Aditya Mathur <MathurAditya724@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants