Skip to main content
Challenge

Self-Improving GPT-5.3-Codex Agent for Code Generation & Refinement

Build a self-improving agent using the OpenAI Agents SDK, leveraging GPT-5.3-Codex's advanced code generation and reasoning capabilities. Inspired by OpenAI's claim of a model instrumental in creating itself, this challenge focuses on an agent that can autonomously generate code solutions for a given problem, then critically evaluate, test, and iteratively refine its own code to improve correctness, efficiency, and adherence to specified coding standards. The system should manage longer-running tasks, potentially involving multiple stages of generation, testing, and debugging, with robust observability and evaluation.

Special Purpose AgentsHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop a self-improving agent with OpenAI Agents SDK and GPT-5.3-Codex for autonomous code generation, testing, and refinement.

Delivery guide

How work is evaluated

Evaluation

The self-improving agent will be evaluated on its ability to generate correct, efficient, and well-structured code solutions for a variety of coding problems. Key metrics include test pass rate, code quality, and the number of iterations required for successful completion.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
5 scoring checks
Binary
5 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

All Tests Pass

Verify that all provided unit tests pass with the final generated code.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Code Syntax Check

Ensure the final_code is syntactically valid Python.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 3

Test Pass Rate

Percentage of unit tests that passed with the final code. • target: 1 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 4

Efficiency (Iterations)

Number of iterations taken to reach a working solution (lower is better). • target: 2 • range: 1-5

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 5

Code Quality Score

A static analysis score (e.g., using Pylint or Flake8) for the final code. • target: 8 • range: 0-10

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Master the OpenAI Agents SDK for defining agent roles, tools, memory, and orchestrating complex, multi-turn interactions for code development.

  • Implement advanced prompt engineering for GPT-5.3-Codex to generate functional, robust, and idiomatic code for diverse programming problems.

  • Design an iterative self-improvement loop where the agent uses `DeepEval` to evaluate its generated code against unit tests and style guides, then uses that feedback to refine its own prompts or code.

  • Orchestrate the entire code generation, testing, and refinement pipeline using Dagster, ensuring each step (e.g., generate, test, debug, refine) is a managed operation.

  • Integrate Agent Protocol for standardized communication with an external 'Execution Environment' agent that runs generated code and returns test results.

  • Build a Gradio web interface for submitting coding challenges, displaying the agent's generated code, test outputs, and iterative refinements in real-time.

  • Develop strategies for managing persistent context and memory within the OpenAI Agents SDK to enable the agent to 'remember' previous attempts, errors, and successful patterns.

Resources and assets

Reference links and supporting material

Dataset notes

Sample data for 1 tasks

Challenge setup

The self-improving agent will be evaluated on its ability to generate correct, efficient, and well-structured code solutions for a variety of coding problems. Key metrics include test pass rate, code quality, and the...

Challenge input

{"problem_description": "str", "unit_tests": [{"test_case": "str", "expected_output": "str"}], "max_iterations": "int"}

Agent execution

No agent tool is listed for this challenge.

Evaluated output

{"final_code": "str", "test_results": {"pass": "int", "fail": "int"}, "iterations": [{"iteration_num": "int", "generated_code": "str", "feedback":...

Evaluation checks
  • Verify that all provided unit tests pass with the final generated code.
  • Ensure the final_code is syntactically valid Python.
  • Percentage of unit tests that passed with the final code. • target: 1 • range: 0-1
Configured evaluation evidence
  • Test Pass Rate target: 100%
  • 1 public reference case
Configured runtime
  • Python execution harness

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

No tool records are attached.

Evaluation contract

  • All Tests Pass · Weight 1
  • Code Syntax Check · Weight 1
  • Test Pass Rate · Weight 1
  • Efficiency (Iterations) · Weight 1
  • Code Quality Score · Weight 1

Metrics

  • Test Pass Rate · Target 1
  • Efficiency (Iterations) · Target 2
  • Code Quality Score · Target 8

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: {"problem_description": "str", "unit_tests": [{"test_case": "str", "expected_output": "str"}], "max_iterations": "int"}

    Output: {"final_code": "str", "test_results": {"pass": "int", "fail": "int"}, "iterations": [{"iteration_num": "int", "generated_code": "str", "feedback": "str"}]}

    Execution harness: Python

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Self-Improving GPT-5.3-Codex Agent for Code Generation & Refinement