Derive context from real state.
(context: dict, messages: list)
| 840 | # ── Context ── |
| 841 | |
| 842 | def update_context(context: dict, messages: list) -> dict: |
| 843 | """Derive context from real state.""" |
| 844 | memories = "" |
| 845 | if MEMORY_INDEX.exists(): |
| 846 | content = MEMORY_INDEX.read_text().strip() |
| 847 | if content: |
| 848 | memories = content |
| 849 | return { |
| 850 | "enabled_tools": [t["name"] for t in TOOLS], |
| 851 | "workspace": str(WORKDIR), |
| 852 | "memories": memories, |
| 853 | } |
| 854 | |
| 855 | |
| 856 | # ── Agent Loop ── |
no test coverage detected