-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(reborn): Context management — progressive tool disclosure (flag-gated, default off) #5149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
serrrfirat
wants to merge
36
commits into
main
Choose a base branch
from
firat/reborn-context-management
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
5dfd0cd
docs(reborn): add Hermes-style context-management design (tool disclo…
serrrfirat 8f56d75
feat(reborn): Phase 0 shadow measurement for context management
serrrfirat db9d099
feat(reborn): Phase 1.1 tool-disclosure catalog + selector + token be…
serrrfirat dda1e59
feat(reborn): Phase 1.2 wire tool disclosure via capability-port deco…
serrrfirat 3c3cc9d
docs(reborn): record implementation status + codebase grounding for c…
serrrfirat 2dc0127
test(reborn): negative-path + flag-off coverage for tool-disclosure b…
serrrfirat 336aa16
docs(reborn): mark negative-path bridge tests done; only canary remains
serrrfirat 7aff964
chore(reborn)!: TEMPORARY default tool disclosure ON for remote bench…
serrrfirat 5d8f068
fix(reborn): address Gemini + CodeRabbit review feedback on PR #5149
serrrfirat 41bb5ea
fix(reborn): CI fix (pin QA replays to disclosure-off) + 2 newer Code…
serrrfirat aa12134
fix(reborn): correct+widen disclosure core (B) and forgive deferred t…
serrrfirat ecaeb06
feat(reborn): log full-vs-disclosed tool-surface savings per turn (sh…
serrrfirat 58a5140
feat(reborn): Hermes-shaped disclosure core + count-aware tool_search
serrrfirat 4aebf24
fix(reborn): forgiving bridge actually dispatches direct deferred too…
serrrfirat 12a1861
test(reborn): prove forgiving direct-deferred dispatch is provider-ag…
serrrfirat e719896
feat(reborn): teach the model the tool-disclosure protocol in the sys…
serrrfirat 9908836
fix(reborn): address CodeRabbit review — preserve authority surface +…
serrrfirat 2e1e1ac
debug(reborn): temporary diagnostics for direct-deferred resolution miss
serrrfirat 04e8bc7
fix(reborn): make the full extension lifecycle core so onboarding works
serrrfirat ca69d08
fix(reborn): resolve deferred tools by any name form + revert step-1 …
serrrfirat 44c6183
debug(reborn): startup marker for the tool-disclosure build
serrrfirat ba77135
style(reborn): rustfmt wrap in matcher test
serrrfirat 2cf4f00
debug(reborn): bump disclosure marker to v2 + matcher self-test
serrrfirat f52546c
debug(reborn): unconditional entry probe on context_shadow target
serrrfirat aaadd04
fix(reborn): surface filters must delegate provider-tool-call resolut…
serrrfirat 116f226
debug(reborn): marker v3 echoes loop_support filter build constant
serrrfirat f9a436a
fix(reborn): SurfaceTrackingLoopCapabilityPort must delegate tool-cal…
serrrfirat 0c34188
fix(reborn): record canonical wire name for forgiving direct-deferred…
serrrfirat d167e71
fix(reborn): make tool_call bridge resolve undisclosed catalog tools …
serrrfirat c701c33
fix(reborn): collapse repeated identical error observations in replay…
serrrfirat 83ae258
fix(reborn): log provider tool-call validate/register rejections in t…
serrrfirat 519dbc7
fix(reborn): make forgiving tool_call failures recoverable, not run-b…
serrrfirat 48fd811
Merge origin/main into firat/reborn-context-management
serrrfirat 7086bf6
fix(reborn): log the rejecting layer's reason on gateway tool-call re…
serrrfirat 7ae4fef
fix(reborn): promote gate-suspended tools so they survive a BlockedAu…
serrrfirat 5b4e9be
fix(reborn): describe-first schema-on-blind-call for deferred tools
serrrfirat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /// Deterministic shadow token estimator for prompt-surface diagnostics. | ||
| #[allow(clippy::manual_div_ceil)] | ||
| pub(crate) fn estimate_tokens(s: &str) -> u32 { | ||
| let char_count = s.chars().count(); | ||
| ((char_count + 3) / 4).min(u32::MAX as usize) as u32 | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::estimate_tokens; | ||
|
|
||
| #[test] | ||
| fn estimate_tokens_uses_ceiling_char_count_over_four() { | ||
| assert_eq!(estimate_tokens(""), 0); | ||
| assert_eq!(estimate_tokens("a"), 1); | ||
| assert_eq!(estimate_tokens("abcd"), 1); | ||
| assert_eq!(estimate_tokens("abcde"), 2); | ||
| } | ||
|
|
||
| #[test] | ||
| fn estimate_tokens_counts_chars_not_bytes() { | ||
| assert_eq!(estimate_tokens("ééééé"), 2); | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.