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

Function update_context

s12_task_system/code.py:310–321  ·  view source on GitHub ↗

Derive context from real state.

(context: dict, messages: list)

Source from the content-addressed store, hash-verified

308# ── Context ──
309
310def update_context(context: dict, messages: list) -> dict:
311 """Derive context from real state."""
312 memories = ""
313 if MEMORY_INDEX.exists():
314 content = MEMORY_INDEX.read_text().strip()
315 if content:
316 memories = content
317 return {
318 "enabled_tools": list(TOOL_HANDLERS.keys()),
319 "workspace": str(WORKDIR),
320 "memories": memories,
321 }
322
323
324# ── Agent Loop (simplified, focused on task system) ──

Callers 2

agent_loopFunction · 0.70
code.pyFile · 0.70

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected