Overseas access: www.kdjingpai.com
Bookmark Us

Codex is a program based on codex-1 Codex is a cloud-based software engineering intelligence at the core of ChatGPT, not a simple code generation tool, but an agent capable of autonomously performing complex programming tasks. Rather than being a simple code generation tool, Codex is an agent capable of autonomously performing complex programming tasks, running in a separate, secure cloud sandbox environment, with the ability to preload the user's codebase. It performs tasks such as developing new features, fixing program bugs, and answering questions about the codebase based on natural language instructions. During execution, it not only reads and writes files, but also runs tests, code formatting tools, and iteratively verifies until the task is complete. Upon completion of a task, Codex commits code changes and provides a verifiable record of the operation with terminal logs and test output for review.

 

Function List

  • Perform complete engineering tasks: Perform specific software engineering tasks, such as fixing bugs or implementing new features, in a separate cloud environment based on user instructions.
  • Codebase Interaction: Ability to read, edit and write files directly in a sandboxed environment with a pre-loaded user code base.
  • Execute terminal commands: You can run commands in an isolated environment, such as executing test tools (test runners), code format checker (linters) and the type checker (type checkers).
  • Automated Testing and Remediation: The ability to autonomously run tests to validate changes made, and if the test fails, it will try to repeat the changes until the test passes.
  • Generate code change and review requests: When the task is completed, it submits git commitThe GitHub Pull Request can be generated for manual review with full proof of operation.
  • Follow project specifications: You can read a project's AGENTS.md documentation, learn and follow specific development environment configurations, testing instructions and project standard operating procedures.
  • Codebase Q&A: Users can ask the Codex questions about the currently loaded codebase to get information and explanations.
  • Secure Segregation Enforcement: All tasks are executed in a secure container isolated from the outside network, ensuring the security of user code.

Using Help

Codex is used as a powerful software engineering intelligence that goes beyond traditional code generation. It simulates a remotely collaborating software engineer to whom you delegate tasks and review them when they are completed.

Core Usage Process

  1. Start Codex:
    • exist ChatGPT in the sidebar and select Codex.
    • Follow the guidelines to connect Codex to your GitHub codebase. codex will clone that codebase into a separate cloud-based sandbox environment for operation.
  2. task sth.:
    • Perform programming tasks: If you want it to modify the code, such as fixing a bug or adding a new feature, enter a clear command and click the Code Buttons. A good command should contain enough context, e.g. "Please fix the astropy/astropy A question in the library:Modeling (used form a nominal expression) separability_matrix Unable to calculate nesting correctly CompoundModels of separability."
    • Ask a codebase question: If you just want to understand some aspect of the code base, you can enter your question and click on the Ask Button. For example, "Please explain where is the logic that handles user authentication in this project?"
  3. Monitor and wait:
    • Once the task is started, Codex works autonomously in a sandbox environment in the background. Depending on the complexity of the task, this process can take anywhere from 1 to 30 minutes.
    • You can monitor the progress of Codex execution in real time, and it will show you what operations are being performed, such as reading files, running commands, etc.
  4. Results of the review:
    • After the task is completed, Codex commits the code changes it made in the sandbox environment.
    • It will provide a detailed report with verifiable evidence of its operation, such as logs of terminal commands it executed and test output results. This allows you to trace each step of the task in its entirety, ensuring transparency and correctness of its operation.
    • You can scrutinize the code it modifies, the commit messages, and the test results.
  5. follow-up operation:
    • Requests for modifications:: If the results are not exactly what you expected, you can continue to request changes.
    • Creating Change Requests: If you're happy with the results, you can one-click Codex to create a GitHub Pull Request for your team to review the code.
    • Integration into local: You can also choose to integrate the changes directly into your local development environment.

utilization AGENTS.md File Boot Codex

To make Codex more efficient and accurate, you can create an AGENTS.md file. This file is similar to the README.md, is an instruction manual written specifically for AI intelligences.

  • corresponds English -ity, -ism, -ization: You can tell Codex in a file how to navigate through your codebase, what test instructions to execute, what coding practices the project follows, and what the standard operating procedures look like.
  • Example content:
    # AGENTS.md
    ## 如何运行测试
    要运行完整的测试套件,请在项目根目录执行以下命令:
    `pytest`
    ## 编码规范
    本项目遵循 PEP 8 编码规范。在提交代码前,请确保运行 `flake8 .` 并且没有错误报告。
    ## 关键模块说明
    - `src/core/auth.py`: 负责用户认证和会话管理。
    - `src/api/v1/`: V1版本的所有API端点定义。
    

Just like human developers, Codex performs best when the development environment is well configured, the testing framework is stable, and the documentation is clear.

application scenario

  1. Automate routine maintenance tasks
    Highly repetitive, clearly scoped tasks such as code refactoring, renaming variables or functions, and supplementing existing code with unit tests can be left entirely in the hands of Codex, freeing up developers to focus on more creative endeavors.
  2. Quickly fix known bugs
    When a clear bug report is received, the developer can simply hand off the report as a task to Codex, which automatically locates the problem code, writes a fix patch, runs relevant tests to verify the effectiveness of the fix, and ultimately generates a change request.
  3. Build new functional framework
    When developing a new feature, Codex can be instructed to build the underlying framework code, such as creating new API endpoints, defining the data model, generating sample files for components, and so on, to accelerate the start of the development process.
  4. Enhancing the quality of the code base
    Developers can delegate Codex to perform code quality improvement tasks, such as "format all non-compliant code in the project", "format the code for the user Modules add tests to achieve test coverage of 90% or more", etc.

QA

  1. Is it safe to connect my private code base to Codex?
    Codex executes all tasks in a fully isolated, secure cloud sandboxed container. During task execution, network access is disabled, and intelligences can only access GitHub code repositories and pre-installed dependency packages that you authorize via commands, and have no access to external websites, APIs, or other services.
  2. AGENTS.md Is documentation required?
    Not required, but goes a long way toward improving Codex's performance. Without this file, Codex will try to understand and manipulate your project based on its generalized training knowledge. However, providing a AGENTS.md Documentation, like a project guide for an engineer new to the team, can help it settle in faster and follow your project's specific standards and processes.
  3. What is the difference between Codex and requesting code snippets directly in ChatGPT?
    These are two completely different modes of working. Requesting code directly in ChatGPT is "text generation", where the AI outputs a textual piece of code based on your description. Codex, on the other hand, is a "software engineering intelligence" that operates on your entire codebase in a real (but isolated) development environment, reading and writing files, executing commands, running tests, and committing to version control - a complete automated workflow.
  4. How long does Codex take to perform a task? Why is it slower than a direct question and answer?
    Codex performs an asynchronous delegation task that requires a series of steps such as cloning the code base, analyzing requirements, writing code, running tests iteratively, committing changes, etc. This mimics the workflow of a real developer, and therefore takes more time than Instant Q&A, usually between 1 and 30 minutes. This is similar to delegating a background task to a coworker, which takes a certain amount of time to complete.

 

codex-1 System Cues

# Instructions
- The user will provide a task.
- The task involves working with Git repositories in your current working directory.
- Wait for all terminal commands to be completed (or terminate them) before finishing.

# Git instructions
If completing the user's task requires writing or modifying files.
- Do not create new branches.
- Use git to commit your changes.
- If pre-commit fails, fix issues and retry.
- Check git status to confirm your commit. You must leave your worktree in a clean state.
- Only committed code will be evaluated.
- Do not modify or amend existing commits.

# AGENTS.md specification
- Containers often contain AGENTS.md files. These files can appear anywhere in the container's filesystem. Typical locations include `/`, `~`, and in various places inside of Git repos.
- These files are a way for humans to give you (the agent) instructions or tips for working within the container.
- Some examples might be: coding conventions, info about how code is organized, or instructions for how to run or test code.
- AGENTS.md files may provide instructions about PR messages (messages attached to a GitHub Pull Request produced by the agent, describing These instructions should be respected.) These instructions should be respected.
- Instructions in AGENTS.md files.
- The scope of an AGENTS.md file is the entire directory tree rooted at the folder that contains it.
- For every file you touch in the final patch, you must obey instructions in any AGENTS.md file whose scope includes that file.
- Instructions about code style, structure, naming, etc. apply only to code within the AGENTS.md file's scope, unless the file states otherwise. file states otherwise.
- More-deeply-nested AGENTS.md files take precedence in the case of conflicting instructions.
- Direct system/developer/user instructions (as part of a prompt) take precedence over AGENTS.md instructions.
- AGENTS.md files need not live only in Git repos. For example, you may find one in your home directory.
- If the AGENTS.md includes programmatic checks to verify your work, you MUST run all of them and make a best effort to validate that the checks pass AFTER all code changes have been made.
- This applies even for changes that appear simple, i.e. documentation. You still must run all of the programmatic checks.

# Citations instructions
- If you browsed files or used terminal commands, you must add citations to the final response (not the body of the PR message) where relevant. Citations reference file paths and terminal outputs with the following formats.
1) `[F:†L(-L)?]' '
- File path citations must start with `F:`. `file_path` is the exact file path of the file relative to the root of the repository that contains the relevant text.
- `line_start` is the 1-indexed start line number of the relevant output within that file.
2) `[†L(-L)?]' '
- Where `chunk_id` is the chunk_id of the terminal output, `line_start` and `line_end` are the 1-indexed start and end line numbers of the relevant output within that chunk.
- Line ends are optional, and if not provided, line end is the same as line start, so only 1 line is cited.
- Ensure that the line numbers are correct, and that the cited file paths or terminal outputs are directly relevant to the word or clause before the citation. before the citation.
- Do not cite completely empty lines inside the chunk, only cite lines that have content.
- Only cite from file paths and terminal outputs, DO NOT cite from previous pr diffs and comments, nor cite git hashes as chunk ids.
- Use file path citations that reference any code changes, documentation or files, and use terminal citations only for relevant terminal output.
- Prefer file citations over terminal citations unless the terminal output is directly relevant to the clauses before the citation, i.e. Prefer file citations over terminal citations unless the terminal output is directly relevant to the clauses before the citation, i.e.
- For PR creation tasks, use file citations when referring to code changes in the summary section of your final response, and terminal For PR creation tasks, use file citations when referring to code changes in the summary section of your final response, and terminal citations in the testing section.
- For question-answering tasks, you should only use terminal citations if you need to programmatically verify an answer (i.e. counting Otherwise, use file citations.) Otherwise, use file citations.

0Bookmarked
0kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish