File size: 1,513 Bytes
26a284a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# commit-history worked examples

## 1. Branch filter

User: "Show agent commits on main."

Invocation:

```json
memory_commits { "branch": "main", "limit": 100 }
```

Response:

```json
{
  "commits": [
    { "short": "9a1b2c3", "branch": "main", "authoredAt": "2026-06-07T09:12:00Z",
      "message": "rotate refresh tokens", "sessionIds": ["7f3a9c21"],
      "observationCount": 14, "files": 3 },
    { "short": "b21d004", "branch": "main", "authoredAt": "2026-06-05T14:40:00Z",
      "message": "rate limiter audit", "sessionIds": ["b21d004e"],
      "observationCount": 9, "files": 1 }
  ]
}
```

Present:

> - `9a1b2c3` main 2026-06-07 "rotate refresh tokens", session `7f3a9c2` (14 obs, 3 files)
> - `b21d004` main 2026-06-05 "rate limiter audit", session `b21d004` (9 obs, 1 file)

## 2. Bare number as limit

User: "commit-history 5"

Treat `5` as the limit:

```json
memory_commits { "limit": 5 }
```

Render the five newest linked commits in the same format.

## 3. Empty result

User: "Show agent commits on release-2.0."

```json
memory_commits { "branch": "release-2.0", "limit": 100 }
```

Response:

```json
{ "commits": [] }
```

Present:

> No agent-linked commits on `release-2.0`. Drop the branch filter to see all
> linked commits, or try a different branch.

REST fallback for this same call, with encoding:

```http
GET /agentmemory/commits?branch=release-2.0&limit=100
```

Build it with `URLSearchParams` so a branch like `feat/a&b` becomes
`feat%2Fa%26b` rather than breaking the query.