Spaces:
Running
Running
deploy(S4): Blender headless pipeline + WebAR client + backend fixes
Browse files
backend/routes/mobile_bridge_routes.py
CHANGED
|
@@ -455,11 +455,44 @@ async def max_autonomy_task(request: Request) -> dict[str, Any]:
|
|
| 455 |
device_name = str(body.get("device_name") or "").strip()[:80]
|
| 456 |
confirmed = bool(body.get("confirmed") or False)
|
| 457 |
context = dict(body.get("context")) if isinstance(body.get("context"), dict) else {}
|
| 458 |
-
#
|
| 459 |
-
#
|
| 460 |
-
#
|
| 461 |
-
#
|
| 462 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
if os.environ.get("SPACE_ID"):
|
| 464 |
context.setdefault("record_only", "true")
|
| 465 |
try:
|
|
|
|
| 455 |
device_name = str(body.get("device_name") or "").strip()[:80]
|
| 456 |
confirmed = bool(body.get("confirmed") or False)
|
| 457 |
context = dict(body.get("context")) if isinstance(body.get("context"), dict) else {}
|
| 458 |
+
# RUN IT ON THE PC IF THERE IS ONE, exactly as /command now does.
|
| 459 |
+
#
|
| 460 |
+
# The comment below was written when the Space genuinely had nowhere to send
|
| 461 |
+
# a task, and it is no longer true: pc_relay_client.py holds an outbound
|
| 462 |
+
# socket from the user's desktop and executes system:execute for real. With
|
| 463 |
+
# record_only forced on the cloud, every Max Autonomy command from the phone
|
| 464 |
+
# came back "Task recorded and synced" — which sounds like success, and is
|
| 465 |
+
# why commands appeared to do nothing while the PC sat connected and idle.
|
| 466 |
+
#
|
| 467 |
+
# Falls through to record+sync when no desktop is listening, which is the
|
| 468 |
+
# honest answer then rather than a claim of control.
|
| 469 |
+
try:
|
| 470 |
+
from backend.ws.agent_ws import ws_manager as _ws_manager
|
| 471 |
+
if task and _ws_manager.pc_connections:
|
| 472 |
+
outcome = await _ws_manager.execute_on_pcs(task, device_name=device_name)
|
| 473 |
+
if outcome.get("delivered"):
|
| 474 |
+
spoken = outcome.get("spoken") or []
|
| 475 |
+
if outcome.get("timed_out"):
|
| 476 |
+
spoken = ["Your PC received the task but did not report back."]
|
| 477 |
+
return {
|
| 478 |
+
"ok": bool(outcome.get("ok")),
|
| 479 |
+
"status": "relayed",
|
| 480 |
+
"task": task,
|
| 481 |
+
"action": "pc_relay",
|
| 482 |
+
"message": (spoken[0] if spoken else "Done on your PC."),
|
| 483 |
+
"requires_confirmation": False,
|
| 484 |
+
"blocked": False,
|
| 485 |
+
"risk": {},
|
| 486 |
+
"plan": [],
|
| 487 |
+
"response": spoken or ["Done on your PC."],
|
| 488 |
+
}
|
| 489 |
+
except Exception as exc:
|
| 490 |
+
log.warning("autonomy PC relay unavailable: %s", exc)
|
| 491 |
+
|
| 492 |
+
# No desktop listening. The headless Space has no PC of its own and does not
|
| 493 |
+
# ship phone/command_runner, so autonomy runs in record+sync mode — logged,
|
| 494 |
+
# risk-assessed and pushed to the AR HUD. Also the safer default: dangerous
|
| 495 |
+
# "confirmed" actions record rather than fire.
|
| 496 |
if os.environ.get("SPACE_ID"):
|
| 497 |
context.setdefault("record_only", "true")
|
| 498 |
try:
|
dist/app-release.apk
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5706a878f23fa24ffa79b70dd7700521315c9bba6ba784df823fbed781579d07
|
| 3 |
+
size 116554783
|