MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / update_context

Function update_context

s13_background_tasks/code.py:394–405  ·  view source on GitHub ↗

Derive context from real state.

(context: dict, messages: list)

Source from the content-addressed store, hash-verified

392# ── Context ──
393
394def update_context(context: dict, messages: list) -> dict:
395 """Derive context from real state."""
396 memories = ""
397 if MEMORY_INDEX.exists():
398 content = MEMORY_INDEX.read_text().strip()
399 if content:
400 memories = content
401 return {
402 "enabled_tools": list(TOOL_HANDLERS.keys()),
403 "workspace": str(WORKDIR),
404 "memories": memories,
405 }
406
407
408# ── Agent Loop (simplified, focused on background tasks) ──

Callers 2

agent_loopFunction · 0.70
code.pyFile · 0.70

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected