# team chat: own chat store, named workers, mention wakes, cancel interrupt (OPE-99)

ChatStore = groups + append-only messages + per-member cursors; agent posts wake mentions only, user posts wake everyone; post_chat(record_on_item) also lands the answer as an item comment.
Leads name workers (the callname is the handle everywhere); worker digests auto-carry the roster; gate checkbox is the user's call; canceling an assigned item now interrupts an in-flight worker.
This commit is contained in:
Rohit C Prasad
2026-08-16 16:22:23 -07:00
committed by Rohit P
parent 844a6510a2
commit cf436d1069
20 changed files with 899 additions and 44 deletions
+21 -1
View File
@@ -750,6 +750,14 @@ def create_app(manager: SessionManager) -> FastAPI:
comment=str(body.get("comment", "")),
)
@app.get("/v1/teams/{team_id}/chat")
def team_chat(team_id: str) -> dict[str, Any]:
return manager.team_chat(team_id)
@app.post("/v1/teams/{team_id}/chat")
def team_chat_post(team_id: str, body: dict) -> dict[str, Any]:
return manager.post_team_chat(team_id, str((body or {}).get("text", "")))
@app.get("/v1/teams/journal")
def teams_journal() -> dict[str, Any]:
return {"cases": manager.journal_overview()}
@@ -1866,10 +1874,17 @@ def create_app(manager: SessionManager) -> FastAPI:
"approved": False,
"feedback": resp.get("feedback") or "the user declined this roster",
}
# The gate checkbox is the USER's call: an explicit enable_chat in the
# response overrides whatever the lead proposed.
enable_chat = bool(
resp["enable_chat"]
if "enable_chat" in resp
else _args.get("enable_chat", False)
)
return manager.create_team(
session_id,
[m for m in members if isinstance(m, dict)],
enable_chat=bool(_args.get("enable_chat", False)),
enable_chat=enable_chat,
)
async def items_approver(_args: dict, tool_call_id=None) -> dict:
@@ -2100,6 +2115,11 @@ def create_app(manager: SessionManager) -> FastAPI:
{
"approved": bool(message.get("approved")),
"feedback": message.get("feedback", ""),
**(
{"enable_chat": bool(message.get("enable_chat"))}
if "enable_chat" in message
else {}
),
}
)
)