OpenAI shares its engineers’ top 4 tips for code agents

OpenAI shares its engineers’ top 4 tips for code agents
3 min read

OpenAI detailed its methods for getting the most out of Codex and code agents during the DevDay Exchange, its event for developers held in Paris at the end of October. Several team members shared their best practices, four of which are presented below.

Provide a verifiable goal

A code agent is, in essence, an LLM (large language model) operating in a loop. To ensure it completes its task, OpenAI added the /goal command to Codex, which allows it to pursue its mission until it is fully accomplished. The goal is kept outside the agent’s context by the harness, i.e., the program that frames the model, so work continues even after several compactions, these automatic context summaries. “The model therefore decides where it stands relative to the goal. If it thinks it still needs to work, it continues. If it thinks it has made enough progress, it ends its turn, ” explains Pranav Deshpande from OpenAI’s developer marketing team.

For the command to work, the overall goal must be clearly formulated, as well as the success criterion that stops the loop. The example given is as follows: “/goal Migrate the payment module to the new API. The mission is complete when all tests pass and there are no remaining calls to the old API.”

Have multiple teams of agents work

For the most complex problems, OpenAI believes a team of agents may be necessary. It cites the example of Navier-Stokes, presented as solved using multiple teams of agents, each instructed to approach the problem using radically different methods. The advice is to adopt this approach and assign difficult tasks to teams working with “different formulations of the problem.”

These teams must then communicate with each other and share their results to avoid any duplicate work, “because at this scale it can be very costly, in time as well as tokens, ” reminds Pranav Deshpande. When results raise new questions, new teams are created and existing teams are directed towards the most promising lead. However, this method remains reserved for the most challenging problems. For routine work, “it’s better to start with a single agent, giving it a clear task and a way to verify its work, ” details Dominik Kundel from OpenAI’s developer experience team, who advises against assigning roles to agents and prefers to let the orchestrator model organize itself.

On the other hand, multiplying rules for agents can slow down work. With a large number of instructions, agents can get stuck as they try to identify the correct validation chain to follow. “I call this the middle management tax, ” explains Dominik Kundel. He recommends drawing inspiration from effective management, with simple, clear, and few rules, and asking, before adding a rule, what observed problem it fixes. If agents seem stuck, he advises first checking if a rule is the cause and removing it if necessary.

Change your workflows with each new model

The most counterintuitive advice on the list concerns the lifespan of the methods themselves. It’s not about applying these tips once and for all, but re-examining them with each new model release, as the field evolves week by week, even day by day. “All best practices have an expiration date. So don’t get too attached to the workflows you’ve built, ” summarizes Dominik Kundel. He recommends deleting existing workflows (skills, plugins, hooks) with each new model, only reintroducing them if they are genuinely missed in daily work.

OpenAI applies the same logic to Codex: when a new model is released, certain features are often removed because the model no longer needs them and to avoid complicating the agentic loop. Pranav Deshpande concludes: “With AI, you sometimes have to set aside what you thought was effective and start from scratch.”

S’abonner
Notification pour
guest

0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
0
Nous aimerions avoir votre avis, veuillez laisser un commentaire.x