Repository navigation
feat(llm): add budget orchestrator, complexity gate, 429 circuit breaker, and prompt trimming - #356
Open
Coding-Dev-Tools wants to merge 7 commits into
Open
Coding-Dev-Tools wants to merge 7 commits into
Coding-Dev-Tools wants to merge 7 commits into
Conversation
…ker, and prompt trimming Add ManagedAllowanceTracker, deterministic complexity gate, and bounded content-hash LLMResultCache in engraphis.llm.budget; upgrade LLMClient with 0ms quota-exhausted 429 fail-fast, live allowance recording, logical managed profiles, idempotent request_key, 22k prompt trimming, json_object response_format with fallback, and pooled managed client reuse; wire background complexity/headroom gating into engine.ingest/factory and enforce an 18k proactive synthesis prompt budget.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…and refresh offline evidence Validate credentials before result-cache lookups and isolate cache/allowance state by active Cloud session or provider scope, preserve and fail-closed on system prompts in managed trimming, isolate BYOK 429 quota errors from the managed tracker, cache response_format incompatibility per provider/model, harden pooled client lifecycle and model keying, remove the core-to-llm import inversion, and refresh the offline benchmark evidence registry.
… and refresh offline evidence
Owner
Author
|
2-agent independent review loop completed at 29e4be4:
|
`managed_session_scope()` hashed the raw cloud session bytes via `saved_session_digest()`. Every `access_for_workspace()` call rotates the single-use refresh credential and rewrites that file, so the scope tuple changed on every managed request. That silently reset `ManagedAllowanceTracker`'s 429 breaker and headroom, missed or cleared `LLMResultCache` on every call, and let `_cache_store()` re-key an in-flight response onto a different account when the operator switched Cloud accounts mid-request, filing one account's output under another's cache entry. Key the scope on the immutable identity fields instead (control URL, organization_id, and the member/device/token_subject triple). The byte digest remains correct where a caller genuinely wants to detect that the session was revoked, which is what it was written for. Also drop a response whose scope changed mid-flight rather than re-keying it, and key BYOK cache entries on the real model: `effective_profile` is honored only for provider="managed", so two distinct BYOK models sharing profile="fast" collided on one cache entry.
`tests/test_benchmark_evidence.py` hashes every `.py` under `engraphis/` and `eval/`, so the budget.py and client.py changes invalidated the committed registry artifact and failed the whole Python matrix. Export a new immutable artifact and repoint the test constants, README prefix, BENCHMARKS.md name/sha, and the fixture-suite digest. The SVGs and PNGs were regenerated so their embedded provenance matches.
This branch has not been deployed
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.
Summary
easoning).
equest_key reuse across transient retries, 22k-char managed prompt trimming, native
esponse_format={type: json_object} with 400 fallback, and pooled managed LLMClient reuse.
Verification
uff check: All checks passed.