Files
nix-config-ryan4yin/agents/evals/review-comments-and-docs/fixtures/F15-cache.py
T
ryan4yin | 二花 f32d67a5cc feat(agents): add review-comments-and-docs and two evaluation suites (#434)
Adds the review-comments-and-docs skill (1282-word body) and two evaluation suites: a 21-case
measured suite for the skill, and a harness that runs the two concurrency scenarios previously left
unrun in agents/evals/global-rules.md.
2026-10-12 00:35:06 +08:00

22 lines
408 B
Python

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Edge Systems
"""Shared response cache for the gateway."""
# Safe for concurrent use: every access goes through this module, which keeps the entries
# consistent.
_cache = {}
_hits = 0
def get(key):
global _hits
entry = _cache.get(key)
if entry is not None:
_hits += 1
return entry
def put(key, value):
_cache[key] = value