Spaces:
Running
Running
File size: 734 Bytes
25a2c1c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """Qualification-only fixed SDK date fact; never a production entrypoint.
Needle 3.0.1 otherwise adds a wall-clock minute on agent construction. This
matches its documented default date prefix at one preregistered instant, using
the ordinary system parameter; no SDK/model/flags/thresholds are modified.
"""
import re
import gateway
DATE_FACT='date: 2026-10-17 Sat 00:00'
original_build=gateway._build_agent
def fixed_date_build(tools,system):
text=system or ''
if 'date:' not in text and not re.search(r'\d{4}-\d{2}-\d{2}',text) and not text.lstrip().startswith('{'):
text=DATE_FACT+('; '+text if text.strip() else '')
return original_build(tools,text)
gateway._build_agent=fixed_date_build
app=gateway.app
|