@superbased/observer 1.6.28 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -24
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -599,28 +599,47 @@ importance score (for drops).
|
|
|
599
599
|
|
|
600
600
|
### Tuning
|
|
601
601
|
|
|
602
|
-
`observer config` settings (in `~/.observer/config.toml`)
|
|
602
|
+
`observer config` settings (in `~/.observer/config.toml`). These are the only
|
|
603
|
+
keys the conversation compressor reads:
|
|
603
604
|
|
|
604
605
|
```toml
|
|
605
606
|
[compression.conversation]
|
|
606
607
|
enabled = true
|
|
608
|
+
mode = "cache_aware" # "token" | "cache" | "cache_aware" — default cache_aware; see matrix below
|
|
607
609
|
target_ratio = 0.85
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
prefix_bytes = 8192
|
|
611
|
-
compress_types = ["json", "logs", "text"] # add "code", "diff", "html" to opt in
|
|
612
|
-
min_bytes_to_compress = 1024
|
|
613
|
-
|
|
614
|
-
[compression.conversation.weights]
|
|
615
|
-
recency = 0.4
|
|
616
|
-
reference = 0.3
|
|
617
|
-
density = 0.15
|
|
618
|
-
role = 0.15
|
|
610
|
+
preserve_last_n = 5 # never drop the most recent N messages
|
|
611
|
+
compress_types = ["json", "logs", "code"] # default; add "text", "diff", "html" to opt in
|
|
619
612
|
```
|
|
620
613
|
|
|
621
614
|
High importance scores on dropped events (≥0.5) suggest the threshold
|
|
622
615
|
is too aggressive — raise `target_ratio` (e.g. 0.9 or 0.95).
|
|
623
616
|
|
|
617
|
+
### Choosing a mode: Anthropic vs Codex
|
|
618
|
+
|
|
619
|
+
Per-type `tool_result` compression runs in every mode; `mode` only changes how
|
|
620
|
+
messages are dropped and whether an Anthropic `cache_control` marker is injected.
|
|
621
|
+
|
|
622
|
+
| `mode` | What it does | Claude Code (Anthropic) | Codex / OpenAI |
|
|
623
|
+
|---|---|---|---|
|
|
624
|
+
| `token` | Per-type compress, then drop lowest-scored messages to hit `target_ratio`. | ✅ Works. | ✅ Clearest choice for Codex/OpenAI. |
|
|
625
|
+
| `cache` | Restrict drops to the tail half + inject a `cache_control` marker at the prefix boundary. | ✅ Anthropic-specific. | ⚠️ No effect beyond `token`. |
|
|
626
|
+
| `cache_aware` *(default)* | Skip drops, narrow compression to `tool_result` blocks, no marker; keep history byte-stable across turns so Anthropic's prefix cache keeps hitting. | ✅ **Recommended for Anthropic Pro/Max** — and the shipped default. | ⚠️ No effect beyond `token`. |
|
|
627
|
+
|
|
628
|
+
The shipped default is `cache_aware` (`token` is just the internal fallback when
|
|
629
|
+
`mode` is empty). The cache modes exist for **Anthropic's content-hash prefix
|
|
630
|
+
cache** (`cache_control` is an Anthropic Messages API concept). OpenAI/Codex
|
|
631
|
+
prompt caching is **automatic and server-side** — nothing to mark or tune, so
|
|
632
|
+
the proxy's OpenAI path is mode-agnostic (the default `cache_aware` behaves like
|
|
633
|
+
`token` there). So: keep `cache_aware` for Claude Code; `mode = "token"` reads
|
|
634
|
+
honestly for a Codex/OpenAI-only setup.
|
|
635
|
+
|
|
636
|
+
Beyond the keys above, three opt-in sub-features have their own tables —
|
|
637
|
+
`[compression.conversation.stash]` (Compressed-Content Retrieval),
|
|
638
|
+
`[compression.conversation.rolling]` (rolling summarisation, with a per-provider
|
|
639
|
+
summary model: `summary_model` for Anthropic, `openai_summary_model` for
|
|
640
|
+
OpenAI/Codex), and `[compression.conversation.compaction]`. The full knob
|
|
641
|
+
reference lives in `docs/compression-modes.md`.
|
|
642
|
+
|
|
624
643
|
|
|
625
644
|
## Cost and token math
|
|
626
645
|
|
|
@@ -808,19 +827,11 @@ listen_addr = "127.0.0.1"
|
|
|
808
827
|
port = 8081
|
|
809
828
|
|
|
810
829
|
[compression.conversation]
|
|
811
|
-
enabled =
|
|
830
|
+
enabled = false # opt-in; default off
|
|
831
|
+
mode = "cache_aware" # default; "token" | "cache" | "cache_aware" (see "Choosing a mode")
|
|
812
832
|
target_ratio = 0.85
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
prefix_bytes = 8192
|
|
816
|
-
compress_types = ["json", "logs", "text"]
|
|
817
|
-
min_bytes_to_compress = 1024
|
|
818
|
-
|
|
819
|
-
[compression.conversation.weights]
|
|
820
|
-
recency = 0.4
|
|
821
|
-
reference = 0.3
|
|
822
|
-
density = 0.15
|
|
823
|
-
role = 0.15
|
|
833
|
+
preserve_last_n = 5
|
|
834
|
+
compress_types = ["json", "logs", "code"] # default; add "text"/"diff"/"html" to opt in
|
|
824
835
|
|
|
825
836
|
[compression.shell]
|
|
826
837
|
enabled = true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbased/observer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "SuperBased Observer — capture, normalize, compress, and analyze AI coding tool activity across Claude Code, Codex, Cursor, Cline/Roo, and Copilot.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"LICENSE"
|
|
37
37
|
],
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@superbased/observer-linux-x64": "1.
|
|
40
|
-
"@superbased/observer-linux-arm64": "1.
|
|
41
|
-
"@superbased/observer-darwin-x64": "1.
|
|
42
|
-
"@superbased/observer-darwin-arm64": "1.
|
|
43
|
-
"@superbased/observer-win32-x64": "1.
|
|
39
|
+
"@superbased/observer-linux-x64": "1.7.0",
|
|
40
|
+
"@superbased/observer-linux-arm64": "1.7.0",
|
|
41
|
+
"@superbased/observer-darwin-x64": "1.7.0",
|
|
42
|
+
"@superbased/observer-darwin-arm64": "1.7.0",
|
|
43
|
+
"@superbased/observer-win32-x64": "1.7.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "node bin/observer.js --version"
|