Codex CLI(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) is our cross-platform local software agent, designed to produce high-quality, reliable software changes while operating safely and efficiently on your machine. We’ve learned a tremendous amount about how to build a world-class software agent since we first launched the CLI in April. To unpack those insights, this is the first post in an ongoing series where we’ll explore various aspects of how Codex works, as well as hard-earned lessons. (For an even more granular view on how the Codex CLI is built, check out our open source repository at https://github.com/openai/codex(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်). Many of the finer details of our design decisions are memorialized in GitHub issues and pull requests if you’d like to learn more.)
To kick off, we’ll focus on the agent loop, which is the core logic in Codex CLI that is responsible for orchestrating the interaction between the user, the model, and the tools the model invokes to perform meaningful software work. We hope this post gives you a good view into the role our agent (or “harness”) plays in making use of an LLM.
Before we dive in, a quick note on terminology: at OpenAI, “Codex” encompasses a suite of software agent offerings, including Codex CLI, Codex Cloud, and the Codex VS Code extension. This post focuses on the Codex harness, which provides the core agent loop and execution logic that underlies all Codex experiences and is surfaced through the Codex CLI. For ease here, we’ll use the terms “Codex” and “Codex CLI” interchangeably.
At the heart of every AI agent is something called “the agent loop.” A simplified illustration of the agent loop looks like this:
To start, the agent takes input from the user to include in the set of textual instructions it prepares for the model known as a prompt.
The next step is to query the model by sending it our instructions and asking it to generate a response, a process known as inference. During inference, the textual prompt is first translated into a sequence of input tokens(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)—integers that index into the model’s vocabulary. These tokens are then used to sample the model, producing a new sequence of output tokens.
The output tokens are translated back into text, which becomes the model’s response. Because tokens are produced incrementally, this translation can happen as the model runs, which is why many LLM-based applications display streaming output. In practice, inference is usually encapsulated behind an API that operates on text, abstracting away the details of tokenization.
As the result of the inference step, the model either (1) produces a final response to the user’s original input, or (2) requests a tool call that the agent is expected to perform (e.g., “run ls and report the output”). In the case of (2), the agent executes the tool call and appends its output to the original prompt. This output is used to generate a new input that’s used to re-query the model; the agent can then take this new information into account and try again.
This process repeats until the model stops emitting tool calls and instead produces a message for the user (referred to as an assistant message in OpenAI models). In many cases, this message directly answers the user’s original request, but it may also be a follow-up question for the user.
Because the agent can execute tool calls that modify the local environment, its “output” is not limited to the assistant message. In many cases, the primary output of a software agent is the code it writes or edits on your machine. Nevertheless, each turn always ends with an assistant message—such as “I added the architecture.md you asked for”—which signals a termination state in the agent loop. From the agent’s perspective, its work is complete and control returns to the user.
The journey from user input to agent response shown in the diagram is referred to as one turn of a conversation (a thread in Codex). Though this conversation turn can include many iterations between the model inference and tool calls. Every time you send a new message to an existing conversation, the conversation history is included as part of the prompt for the new turn, which includes the messages and tool calls from previous turns:
This means that as the conversation grows, so does the length of the prompt used to sample the model. This length matters because every model has a context window, which is the maximum number of tokens it can use for one inference call. Note this window includes both input and output tokens. As you might imagine, an agent could decide to make hundreds of tool calls in a single turn, potentially exhausting the context window. For this reason, context window management is one of the agent’s many responsibilities. Now, let’s dive in to see how Codex runs the agent loop.
The Codex CLI sends HTTP requests to the Responses API(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) to run model inference. We’ll examine how information flows through Codex, which uses the Responses API to drive the agent loop.
The Responses API endpoint that the Codex CLI uses is configurable(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်), so it can be used with any endpoint that implements the Responses API(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်):
- When using ChatGPT login(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) with the Codex CLI, it uses
https://chatgpt.com/backend-api/codex/responsesas the endpoint - When using API-key authentication(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) with OpenAI hosted models, it uses
https://api.openai.com/v1/responsesas the endpoint - When running Codex CLI with
--ossto use gpt-oss with ollama 0.13.4+(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) or LM Studio 0.3.39+(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်), it defaults tohttp://localhost:11434/v1/responsesrunning locally on your computer - Codex CLI can be used with the Responses API hosted by a cloud provider such as Azure
Let’s explore how Codex creates the prompt for the first inference call in a conversation.
As an end user, you don’t specify the prompt used to sample the model verbatim when you query the Responses API. Instead, you specify various input types as part of your query, and the Responses API server decides how to structure this information into a prompt that the model is designed to consume. You can think of the prompt as a “list of items”; this section will explain how your query gets transformed into that list.
In the initial prompt, every item in the list is associated with a role. The role indicates how much weight the associated content should have and is one of the following values (in decreasing order of priority): system, developer, user, assistant.
The Responses API(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) takes a JSON payload with many parameters. We’ll focus on these three:
instructions(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်): system (or developer) message inserted into the model’s contexttools(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်): a list of tools the model may call while generating a responseinput(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်): a list of text, image, or file inputs to the model
In Codex, the instructions field is read from the model_instructions_file(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) in ~/.codex/config.toml, if specified; otherwise, the base_instructions associated with a model(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) are used. Model-specific instructions live in the Codex repo and are bundled into the CLI (e.g., gpt-5.2-codex_prompt.md(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)).
The tools field is a list of tool definitions that conform to a schema defined by the Responses API. For Codex, this includes tools that are provided by the Codex CLI, tools that are provided by the Responses API that should be made available to Codex, as well as tools provided by the user, usually via MCP servers:
Finally, the input field of the JSON payload is a list of items. Codex inserts the following items(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) into the input before adding the user message:
1. A message with role=developer that describes the sandbox that applies only to the Codex-provided shell tool defined in the tools section. That is, other tools, such as those provided from MCP servers, are not sandboxed by Codex and are responsible for enforcing their own guardrails.
The message is built from a template where the key pieces of content come from snippets of Markdown bundled into the Codex CLI, such as workspace_write.md(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) and on_request.md(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်):
2. (Optional) A message with role=developer whose contents are the developer_instructions value read from the user’s config.toml file.
3. (Optional) A message with role=user whose contents are the “user instructions,” which are not sourced from a single file but are aggregated across multiple sources(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်). In general, more specific instructions appear later:
- Contents of
AGENTS.override.mdandAGENTS.mdin$CODEX_HOME - Subject to a limit (32 KiB, by default), look in each folder from the Git/project root of the
cwd(if it it exists) up to thecwditself: add the contents of any ofAGENTS.override.md,AGENTS.md, or any filename specified byproject_doc_fallback_filenames in config.toml - If any skills(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) have been configured:
- a short preamble about skills
- the skill metadata(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) for each skill
- a section on how to use skills(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)
4. A message with role=user that describes the local environment in which the agent is currently operating. This specifies the current working directory and the user’s shell(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်):
အထက်ဖော်ပြပါ computation အားလုံးကို လုပ်ဆောင်ပြီး input ကို initialize လုပ်ပြီးနောက် Codex သည် conversation ကို စတင်ရန် user message ကို ပူးတွဲထည့်သွင်းသည်။
ယခင်ဥပမာများတွင် message တစ်ခုစီ၏ content ကို အဓိကထားခဲ့သော်လည်း input ၏ element တစ်ခုစီသည် type, role(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) နှင့် content ပါဝင်သော JSON object တစ်ခုဖြစ်သည်ကို သတိပြုပါ -
Codex သည် Responses API သို့ ပို့ရန် JSON payload အပြည့်အစုံကို တည်ဆောက်ပြီးသည်နှင့် ~/.codex/config.toml တွင် Responses API endpoint ကို မည်သို့ configure လုပ်ထားသည်အပေါ် မူတည်သော Authorization header ဖြင့် HTTP POST request ကို ပြုလုပ်သည် (သတ်မှတ်ထားပါက အပို HTTP headers နှင့် query parameters များကိုလည်း ထည့်သွင်းသည်)။
OpenAI Responses API server သည် request ကို လက်ခံရရှိသောအခါ JSON ကို အသုံးပြု၍ မော်ဒယ်အတွက် prompt ကို အောက်ပါအတိုင်း derive လုပ်သည် (သေချာစေရန် ပြောရလျှင် Responses API ၏ custom implementation တစ်ခုသည် ကွဲပြားသော ရွေးချယ်မှုတစ်ခု ပြုလုပ်နိုင်သည်) -
မြင်နိုင်သကဲ့သို့ prompt ၏ ပထမ items သုံးခု၏ အစီအစဉ်ကို client က မဟုတ်ဘဲ server က သတ်မှတ်သည်။ သို့သော် ထို items သုံးခုအနက် system message ၏ content ကိုသာ server က ထိန်းချုပ်ထားပြီး tools နှင့် instructions ကိုတော့ client က သတ်မှတ်သည်။ ထို့နောက် JSON payload ထဲရှိ input ကို ဆက်ထည့်ကာ prompt ကို ပြီးပြည့်စုံစေသည်။
ယခု ကျွန်ုပ်တို့တွင် prompt ရရှိပြီးဖြစ်သောကြောင့် မော်ဒယ်ကို sample ယူရန် အဆင်သင့်ဖြစ်ပါပြီ။
Responses API သို့ ဤ HTTP request သည် Codex အတွင်း conversation တစ်ခု၏ ပထမ “turn” ကို စတင်ပေးသည်။ server သည် Server-Sent Events (SSE(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)) stream ဖြင့် တုံ့ပြန်သည်။ event တစ်ခုစီ၏ data သည် "type" ဖြင့် စတင်သော JSON payload ဖြစ်ပြီး ၎င်းမှာ ဤကဲ့သို့ ဖြစ်နိုင်သည် (event အပြည့်အစုံစာရင်းကို ကျွန်ုပ်တို့၏ API docs(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) တွင် ကြည့်နိုင်သည်) -
Codex သည် event stream ကို စားသုံးပြီး(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) client က အသုံးပြုနိုင်သော internal event objects များအဖြစ် ပြန်လည်ထုတ်ဝေသည်။ response.output_text.delta ကဲ့သို့ event များကို UI တွင် streaming ပံ့ပိုးရန် အသုံးပြုသော်လည်း response.output_item.added ကဲ့သို့ event များကို နောက်ဆက်တွဲ Responses API calls များအတွက် input ထဲသို့ ပူးတွဲထည့်သွင်းသော objects များအဖြစ် ပြောင်းလဲသည်။
Responses API သို့ ပထမ request တွင် response.output_item.done events နှစ်ခု ပါဝင်သည်ဟု ယူဆကြပါစို့ - တစ်ခုမှာ type=reasoning နှင့် တစ်ခုမှာ type=function_call ဖြစ်သည်။ tool call ၏ response နှင့်အတူ မော်ဒယ်ကို ပြန်မေးမြန်းသောအခါ ဤ events များကို JSON ၏ input field ထဲတွင် ကိုယ်စားပြုရမည် -
နောက်ဆက်တွဲ query ၏ အစိတ်အပိုင်းအဖြစ် မော်ဒယ်ကို sample ယူရန် အသုံးပြုသော resulting prompt သည် ဤကဲ့သို့ ဖြစ်မည် -
အထူးသဖြင့် prompt အဟောင်းသည် prompt အသစ်၏ တိတိကျကျ prefix ဖြစ်သည်ကို သတိပြုပါ။ ၎င်းမှာ ရည်ရွယ်ထားခြင်းဖြစ်ပြီး အဘယ်ကြောင့်ဆိုသော် ထိုသို့ဖြစ်ခြင်းက prompt caching ကို အသုံးချနိုင်စေသဖြင့် နောက်ဆက်တွဲ request များကို ပိုမိုထိရောက်စေသောကြောင့် ဖြစ်သည် (performance အပိုင်းတွင် ဆက်လက်ဆွေးနွေးပါမည်)။
အေးဂျင့် loop ၏ ပထမပုံကို ပြန်ကြည့်လျှင် inference နှင့် tool calling အကြား iteration အများအပြား ရှိနိုင်သည်ကို မြင်ရပါသည်။ turn ၏ အဆုံးကို ဖော်ပြသည့် assistant message တစ်ခုကို နောက်ဆုံးလက်ခံရသည်အထိ prompt သည် ဆက်လက်ကြီးထွားလာနိုင်ပါသည် -
Codex CLI တွင် assistant message ကို အသုံးပြုသူထံ တင်ပြပြီး conversation ကို ဆက်လက်လုပ်ဆောင်ရန် ယခု အသုံးပြုသူ၏ “turn” ဖြစ်ကြောင်း composer ကို focus လုပ်ပေးပါသည်။ အသုံးပြုသူက တုံ့ပြန်ပါက ယခင် turn မှ assistant message နှင့် အသုံးပြုသူ၏ message အသစ် နှစ်ခုလုံးကို turn အသစ် စတင်ရန် Responses API request ၏ input ထဲသို့ ပူးတွဲထည့်သွင်းရမည် -
တစ်ဖန် conversation ကို ဆက်လက်လုပ်ဆောင်နေသောကြောင့် Responses API သို့ ပို့သော input ၏ အရှည်သည် ဆက်လက်တိုးလာနေပါသည် -
ဤအဆက်မပြတ်ကြီးထွားလာသော prompt သည် performance အတွက် ဘာကို ဆိုလိုသလဲဆိုတာ လေ့လာကြပါစို့။
“စကားပြောဆိုမှုတစ်လျှောက် Responses API သို့ ပို့သော JSON ပမာဏအရ agent loop က quadratic မဟုတ်ဘူးလား” ဟု သင်မေးနိုင်ပါသည်။ ထိုမေးခွန်းသည် မှန်ပါသည်။ ဤပြဿနာကို လျော့ပါးစေရန် Responses API တွင် optional previous_response_id(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) parameter ကို ပံ့ပိုးပေးသော်လည်း Codex သည် လက်ရှိတွင် ၎င်းကို အသုံးမပြုပါ။ အဓိကအကြောင်းရင်းမှာ request များကို အပြည့်အဝ stateless ထားလိုခြင်းနှင့် Zero Data Retention (ZDR) configuration များကို ပံ့ပိုးလိုခြင်းတို့ ဖြစ်သည်။
previous_response_id ကို ရှောင်ခြင်းက Responses API provider အတွက် လုပ်ငန်းစဉ်များကို ရိုးရှင်းစေပါသည်၊ အဘယ်ကြောင့်ဆိုသော် request တိုင်းသည် stateless ဖြစ်ကြောင်း သေချာစေသောကြောင့် ဖြစ်သည်။ ၎င်းကြောင့် Zero Data Retention (ZDR)(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ကို ရွေးချယ်ထားသော customer များကို ပံ့ပိုးရန်လည်း လွယ်ကူစေသည်၊ အဘယ်ကြောင့်ဆိုသော် previous_response_id ကို ပံ့ပိုးရန် လိုအပ်သော data ကို သိမ်းဆည်းရခြင်းသည် ZDR နှင့် ဆန့်ကျင်နေသောကြောင့် ဖြစ်သည်။ ZDR customer များသည် ယခင် turn များမှ proprietary reasoning messages များ၏ အကျိုးကျေးဇူးကို မဆုံးရှုံးကြပါ၊ အကြောင်းမှာ ဆက်နွယ်နေသော encrypted_content ကို server ပေါ်တွင် decrypt လုပ်နိုင်သောကြောင့် ဖြစ်သည်။ (OpenAI သည် ZDR customer ၏ decryption key ကိုသာ သိမ်းထားပြီး ၎င်းတို့၏ data ကိုတော့ မသိမ်းပါ။) ZDR ကို ပံ့ပိုးရန် Codex တွင် ပြုလုပ်ခဲ့သော သက်ဆိုင်ရာ ပြောင်းလဲမှုများအတွက် PRs #642(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) နှင့် #1641(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ကို ကြည့်ပါ။
ယေဘုယျအားဖြင့် မော်ဒယ် sampling ၏ cost သည် network traffic ၏ cost ထက် ပိုကြီးသောကြောင့် sampling ကို ထိရောက်အောင်လုပ်ခြင်းသည် ကျွန်ုပ်တို့၏ အဓိက ရည်မှန်းချက်ဖြစ်သည်။ ထို့ကြောင့် prompt caching သည် အလွန်အရေးကြီးပြီး ယခင် inference call မှ computation ကို ပြန်လည်အသုံးပြုနိုင်စေသည်။ cache hit ရရှိသောအခါ မော်ဒယ် sampling သည် quadratic မဟုတ်ဘဲ linear ဖြစ်လာသည်။ ကျွန်ုပ်တို့၏ prompt caching (ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)documentation တွင် ယင်းကို ပိုမိုအသေးစိတ် ရှင်းပြထားပါသည် -
prompt အတွင်း တိတိကျကျ prefix တူညီမှု ရှိသည့်အခါမှသာ cache hit ဖြစ်နိုင်သည်။ caching ၏ အကျိုးကျေးဇူးများ ရရှိစေရန် instructions နှင့် examples ကဲ့သို့ static content များကို prompt ၏ အစတွင်ထားပြီး user-specific information ကဲ့သို့ variable content များကို အဆုံးတွင် ထားပါ။ ၎င်းသည် images နှင့် tools များအပေါ်လည်း သက်ဆိုင်ပြီး request များအကြား ၎င်းတို့သည် တူညီနေရမည်။
ဤအချက်ကို စိတ်ထဲထားကာ Codex တွင် “cache miss” ဖြစ်စေနိုင်သော operation အမျိုးအစားများကို စဉ်းစားကြပါစို့ -
- conversation အလယ်တွင် မော်ဒယ်အတွက် ရရှိနိုင်သော
toolsများကို ပြောင်းလဲခြင်း။ - Responses API request ၏ target ဖြစ်သော
modelကို ပြောင်းလဲခြင်း (လက်တွေ့တွင် ၎င်းက မူလ prompt ၏ တတိယ item ကို ပြောင်းလဲစေသည်၊ အဘယ်ကြောင့်ဆိုသော် ၎င်းတွင် model-specific instructions ပါဝင်သောကြောင့် ဖြစ်သည်)။ - sandbox configuration, approval mode သို့မဟုတ် current working directory ကို ပြောင်းလဲခြင်း။
prompt caching ကို ထိခိုက်စေနိုင်သော Codex CLI features အသစ်များကို မိတ်ဆက်ရာတွင် Codex team သည် အထူးသတိထားရပါမည်။ ဥပမာတစ်ခုအနေဖြင့် MCP tools အတွက် ကျွန်ုပ်တို့၏ ကနဦးပံ့ပိုးမှုတွင် tools များကို အစဉ်တကျ မတူညီစွာ enumerate လုပ်မိသည့် bug တစ်ခု(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ရှိခဲ့ပြီး cache misses ဖြစ်စေခဲ့သည်။ MCP servers များသည် notifications/tools/list_changed(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) notification မှတစ်ဆင့် ၎င်းတို့ ပေးသော tools စာရင်းကို အချိန်နှင့်တပြေးညီ ပြောင်းလဲနိုင်သောကြောင့် MCP tools များသည် အထူးရှုပ်ထွေးနိုင်သည်ကို သတိပြုပါ။ ရှည်လျားသော conversation အလယ်တွင် ဤ notification ကို လေးစားလိုက်နာခြင်းက စရိတ်ကြီးမားသော cache miss တစ်ခု ဖြစ်စေနိုင်သည်။
ဖြစ်နိုင်သည့်အခါ conversation အလယ်တွင် ဖြစ်ပေါ်သော configuration changes များကို earlier message တစ်ခုကို ပြင်ဆင်မည့်အစား အပြောင်းအလဲကို ထင်ဟပ်စေရန် input ထဲသို့ message အသစ် တစ်ခု ပူးတွဲထည့်သွင်းခြင်းဖြင့် ကိုင်တွယ်ပါသည် -
- sandbox configuration သို့မဟုတ် approval mode ပြောင်းလဲလျှင် မူလ
<permissions instructions>item နှင့် format တူသောrole=developermessage အသစ်ကို ထည့်သွင်း(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)ပါသည်။ - current working directory ပြောင်းလဲလျှင် မူလ
<environment_context>နှင့် format တူသောrole=usermessage အသစ်ကို ထည့်သွင်း(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်)ပါသည်။
performance အတွက် cache hits ရရှိစေရန် ကျွန်ုပ်တို့ အလွန် ကြိုးပမ်းပါသည်။ ကျွန်ုပ်တို့ စီမံခန့်ခွဲရမည့် နောက်ထပ် အရေးကြီးသော resource တစ်ခုလည်း ရှိသေးသည် - context window ဖြစ်သည်။
context window မကုန်သွားစေရန် ကျွန်ုပ်တို့၏ ယေဘုယျ strategy သည် token အရေအတွက် threshold တစ်ခုကျော်သွားသောအခါ conversation ကို compact လုပ်ခြင်းဖြစ်သည်။ တိတိကျကျဆိုရလျှင် conversation ကို ကိုယ်စားပြုနိုင်သော items စာရင်းအသစ်နှင့် ပိုသေးငယ်သော items စာရင်းတစ်ခုဖြင့် input ကို အစားထိုးပြီး အေးဂျင့်သည် ယခုအချိန်အထိ ဖြစ်ပျက်ခဲ့သမျှကို နားလည်မှုရှိစွာ ဆက်လက်လုပ်ဆောင်နိုင်စေသည်။ အစောပိုင်း compaction implementation(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) တစ်ခုတွင် အသုံးပြုသူက /compact command ကို ကိုယ်တိုင် invoke လုပ်ရပြီး ရှိပြီးသား conversation နှင့် summarization(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) အတွက် custom instructions များကို အသုံးပြုကာ Responses API ကို query လုပ်ရသည်။ Codex သည် resulting assistant message အတွင်းရှိ summary ကို subsequent conversation turns အတွက် input အသစ်အဖြစ်(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) အသုံးပြုခဲ့သည်။
ထိုနောက် Responses API သည် compaction ကို ပိုမိုထိရောက်စွာ လုပ်ဆောင်ပေးသော အထူး /responses/compact endpoint(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ကို ပံ့ပိုးနိုင်အောင် တိုးတက်လာခဲ့သည်။ ၎င်းသည် ယခင် input အစား အသုံးပြုကာ conversation ကို ဆက်လက်လုပ်ဆောင်နိုင်ပြီး context window ကိုလည်း လွတ်စေသော items စာရင်းတစ်ခု(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ကို ပြန်ပေးသည်။ ဤစာရင်းတွင် မူလ conversation အပေါ် မော်ဒယ်၏ latent understanding ကို ထိန်းသိမ်းထားသော opaque encrypted_content item ပါဝင်သည့် အထူး type=compaction item တစ်ခု ပါရှိသည်။ ယခု Codex သည် auto_compact_limit(ဝင်းဒိုးအသစ်တွင် ဖွင့်မည်) ကျော်လွန်သွားသောအခါ conversation ကို compact လုပ်ရန် ဤ endpoint ကို အလိုအလျောက် အသုံးပြုပါသည်။
Codex အေးဂျင့် loop ကို မိတ်ဆက်ခဲ့ပြီး မော်ဒယ်ကို query လုပ်သောအခါ Codex က ၎င်း၏ context ကို မည်သို့ ဖန်တီးထိန်းချုပ်သည်ကို လေ့လာခဲ့ပါသည်။ လမ်းတစ်လျှောက်တွင် Responses API အပေါ် အေးဂျင့် loop တစ်ခု တည်ဆောက်သူတိုင်းအတွက် သက်ဆိုင်သော လက်တွေ့စဉ်းစားချက်များနှင့် best practices များကိုလည်း အထူးဖော်ပြခဲ့ပါသည်။
အေးဂျင့် loop သည် Codex ၏ အခြေခံကို ပံ့ပိုးပေးသော်လည်း ၎င်းသည် အစသာ ဖြစ်ပါသည်။ လာမည့်ပို့စ်များတွင် CLI ၏ architecture ကို နက်ရှိုင်းစွာ လေ့လာပြီး tool use ကို မည်သို့ အကောင်အထည်ဖော်ထားသည်ကို ရှာဖွေကာ Codex ၏ sandboxing model ကိုလည်း ပိုမိုနီးကပ်စွာ ကြည့်ရှုမည်ဖြစ်သည်။


