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.
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.
How work is evaluated
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.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
All Tests Pass
Verify that all provided unit tests pass with the final generated code.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Code Syntax Check
Ensure the final_code is syntactically valid Python.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Test Pass Rate
Percentage of unit tests that passed with the final code. • target: 1 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Efficiency (Iterations)
Number of iterations taken to reach a working solution (lower is better). • target: 2 • range: 1-5
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Code Quality Score
A static analysis score (e.g., using Pylint or Flake8) for the final code. • target: 8 • range: 0-10
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
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.
Reference links and supporting material
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":...
- 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
- Test Pass Rate target: 100%
- 1 public reference case
- 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
- 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.