Add cache-stable agent capability runtime / 新增缓存稳定的 Agent 能力运行时#6623
Closed
SivanCola wants to merge 1 commit into
Closed
Add cache-stable agent capability runtime / 新增缓存稳定的 Agent 能力运行时#6623SivanCola wants to merge 1 commit into
SivanCola wants to merge 1 commit into
Conversation
Problem: Agent sessions lacked a persisted contract for provider-visible tool, edit, and prompt surfaces. Dynamic capability and MCP registration plus compaction state could drift across resume and invalidate cached prefixes. Root cause: Runtime choices were process-derived, capability discovery exposed dynamic schemas, and compaction and prompt context did not have deterministic session-owned representations. Fix: Introduce persisted runtime contracts, stable capability search and proxy surfaces, a session-context prompt layout, deterministic compaction state, and opt-in Hashline editing. Keep legacy defaults, preserve old-session behavior, and route dynamic MCP tools to execution plus legacy without mutating capability provider schemas. Verification: - ./scripts/cache-guard.sh - go test ./... - go vet ./... - go build ./... - go test -race ./... - desktop: go test, go vet, go build, and go test -race ./...
This was referenced Jul 18, 2026
Collaborator
Author
|
Closing this draft in favor of #6705, which has merged into main-v2 as 43993f5. Adopted in the focused replacement:
Not adopted from this broader draft:
Those broader experiments remain separate future work. If revisited, they should be split into focused PRs, rebased on current main-v2, and preserve the canonical binding, security-identity, cache-stability, and scoped-proxy contracts now provided by #6705. Verification for #6705 completed with the full Go test suite, vet, focused race coverage, cache guard, three-platform CI, CodeQL, and desktop builds all passing. Availability: the focused MCP/skill fix is now on main-v2 and will ship with the next release. |
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
Why
Agent sessions previously derived provider-visible tools and prompt layout from process state. Dynamic MCP registration and non-deterministic compaction could change cached prefixes or alter behavior after resume. This change makes those choices session-owned and persisted while preserving the existing default behavior.
Cache and rollout
Compatibility
Validation
./scripts/cache-guard.shgo test ./...,go vet ./...,go build ./..., andgo test -race ./...go test ./...,go vet ./...,go build ./..., andgo test -race ./...Attribution
Hashline is adapted from the xAI grok-build implementation at baseline commit
c68e39funder Apache-2.0. The package includes the required license, NOTICE, and adapted-source headers.Not included