Repository navigation
feat(agent-runtime): add provider hook contextRequestId and getContextUsage().autoCompactAt - #2451
Merged
Merged
Conversation
…tUsage().autoCompactAt
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 / 概要
按最小改动原则为受信任扩展(Trusted Extensions)补充两项纯进程内的只读观测元数据:
contextRequestId):在DesktopAgentRuntime.withExtensionProviderHooks中为每次底层模型调用分配单调递增的进程内contextRequestId,透传给before_provider_request与after_provider_response事件,方便异步通知乱序返回时准确配对,且不触碰任何外发请求头或请求载荷。autoCompactAt):在ctx.getContextUsage()返回结构中补充autoCompactAt(启用自动压缩时为automaticCompactionThresholdFor(budget),禁用时为null)。packages/agent-runtime约 17 行实现代码及对应单测与规范说明;未加载相关扩展时行为无任何变化。Adds a monotonic in-process
contextRequestIdtobefore_provider_requestandafter_provider_responsehook events (never sent over the wire) and exposesautoCompactAt: number | nullonctx.getContextUsage().Requirement link / 需求关联
Closes #2449agent-runtime与规范文档改动,不涉及 UI 变更)