Skip to content

Commit b6fba18

Browse files
committed
Restore quiet start task failures
1 parent 9fead91 commit b6fba18

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

src/gradientbang/runtime/orchestrator.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,19 +3309,12 @@ async def _send_hello_and_wait(self, agent_name: str) -> BusAgentHelloResponse:
33093309

33103310
async def _handle_start_task_tool(self, params: FunctionCallParams):
33113311
result = await self._handle_start_task(params)
3312-
if not result.get("success"):
3313-
# Surface the failure (e.g. ship_busy) so the LLM can decide its
3314-
# next action — call steer_task with current_task_id, tell the
3315-
# commander to wait, or ask for clarification. Default
3316-
# result_callback properties trigger the follow-up inference;
3317-
# no event injection or forced cycle, mirroring
3318-
# _handle_stop_task_tool's failure path.
3319-
await params.result_callback({"result": result})
3320-
return
33213312
await params.result_callback(
33223313
{"result": result},
33233314
properties=FunctionCallResultProperties(run_llm=False),
33243315
)
3316+
if not result.get("success"):
3317+
return
33253318
task_id = str(result.get("task_id", "")).strip()
33263319
task_type = str(result.get("task_type", "player_ship")).strip() or "player_ship"
33273320
steered = bool(result.get("steered"))

tests/unit/test_voice_agent.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ async def test_start_task_tool_success_queues_started_event(self):
12031203
assert "Task started" in deferred_frame.messages[0]["content"]
12041204

12051205
@pytest.mark.asyncio
1206-
async def test_start_task_tool_failure_surfaces_result_without_event_injection(self):
1206+
async def test_start_task_tool_failure_stays_quiet(self):
12071207
agent = _make_orchestrator()
12081208
result = {
12091209
"success": False,
@@ -1216,11 +1216,10 @@ async def test_start_task_tool_failure_surfaces_result_without_event_injection(s
12161216

12171217
await agent._handle_start_task_tool(params)
12181218

1219-
# Default result_callback (no FunctionCallResultProperties) lets the
1220-
# LLM run on its tool result so it can speak the failure message.
12211219
params.result_callback.assert_awaited_once()
12221220
assert params.result_callback.await_args.args[0] == {"result": result}
1223-
assert "properties" not in params.result_callback.await_args.kwargs
1221+
properties = params.result_callback.await_args.kwargs["properties"]
1222+
assert properties.run_llm is False
12241223
# No task.started/task.steered event_xml on failure — the tool result
12251224
# is the only signal.
12261225
assert len(agent._deferred_frames) == 0

0 commit comments

Comments
 (0)