Skip to content

Cursor preset ignores model_id and preserves empty model values #2489

Open

Description

@vladikkuzn

Cursor agent CLI / ACP sessions can be recorded as cursor::unknown in git-ai stats --json; an empty hook model produces a separate cursor:: bucket.

In an aggregate sample of 2,000 commits, all 54 Cursor sessions with CLI-style agent-<uuid> IDs had model unknown, while all 53 sessions with IDE-style UUID IDs had populated models. The inspected CLI JSONL transcripts contained no model field. This was observed with Git AI 1.7.5; the same parser remains on main at 1.7.7.

Root cause: src/commands/checkpoint_agent/presets/cursor.rs reads only model, defaults a missing value to unknown, and preserves an empty string. Cursor documents an optional model_id field, which the preset ignores.

Synthetic reproduction: In a throwaway repository, pass this JSON to git-ai checkpoint cursor --hook-input stdin, first with hook_event_name set to preToolUse, then write example.txt, then repeat with postToolUse:

{
  "conversation_id": "agent-00000000-0000-4000-8000-000000000001",
  "workspace_roots": ["<scratch-repository>"],
  "hook_event_name": "preToolUse",
  "tool_name": "Write",
  "tool_use_id": "write-1",
  "tool_input": {"file_path": "example.txt"}
}

Commit the file, wait for processing, and inspect git-ai stats --json. With no model, the bucket is cursor::unknown; adding "model":"" produces cursor::; adding "model":"composer-2.5" produces cursor::composer-2.5. A payload with only a valid model_id is also currently ignored.

Expected: Preserve a nonblank model, otherwise use a nonblank payload model_id, and normalize unavailable/blank values to unknown. Global last-selected CLI/ACP config is not reliable evidence of the model used by a particular session.

Verification limit: A live authenticated Cursor CLI/ACP hook payload has not been captured. The documented fallback fixes payloads that supply model_id; it cannot recover a model if both fields are absent. The CLI-session symptom may therefore also require a Cursor-side change.

Related: #127 (older missing Cursor models), #2396 (different cross-tool hook collision).

Parser fix: #2490

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions