sam 1208458aba fix(gateway): enforce per-scope memory quota and escape-aware byte cap
Greptile review on #887 (slice 3, merged):

- BuiltinEngine.Query bounds Limit across the whole result, not per scope
  it is given. renderMemory passed one Limit for all of subject.Scopes()
  combined, so an early scope (agent-user, queried first) could exhaust
  the whole budget and starve later, wider scopes. Now queries each scope
  separately, each capped at memoryRecordsPerScope.
- memoryBlockByteCap was checked against each line's raw size, but
  BuildSystemPrompt's {{xml .Memory}} escapes &/</> afterward, expanding
  a byte up to fivefold. The cap is now measured against the escaped
  size (escapeXML, extracted from prompt.go's template func) while the
  block itself still accumulates raw lines, since the template escapes
  once on render -- escaping here too would double-escape it.
2026-09-19 11:46:05 +10:00
S
Description
Archie connects events from your systems to agents that can investigate, reason, and act. Define what an event means, map its data into a workflow, and give that workflow an agent equipped for the job: its own execution environment, tools, and identity.
https://archie.catlow.cloud
Apache-2.0
133 MiB
0 Stars 1 Watchers 0 Forks
2026-11-10 10:01:23 +00:00
Languages
Go 76.7%
Vue 13.1%
TypeScript 7.8%
JavaScript 1.2%
Shell 0.6%
Other 0.4%