Repository navigation
Conversation
6 of 45 tasks
7 of 9 tasks
…to impl-1912-context
…to impl-1912-context
This was referenced Nov 21, 2026
…to impl-1912-context # Conflicts: # crates/dim-agent-capabilities/src/context_preparation.rs # docs/architecture/rust-agent/generated/catalog.md # npm/branch-services.d.ts
eric8810
marked this pull request as ready for review
November 21, 2026 16:23
10 of 11 tasks
eric8810
marked this pull request as draft
November 21, 2026 16:56
eric8810
marked this pull request as ready for review
November 22, 2026 00:02
eric8810
marked this pull request as draft
November 22, 2026 00:06
This was referenced Nov 22, 2026
Open
Collaborator
Author
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.
Refs #1292
Implementation
Depends on #1911. Both PRs register operations on the same branch
contextPreparationservice.prepareModelHost.prepare.prepareContextHost.prepare.contextUsage.read.contextModelHost.compactionStrategyHost.historyRenderer.contextPreparation.prepareandvalidateshare the native preparation and validation logic. ModelProvider validates the same request, and the Loop’s fixed-cutoff projection remains available to the Timeline consumer.Final API
prepare({turnId, requestId, history, availableTools}) → ModelSettings, with pinned tool definitions in order.prepare({request, source:{turnId, requestId, through}}, cancelled) → ModelRequest.describe(model facts) → {contextWindow, outputTokens, thresholdTokens, algorithm?},count(request) → tokens,contributions({model, fixed?, messages}) → {algorithm, fixed?, messages},estimate({model, algorithm, contribution}) → tokens.describe(model facts) → {name, replacementSize};compact(input, cancelled) → completed, skipped or failedwith StrategyDiagnostics. Input carries history, checkpoint, request, legal cuts, trigger, budgets, prior diagnostics and model facts.context({branchId, through}) → ContextHistory,renderedContext({branchId, through}) → {context, history: HistoryEntry[]},snapshot({context, retainFrom, anchor}) → RecoverySnapshot,streamCheckpoint({branchId, through, retainFrom, batch}) → ProjectionCheckpoint,renderedStream({branchId, through, batch}) → StreamedContext,snapshotFromCheckpoint({checkpoint, anchor}) → RecoverySnapshot.prepare({source: ContextPrepareData, projection?}, cancelled) → ModelRequest,validate({requestId, request}, cancelled) → void. Reuse the prepared projection at the original cutoff.read({through?}, cancelled) → {through, contextWindow, outputTokens, thresholdTokens, estimatedInputTokens, baselineSource}.Acceptance
prepareModelHost,prepareContextHost,contextModelHost,compactionStrategyHost,historyRenderer,contextPreparation,contextUsage.Owner contract · Baseline catalog