Extending timeout of "Execute Command" Machines API endpoint

Hi all!

I’m setting up infrastructure for a AI security CTF and wanted to be able to run the Codex CLI on a machine for some of the challenges.

I’d prefer not to set up a REST API on the machine and just execute the codex exec “prompt” command from the /exec endpoint.

The main issue we’re running into though is that I think we’re hitting the 60 second timeout limit sometimes and receive this error:
{“error”:“deadline_exceeded: Post "``http://unix/v1/exec\”:`` net/http: request canceled (Client.Timeout exceeded while awaiting headers)"}

When we try to increase the timeout to above 60 seconds we get this:
{“error”:“timeout must not exceed 60 seconds”}

Is there any way in which to go above this timeout and get around it for long running tasks?

The exec timeout cannot exceed 60s. There’s probably another way to do what you’re aiming for though. We’ve seen users with similar use cases use these approaches, one might work for you:

  • Using fly ssh console --command <xyz> to start up a new ssh session on your machine running the specified command. This runs the command and exits the session once it completes

  • Similarly you can use the fly console command and set a console_command in your fly.toml. This spawns a temporary machine that runs the specified command, and tears it down once complete.