Python
fix: don't resolve plan/directory items from chat replies, route through resolve_inbox
Shakti Prasad Mohapatra6786c14c14d6
diff --git a/coworker/server/manager.py b/coworker/server/manager.pyindex 5155b6eb..282a19fb 100644--- a/coworker/server/manager.py+++ b/coworker/server/manager.py@@ -6587,6 +6587,13 @@ class SessionManager:item = self.inbox.get(item_id)if item is None:return False+ # Plan and directory items need a structured JSON payload (approved/granted,+ # mode/path/writable) that a bare chat reply cannot provide. The mirrored+ # message already says "(Open the app to respond.)" and buttons_for returns+ # [] for these kinds — honour that by leaving them pending instead of+ # consuming them into a silent refusal.+ if item.kind in {"plan", "directory"}:+ return Falseif item.kind in self._PROTECTED_ITEM_KINDS:if not self._actor_owns_protected_item(item,@@ -6601,7 +6608,10 @@ class SessionManager:getattr(event.source, "thread_id", None),)return False- return self.inbox.resolve(item_id, resolution)+ # Route through resolve_inbox so _durable_resume runs (the button path+ # already goes through resolve_inbox; the reply path was calling+ # inbox.resolve directly, skipping durable resume).+ return self.resolve_inbox(item_id, resolution)return resolve_from_reply(text, _resolve) is not None