Derive context from real state.
(context: dict, messages: list)
| 788 | # ── Context ── |
| 789 | |
| 790 | def update_context(context: dict, messages: list) -> dict: |
| 791 | """Derive context from real state.""" |
| 792 | memories = "" |
| 793 | if MEMORY_INDEX.exists(): |
| 794 | content = MEMORY_INDEX.read_text().strip() |
| 795 | if content: |
| 796 | memories = content |
| 797 | return { |
| 798 | "enabled_tools": [t["name"] for t in TOOLS], |
| 799 | "workspace": str(WORKDIR), |
| 800 | "memories": memories, |
| 801 | } |
| 802 | |
| 803 | |
| 804 | # ── Agent Loop ── |
no test coverage detected