Skip to content

Fix AudioRecorderRecordAudioWithFileName success check (double .m4a extension) - #392

Open
jackliuw1983-afk wants to merge 2 commits into
google-research:mainfrom
jackliuw1983-afk:fix-audio-recorder-double-m4a
Open

jackliuw1983-afk wants to merge 2 commits into
google-research:mainfrom
jackliuw1983-afk:fix-audio-recorder-double-m4a

Conversation

@jackliuw1983-afk

Copy link
Copy Markdown

Problem

AudioRecorderRecordAudioWithFileName can never pass. Its success verifier looks for a file with a double .m4a extension, so it never matches the file the agent actually saves.

In generate_random_params, the file_name param is built with generate_modified_file_name(random.choice(name) + ".m4a"). That helper calls os.path.splitext, inserts the modification before the extension, and reassembles it — so the returned file_name already includes .m4a (e.g. presentation_fGwr.m4a).

The goal template then instructs the agent to save the clip as "presentation_fGwr.m4a" (single extension).

But is_successful does:

file_name = self.params["file_name"]
exists = file_utils.check_file_or_folder_exists(
    file_name + ".m4a", ...   # -> "presentation_fGwr.m4a.m4a"
)

It appends a second .m4a, so it searches for presentation_fGwr.m4a.m4a, which never exists. The verifier therefore returns 0.0 regardless of what the agent does, making the task impossible.

Fix

Check for file_name as-is (it already has the extension):

exists = file_utils.check_file_or_folder_exists(
    file_name, self.create_file_task.data_directory, env.controller
)

Test

Added a regression assertion to audio_recorder_test.py that verifies check_file_or_folder_exists is called with file_name exactly as given (no appended extension).

🤖 Generated with Claude Code

@google-cla

google-cla Bot commented Nov 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

`file_name` already carries the `.m4a` extension because it is produced by
`generate_modified_file_name(random.choice(name) + ".m4a")`, which preserves
the extension via `os.path.splitext`. The verifier then appended another
`.m4a`, so it looked for `<name>.m4a.m4a`, which never exists, and the task
could never pass.
@jackliuw1983-afk
jackliuw1983-afk force-pushed the fix-audio-recorder-double-m4a branch from 89a8d05 to 7541480 Compare November 6, 2026 03:35
The goal text shows the `.m4a` extension, so the agent may type it
literally and make the app save `<name>.m4a.m4a`. Accept both the
as-is spelling and the double-extension spelling when checking whether
the renamed recording exists.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant