@@ -38,9 +38,7 @@ type AgentLoopParams = {
3838 onItem : ( item : ResponseItem ) => void ;
3939 onLoading : ( loading : boolean ) => void ;
4040
41- /**
42- * Used to reach out to the user only if the command is not auto-approved.
43- */
41+ /** Called when the command is not auto-approved to request explicit user review. */
4442 getCommandConfirmation : (
4543 command : Array < string > ,
4644 applyPatch : ApplyPatchCommand | undefined ,
@@ -53,12 +51,12 @@ export class AgentLoop {
5351 private instructions ?: string ;
5452 private approvalPolicy : ApprovalPolicy ;
5553 private config : AppConfig ;
56- // Using `InstanceType<typeof OpenAI>` sidesteps typing issues with the
57- // OpenAI package under the TS 5+ `moduleResolution=bundler` setup.
58- // OpenAI client instance. We keep the concrete type to avoid sprinkling
59- // `any` across the implementation while still allowing paths where the
60- // OpenAI SDK types may not perfectly match. The `typeof OpenAI` pattern
61- // captures the instance shape without resorting to `any`.
54+
55+ // Using `InstanceType<typeof OpenAI>` sidesteps typing issues with the OpenAI package under
56+ // the TS 5+ `moduleResolution=bundler` setup. OpenAI client instance. We keep the concrete
57+ // type to avoid sprinkling `any` across the implementation while still allowing paths where
58+ // the OpenAI SDK types may not perfectly match. The `typeof OpenAI` pattern captures the
59+ // instance shape without resorting to `any`.
6260 private oai : OpenAI ;
6361
6462 private onItem : ( item : ResponseItem ) => void ;
@@ -688,7 +686,7 @@ export class AgentLoop {
688686 // process and surface each item (no‑op until we can depend on streaming events)
689687 if ( event . type === "response.output_item.done" ) {
690688 const item = event . item ;
691- // ① if it's a reasoning item, annotate it
689+ // 1) if it's a reasoning item, annotate it
692690 type ReasoningItem = { type ?: string ; duration_ms ?: number } ;
693691 const maybeReasoning = item as ReasoningItem ;
694692 if ( maybeReasoning . type === "reasoning" ) {
@@ -776,7 +774,7 @@ export class AgentLoop {
776774 // thinking times so UIs and tests can surface/verify them.
777775 // const thinkingEnd = Date.now();
778776
779- // ① Per‑turn measurement – exact time spent between request and
777+ // 1) Per‑turn measurement – exact time spent between request and
780778 // response for *this* command.
781779 // this.onItem({
782780 // id: `thinking-${thinkingEnd}`,
@@ -792,7 +790,7 @@ export class AgentLoop {
792790 // ],
793791 // });
794792
795- // ② Session‑wide cumulative counter so users can track overall wait
793+ // 2) Session‑wide cumulative counter so users can track overall wait
796794 // time across multiple turns.
797795 // this.cumulativeThinkingMs += thinkingEnd - thinkingStart;
798796 // this.onItem({
@@ -975,6 +973,7 @@ export class AgentLoop {
975973}
976974
977975const prefix = `You are operating as and within the Codex CLI, a terminal-based agentic coding assistant built by OpenAI. It wraps OpenAI models to enable natural language interaction with a local codebase. You are expected to be precise, safe, and helpful.
976+
978977You can:
979978- Receive user prompts, project context, and files.
980979- Stream responses and emit function calls (e.g., shell commands, code edits).
0 commit comments