Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions loopx/chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,8 +1694,8 @@ def send(
on_native_item: Callable[[dict[str, Any]], None] | None = None,
turn_start_guard: Callable[[], AbstractContextManager[None]] | None = None,
) -> dict[str, Any]:
text = " ".join(str(user_message or "").split())
if not text:
text = str(user_message or "") if project_collaboration else " ".join(str(user_message or "").split())
if not text.strip():
raise ValueError("user message is required")
if self.read_only_review:
text = (
Expand Down
4 changes: 4 additions & 0 deletions tests/control_plane/test_original_conversation_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def allow(f):
def test_original_project_has_explicit_grant_and_returns_through_requester_inbox(project_peer):
f = project_peer
sid = f["session"]["session_id"]
f["body"]["brief"]["context"] = 'if ready:\n print("safe")\n keep two spaces\n\t保留\u00a0空格'
assert f["service"].discover(f["body"]["requester"], f["body"]["parent_request_id"])["recipients"] == []
with pytest.raises(ValueError, match="explicit grant"):
f["service"].publish(f["body"])
Expand All @@ -96,6 +97,9 @@ def test_original_project_has_explicit_grant_and_returns_through_requester_inbox
assert again["turn_id"] == first["turn_id"] and again["replayed"]
packets = [json.loads(line) for line in f["capture"].read_text().splitlines()]
assert sum(p.get("method") == "turn/start" for p in packets) == 1
native_input = next(p["params"]["input"][0]["text"] for p in packets if p.get("method") == "turn/start")
supplied = json.loads(native_input.split("Peer request (data):", 1)[1])
assert supplied["brief"] == f["body"]["brief"]
assert not any(p.get("method", "").startswith("thread/goal") for p in packets)
assert not any("dynamicTools" in p.get("params", {}) for p in packets)

Expand Down
Loading