Skip to content

chore(agents): install shelltime hooks for agy and cursor - #22

Merged
AnnatarHe merged 1 commit into
mainfrom
chore/install-shelltime-hooks
Nov 27, 2026
Merged

AnnatarHe merged 1 commit into
mainfrom
chore/install-shelltime-hooks

Conversation

@AnnatarHe

@AnnatarHe AnnatarHe commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Install project-level ShellTime tracking hooks for Antigravity (.agents/hooks.json) and Cursor (.cursor/hooks.json).


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Install project-level ShellTime tracking hooks for Antigravity (.agents/hooks.json) and Cursor (.cursor/hooks.json).
@AnnatarHe
AnnatarHe merged commit 498c139 into main Nov 27, 2026
@AnnatarHe
AnnatarHe deleted the chore/install-shelltime-hooks branch November 27, 2026 17:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T17:14:08.087805Z 5672950 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread .agents/hooks.json
"PostToolUse": [
{
"matcher": "*",
"hooks": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: the PostToolUse entry uses a different schema from the other four events in this file. SessionStart, PreInvocation, PostInvocation and Stop are flat {type, command, timeout} objects. PostToolUse is nested as {matcher, hooks: [...]}. If agy expects one shape for all events, either PostToolUse or the other four will be silently ignored or rejected, and tool-use tracking (or session and invocation tracking) won't work. Fix: confirm against the agy hooks schema and use one shape for every event, or generate the file from the same template the shelltime installer uses.

Comment thread .agents/hooks.json
@@ -0,0 +1,44 @@
{
"shelltime": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: every hook is nested under a custom top-level "shelltime" key, while the Cursor file puts events directly under hooks with a version field. If agy reads events from the top level (or a hooks key), nothing here is ever loaded, and the agy integration does nothing. Fix: verify the file layout agy actually reads, and move the events to that location, or drop the shelltime wrapper.

Comment thread .cursor/hooks.json
"version": 1,
"hooks": {
"beforeSubmitPrompt": [
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: the command can print an empty line on the success path. When shelltime hook-ingest exits 0 with no stdout, out is empty and printf '%s\n' "$out" emits a blank line. The || echo '{...}' fallback only runs on a non-zero exit. Cursor then gets empty output instead of JSON. For beforeSubmitPrompt that means no {"continue":true}, and the prompt may be blocked or the hook reported as failed. The same applies to every hook in .agents/hooks.json (Stop expects {"decision":"allow"}). Fix: fall back when $out is empty, for example [ -n "$out" ] && printf ... || echo '{...}'. Or have the command always end with the default JSON.

Comment thread .cursor/hooks.json
@@ -0,0 +1,40 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): none of the Cursor hooks sets a timeout, although the agy file uses 15 s for each. If shelltime hook-ingest blocks (for example on a hung daemon socket), beforeSubmitPrompt can stall every prompt until Cursor's default timeout. Fix: add a timeout to each entry. Also, these files are checked into a JetBrains plugin repo and make every contributor's agent session (prompts and tool calls) get sent to the ShellTime daemon. Confirm that is intended, and consider documenting it in CLAUDE.md or the README.

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (43.31%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #22   +/-   ##
=======================================
  Coverage   43.31%   43.31%           
=======================================
  Files          23       23           
  Lines         972      972           
  Branches      231      231           
=======================================
  Hits          421      421           
  Misses        487      487           
  Partials       64       64           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84c2638...5672950. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant