Repository navigation
Cursor live hook: honor active profile's default_visibility - #580
Conversation
The live Cursor sessionStart dispatcher never stamped the active profile's default_visibility onto the payload (unlike the Codex hook), so a private-default user's Cursor sessions in org repos silently went org-visible (the server treats a null default_visibility as the org-visibility fallback). Stamp it in the sessionStart branch before the git-enrichment round-trip, budget-bounded and fail-open. Adds Linux-gated integration coverage mirroring CodexSessionStartVisibilityTests. Requires the companion kcap-server change to read the field into the capacitor block. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoHonor active profile visibility in live Cursor sessions
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
Address Qodo review: keep only the non-obvious why (workspace_roots forces the enrichment reserialization the stamp must survive); drop the ticket narrative and routine fixture narration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
The live Cursor
sessionStarthook dispatcher (CursorHookCommand.HandleCore) never stamped the active profile'sdefault_visibilityonto the payload before POSTing to/hooks/session-start/cursor, unlike the Codex hook. As a result, a user withdefault_visibility: privatestill had their live Cursor sessions land org-visible in org repos, because the server treats a nulldefault_visibilityas the org-visibility fallback.Change
default_visibilityfromAppConfig.GetActiveProfileAsyncin thesessionStart && !isSubagentChildbranch, before the git-enrichment round-trip (so it survives re-serialization), budget-bounded and fail-open (the hook must never block the agent loop). MirrorsCodexHookCommand.CursorSessionStartVisibilityTests(Linux-gated integration, mirroringCodexSessionStartVisibilityTests): aprivateand apublicprofile default each round-trip verbatim onto the POST body, withworkspace_rootsset so the enrichment reparse actually runs.Notes
ImportCommand) already stampsdefault_visibility; this is a disjoint code path and is unchanged.default_visibilityto the Cursor session-start hook model and packs it into the capacitor block) to take effect; the extra payload field is harmlessly ignored by an old server.Closes #579
Linear: AI-783