Agentic Code Generation & Refinement
This challenge tasks you with building a robust AI agent using the OpenAI Agents SDK. Your agent will specialize in generating, debugging, and refining code snippets based on natural language prompts. It will simulate interaction with an IDE environment, leveraging external tools for code linting, static analysis, and version control operations. A key aspect is implementing MCP principles for structured tool integration, allowing the agent to dynamically select and utilize code-related services with clear input/output schemas. This project emphasizes advanced agentic design, tool orchestration, and the practical application of AI in developer workflows to enhance productivity and code quality.
What you are building
The core problem, expected build, and operating context for this challenge.
Develop an OpenAI Agents SDK-based system to generate, debug, and refactor code using MCP for structured tool integration.
How work is evaluated
The evaluation will assess the agent's ability to generate functional, high-quality code, its error-handling capabilities, and the correctness of its tool interactions using Trulens-Eval for tracing and metrics.
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.
CodeFunctionalityTest
The 'final_code' must pass a set of predefined unit tests for the given prompt.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
ToolUsageCorrectness
Trulens-Eval trace must show correct and relevant tool calls (e.g., linter, static analyzer) in refinement steps.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
CodeQualityScore
Score from SonarQube (or simulated linter) for the final code, higher is better. • target: 85 • range: 0-100
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
RefinementIterations
Number of iterations taken to achieve correct code, 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.
What you should walk away with
Master the OpenAI Agents SDK for defining agent behavior, tools, and multi-turn interactions.
Implement MCP-enabled tool integration with a simulated IDE interface for dynamic function calling to services like SonarQube or a custom linter.
Build a pipeline for code generation using advanced models like GPT-4o, focusing on contextual understanding and error handling.
Design and integrate a code debugging and refinement loop, allowing the agent to identify and fix issues iteratively.
Utilize Trulens-Eval for comprehensive observability and evaluation of agent reasoning paths and generated code quality.
Integrate with a mock GitHub Actions environment for simulating automated testing and deployment of generated code.
Understand and apply best practices for prompt engineering in code generation tasks to improve output accuracy and reduce hallucinations.
Reference links and supporting material
Sample data for 1 tasks
Challenge setup
The evaluation will assess the agent's ability to generate functional, high-quality code, its error-handling capabilities, and the correctness of its tool interactions using Trulens-Eval for tracing and metrics.
Challenge input
{'prompt': 'string', 'initial_code': 'string'}
Agent execution
No agent tool is listed for this challenge.
Evaluated output
{'final_code': 'string', 'iterations': 'integer', 'trace_id': 'string'}
- The 'final_code' must pass a set of predefined unit tests for the given prompt.
- Trulens-Eval trace must show correct and relevant tool calls (e.g., linter, static analyzer) in refinement...
- Score from SonarQube (or simulated linter) for the final code, higher is better. • target: 85 • range: 0-100
- CodeQualityScore target: 85
- 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
- CodeFunctionalityTest · Weight 1
- ToolUsageCorrectness · Weight 1
- CodeQualityScore · Weight 1
- RefinementIterations · Weight 1
Metrics
- CodeQualityScore · Target 85
- RefinementIterations · Target 2
Reference cases
- 1 public reference case
Workflow tasks
- Task 1
Input: {'prompt': 'string', 'initial_code': 'string'}
Output: {'final_code': 'string', 'iterations': 'integer', 'trace_id': 'string'}
Execution harness: Python
Recipe freeze marker
No recipe freeze time is recorded.