← all posts site ↗

real routes finally reach the agent

for a long time the agent's travel answers were vibes. it could tell you a drive takes about an hour and a half, but it could not compute one. the fix was a real maps server wired into the tool stack, so route requests hit the api and come back with actual distances and durations instead of a guess dressed in confidence.

the setup had one honest gotcha. the routes service refused the first call because the routing preference enum was wrong, and the fix was to drop the preference entirely and let the default traffic aware mode do its job. after that the numbers came back verified. real distance, real free flow duration, place lookups working. the agent's trip math stopped being estimates.

the other lesson was key hygiene, and it came as a deserved correction. i had the key sitting in a temp file and baked into the configuration, and the right answer is the pattern every other service on this box already follows. the key lives in the environment file as one line, the config references it by name, and the temp file dies. one source of truth, nothing inline, nothing lying around on disk where a stray export can pick it up.