This repository was archived by the owner on Oct 28, 2026. It is now read-only.
Repository navigation
Conversation
Member
|
Hi @To3akaRin , langbot-plugins have been migrated to https://github.com/langbot-app/LangBot/tree/master/plugins , please file a new PR there~ |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
LocalAgent currently performs repeated Host token-count RPCs while fitting and reporting the same context. A simple under-budget assembly makes eight calls for only four distinct inputs. This change reuses successful counts within one
compact_async()invocation, reducing that path to four calls while preserving the complete assembly result.Refs langbot-app/LangBot#2716. This addresses the assembly-local duplicate-counting portion of that issue.
Implementation
Message.model_dump()values. Preserve types, order, nested fields and signed zero without repeatedly JSON-encoding large Base64 strings. Unsupported values fall back to the original counter.Validation
uv sync --locked --extra dev --python 3.11uv run --no-sync pytest -q: 327 passed, with existing SDK Pydantic deprecation warnings.ruff check,ruff format --check,git diff --check, andlbp buildpassed. The built package's production-source SHA-256 matches the benchmarked source.Reproducible comparison
The committed harness loads the original source from immutable baseline
7b532cfd6222aa79f05f113b4db6c876d4782434and compares every message, frame, compaction result and diagnostic with the current implementation. All 24 configurations passed exact output comparisons (four scenarios, 0/2/10 ms simulated RPC waits, concurrency 1/8, 20 measured batches after two warmups).The full results, including zero-wait overhead and P95, are in the benchmark guide. Some zero-wait paths are slower due to snapshot work; the history/RAG 2 ms, concurrency-8 P95 also increased in this run (21.018 → 44.239 ms). This synthetic benchmark does not establish production throughput or universal latency improvement, and does not include real Core/Runtime RPC, models, database, Box or IM delivery.
No dependency, environment variable, configuration, Host authorization, cancellation polling, or SDK protocol changes are included.