Commit cdb056f
v0.13.0 Option A — OMC_MCP_AUTO_SUMMARY for shim-free token savings
Adds opt-in post-processor that auto-summarizes any MCP response whose
`text` field exceeds OMC_MCP_AUTO_SUMMARY_THRESHOLD bytes (default 1024).
The full body is cached in the `_auto_summary_cache` namespace, the LLM
receives a tiny envelope with preview + expand_with instructions, and
omc_memory_recall(content_hash_str, namespace=_auto_summary_cache) is
the lossless expansion path.
Measured: 27× LLM-token savings on an 18KB recall response (673 bytes vs
18,204 bytes). No new MCP tooling needed — uses the existing MemoryStore
as the cache, naturally dedupes via the Axis 2 dedup pool.
Activation:
OMC_MCP_AUTO_SUMMARY=1 # opt in
OMC_MCP_AUTO_SUMMARY_THRESHOLD=1024 # default
Lossless: the full body is always recoverable. Skip rules: only triggers
on responses with a `text` field; small responses and metadata responses
pass through unchanged.
This is the substrate-MCP path A from the v0.13 design conversation:
shim-less, no client-side changes, no LLM training, drop-in via env flag.
Path B (api-proxy shim that rewrites the LLM's full context) is v0.14
future work.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 4909477 commit cdb056f
1 file changed
Lines changed: 67 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
798 | 801 | | |
799 | 802 | | |
800 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
801 | 860 | | |
802 | 861 | | |
803 | 862 | | |
| |||
0 commit comments