diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2026-10-03 19:47:45 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2026-10-03 19:47:45 -0300 |
| commit | a5896fe2e28eb1e9ff9affe5d47ccd443bee5fc2 (patch) | |
| tree | d76155b2c6aed9b905fe1b04094b879420964177 /server/server_test.go | |
| parent | 60c586001cf4d21ef1351be8c8ad7a269a6f005a (diff) | |
| download | claude-logbook-a5896fe2e28eb1e9ff9affe5d47ccd443bee5fc2.tar.gz claude-logbook-a5896fe2e28eb1e9ff9affe5d47ccd443bee5fc2.zip | |
Use the /rename title, mark compactions, count active time
A title set with /rename (custom-title) now wins over Claude's. The
summary Claude Code leaves when the context is compacted is a block of its
own ("c"), shown as a "context compacted here" mark instead of a message of
yours, and not counted. Duration is active time: pauses over 30 minutes
between messages are left out.
Diffstat (limited to 'server/server_test.go')
| -rw-r--r-- | server/server_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/server_test.go b/server/server_test.go index 72f5b9c..d19c5e8 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -117,6 +117,16 @@ func TestCreateAndRead(t *testing.T) { } } +func TestCompactionBlock(t *testing.T) { + h := newHarness(t, nil) + withC := strings.Replace(session, `"c":[`, `"c":[{"r":"c","x":"earlier summary"},`, 1) + r := h.create(`{"payload":` + payload(withC) + `}`) + txt := h.do("GET", "/share/"+r.ID+".txt", "", "").Body.String() + if !strings.Contains(txt, "--- context compacted here ---") || strings.Contains(txt, "earlier summary") { + t.Fatalf("txt: %s", txt) + } +} + func TestUpdateAndDeleteNeedTheSecret(t *testing.T) { h := newHarness(t, nil) r := h.create(`{"payload":` + payload() + `}`) |