search challenge: triangle marker on a crate's back face (rendered in vision, in digest), report tool with distance verification, smooth turn(duration), --free/--search autonomous modes, look_at crates; verified with gpt-5.6-luna
This commit is contained in:
+60
-13
@@ -141,16 +141,30 @@ async def chat_loop(client: AICCClient, manifest, args: argparse.Namespace) -> i
|
||||
async def mission_runner(goal_text: str) -> None:
|
||||
from testbed.llm_agent import run_llm_agent_loop
|
||||
|
||||
controller.messages.append(
|
||||
{
|
||||
"role": "user",
|
||||
"content": (
|
||||
f"MISSION (set by the user): {goal_text}. "
|
||||
"Keep calling tools and do not stop until the goal is achieved. "
|
||||
"Report only when done."
|
||||
),
|
||||
}
|
||||
)
|
||||
if args.search:
|
||||
from testbed.llm_agent import SEARCH_MISSION
|
||||
|
||||
controller.messages = [
|
||||
{"role": "system", "content": SEARCH_MISSION},
|
||||
{
|
||||
"role": "user",
|
||||
"content": (
|
||||
f"MISSION: {goal_text}. "
|
||||
"Keep exploring with tools until the triangle is found and reported."
|
||||
),
|
||||
},
|
||||
]
|
||||
else:
|
||||
controller.messages.append(
|
||||
{
|
||||
"role": "user",
|
||||
"content": (
|
||||
f"MISSION (set by the user): {goal_text}. "
|
||||
"Keep calling tools and do not stop until the goal is achieved. "
|
||||
"Report only when done."
|
||||
),
|
||||
}
|
||||
)
|
||||
saver = asyncio.create_task(map_saver())
|
||||
try:
|
||||
for attempt in range(1, args.mission_retries + 2):
|
||||
@@ -165,12 +179,27 @@ async def chat_loop(client: AICCClient, manifest, args: argparse.Namespace) -> i
|
||||
nudge_limit=args.mission_nudges,
|
||||
look_every=args.look_every,
|
||||
cruise=args.cruise,
|
||||
autonomous=args.free or args.search,
|
||||
is_success=(
|
||||
(
|
||||
lambda turn: any(
|
||||
c.name == "report"
|
||||
and c.ok
|
||||
and isinstance(c.output, dict)
|
||||
and c.output.get("verified")
|
||||
for c in turn.calls
|
||||
)
|
||||
)
|
||||
if args.search
|
||||
else None
|
||||
),
|
||||
)
|
||||
except RuntimeError as exc:
|
||||
print(f" [mission] LLM error: {exc}")
|
||||
break
|
||||
save_map()
|
||||
if summary["interacted"]:
|
||||
done = summary.get("success") if args.search else summary["interacted"]
|
||||
if done:
|
||||
print(f"\n[mission] DONE: {summary['result']}")
|
||||
return
|
||||
print(
|
||||
@@ -226,7 +255,12 @@ async def chat_loop(client: AICCClient, manifest, args: argparse.Namespace) -> i
|
||||
print(" (no mission running)")
|
||||
await cmd_state()
|
||||
|
||||
if args.mission:
|
||||
if args.mission or args.search:
|
||||
if args.search:
|
||||
mission_goal = (
|
||||
"explore the room, find the orange triangle painted on the back "
|
||||
"of one of the crates, and report it"
|
||||
)
|
||||
start_mission()
|
||||
|
||||
while True:
|
||||
@@ -428,6 +462,17 @@ def main() -> int:
|
||||
action="store_true",
|
||||
help="start an autonomous mission on connect: reach and activate the beacon",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--search",
|
||||
action="store_true",
|
||||
help="search challenge: explore the room and find the orange triangle "
|
||||
"on the back of a crate, then report it (autonomous mode, fewer guardrails)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--free",
|
||||
action="store_true",
|
||||
help="fewer restrictions: no re-aim corrections or collision hints; the model plans freely",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--mission-steps",
|
||||
type=int,
|
||||
@@ -479,7 +524,9 @@ def main() -> int:
|
||||
model=args.model,
|
||||
)
|
||||
if args.provider:
|
||||
print(f"[chat] provider: {args.provider} -> {args.base_url} model: {args.model}")
|
||||
print(
|
||||
f"[chat] provider: {args.provider} -> {args.base_url} model: {args.model}"
|
||||
)
|
||||
except ValueError as exc:
|
||||
print(f"[chat] {exc}")
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user