MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / hook_cursor_session_end

Function hook_cursor_session_end

src/hooks/cursor.rs:182–194  ·  view source on GitHub ↗

Cursor `sessionEnd` hook handler (fire-and-forget). Final transcript-ingest flush when a conversation ends (including `window_close` / `user_close`, which the end-of-turn `stop` hook can miss). `sessionEnd` receives the common-schema `transcript_path`, so the regular capped catch-up ingest applies. The response is logged but unused, so an empty object is emitted. Fail-open.

()

Source from the content-addressed store, hash-verified

180/// regular capped catch-up ingest applies. The response is logged but unused,
181/// so an empty object is emitted. Fail-open.
182pub async fn hook_cursor_session_end() -> i32 {
183 let event = read_hook_event!();
184 let root = cursor_project_root_from_event(&event);
185 record_hook_invoked(root.as_deref(), HintAgent::Cursor, "sessionEnd", &event);
186 ingest_cursor_transcript_for_event(
187 &event,
188 Some(CURSOR_CATCH_UP_INGEST_MAX_BYTES),
189 CURSOR_STOP_INGEST_BUDGET,
190 )
191 .await;
192 println!("{}", serde_json::json!({}));
193 0
194}
195
196/// Cursor `stop` hook handler (fire-and-forget).
197///

Callers 1

handle_hook_commandFunction · 0.85

Tested by

no test coverage detected