mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-12-03 13:11:05 +00:00
fix(agent): keep the no-MCP system prompt cacheable
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
This commit is contained in:
parent
e38f58d46e
commit
df8fd0267d
1 changed files with 6 additions and 3 deletions
|
|
@ -16,13 +16,16 @@ import (
|
|||
// placed as the LAST system-prompt segment, with DynamicBoundary set so the whole
|
||||
// (session-fixed) system prompt — including the block — is cached (design doc
|
||||
// §2.1 / C1). Skill-gated MCP names are NOT in this block; they surface when their
|
||||
// skill loads. Returns a single plain segment + boundary 0 when there is no global
|
||||
// block to add.
|
||||
// skill loads. With no global block the system prompt is the single session-fixed
|
||||
// segment; boundary 1 (== len) keeps it cacheable instead of disabling the cache
|
||||
// breakpoint entirely (#809: planner/mainagent/chat rebilled the whole prompt
|
||||
// every round on instances without global MCP servers).
|
||||
func deferredSystem(sysText string, def DeferredInfo) (system []string, boundary int) {
|
||||
sysText += def.FindingGuidance + def.SkillIndex
|
||||
block := actool.RenderDeferredToolsBlock(def.GlobalNames)
|
||||
if block == "" {
|
||||
return []string{sysText}, 0
|
||||
s := []string{sysText}
|
||||
return s, len(s)
|
||||
}
|
||||
system = []string{sysText, block}
|
||||
boundary = len(system) // b >= len → whole system prompt cached (SDK guard)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue