/plan: view (default) | set | clear. The plan is injected into the system prompt (the original's /plan).
(self, request_id: object, action: object, text: object)
| 676 | self._reply(request_id, {"ok": True, "language": self._language or ""}) |
| 677 | |
| 678 | def _do_plan(self, request_id: object, action: object, text: object) -> None: |
| 679 | """/plan: view (default) | set <text> | clear. The plan is injected into |
| 680 | the system prompt (the original's /plan).""" |
| 681 | try: |
| 682 | from src.plan import clear_plan, get_plan, set_plan |
| 683 | |
| 684 | act = str(action or "view").strip().lower() |
| 685 | if act == "set": |
| 686 | if not isinstance(text, str) or not text.strip(): |
| 687 | self._reply(request_id, {"ok": False, "error": "usage: /plan <text>"}) |
| 688 | return |
| 689 | set_plan(self.cwd, text) |
| 690 | elif act == "clear": |
| 691 | clear_plan(self.cwd) |
| 692 | if act in ("set", "clear") and self._base_system_prompt is not None: |
| 693 | self.system_prompt = self._compose_with_plan(self._base_system_prompt) |
| 694 | self._reply(request_id, {"ok": True, "plan": get_plan(self.cwd)}) |
| 695 | except Exception as exc: # noqa: BLE001 |
| 696 | logger.exception("[agent-server] plan failed") |
| 697 | self._reply(request_id, {"ok": False, "error": str(exc)}) |
| 698 | |
| 699 | def _do_insights(self, request_id: object) -> None: |
| 700 | """/insights: a model-based analysis of the session (the original's |
no test coverage detected