feat: redesign as context-guru — provider-agnostic context-engineering#4
Merged
Conversation
added 2 commits
July 12, 2026 11:01
Greenfield provider-agnostic context-engineering library built on bifrost's chat schema. Split-by-lossiness component API (Reformat vs Offload), a config-ordered fail-open never-worse pipeline, name->constructor registry, in-memory TTL+LRU store, marker + model-callable expand reversibility, and honest bounce-adjusted metrics. One shared apply path drives two hosts: the context-guru-proxy (also the eval-containers gateway) and the AuthBridge in-process plugin. Handles Anthropic tool_result tool outputs by normalizing them to synthetic tool messages and splicing rewrites back byte-losslessly. Includes rewritten docs with diagrams and the eval-containers SWE-bench gateway harness. Assisted-By: Claude (Anthropic AI) Signed-off-by: Osher-Elhadad <Osher.Elhadad@ibm.com>
Signed-off-by: Osher-Elhadad <Osher.Elhadad@ibm.com> # Conflicts: # README.md # cmd/proxy/main.go # internal/proxyhttp/proxy.go # internal/proxyhttp/proxy_test.go
This was referenced Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Greenfield redesign of this repo into context-guru: a provider-agnostic context-engineering library (built on bifrost's chat schema) that reduces LLM-agent token cost, with one core behind two hosts — the
context-guru-proxy(also the eval-containers gateway) and the AuthBridge in-process plugin.Highlights
Reformat(lossless) vsOffload(drops bytes, must stash a recoverable original). Config-ordered, fail-open, never-worse pipeline; name→constructor registry (add a component → YAML-configurable, no core edit).tool_resultsupport — Claude Code sends tool outputs astool_resultblocks inside user messages, which bifrost's schema can't represent.applynormalizes them to synthetictoolmessages, runs the pipeline, and splices rewrites back byte-losslessly (siblings/tool_use_idpreserved). Validated live againstclaude-sonnet-4-6.<<cg:HASH>>markers + store + a model-callableexpandtool loop (proxy handles OpenAI + Anthropic continuation).top_passthroughdead-weight signal, per-component accounting.README+docs/{design,components,integrations,setup}.md, including per-component deep-dives and a real SWE-bench + Claude Code run.deploy/eval-containers/): Dockerfile, gatewaystart, compose override, resumablesweep.py+aggregate.py.Correctness & tests
skeletonrewrote non-tool messages' own code; the cache-safety lossless-splice guard; malformed expand continuations; misleadingtop_passthrough.-coverpkg).go build/vet/testall green;gofmtclean.Early benchmark results (SWE-bench, Claude Code, claude-sonnet-4-6)
balancedpreset: ~12% content-token savings on resolved tasks (up to ~23%), driven mainly byfailed_runcollapsing superseded test/build runs.Follow-ups (tracked, not in this PR)
expandtool into outgoing requests + streaming-safe recovery (unlocks the lossy offloaders — skeleton/collapse/mask — on Claude Code's file-read-heavy traffic).