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

Function hook_cursor_stop

src/hooks/cursor.rs:202–214  ·  view source on GitHub ↗

Cursor `stop` hook handler (fire-and-forget). Fires at the end of an agent turn and performs the primary transcript ingest: a time-boxed incremental catch-up that picks up bounded transcript tails appended during the turn. The `stop` output is informational only, so we emit an empty object and never ask the agent to continue. Fail-open.

()

Source from the content-addressed store, hash-verified

200/// tails appended during the turn. The `stop` output is informational only, so
201/// we emit an empty object and never ask the agent to continue. Fail-open.
202pub async fn hook_cursor_stop() -> i32 {
203 let event = read_hook_event!();
204 let root = cursor_project_root_from_event(&event);
205 record_hook_invoked(root.as_deref(), HintAgent::Cursor, "stop", &event);
206 ingest_cursor_transcript_for_event(
207 &event,
208 Some(CURSOR_CATCH_UP_INGEST_MAX_BYTES),
209 CURSOR_STOP_INGEST_BUDGET,
210 )
211 .await;
212 println!("{}", serde_json::json!({}));
213 0
214}
215
216/// Cursor `preCompact` hook handler.
217///

Callers 1

handle_hook_commandFunction · 0.85

Tested by

no test coverage detected