Skip to content

Commit 6e05fec

Browse files
committed
docs: update a few examples
1 parent 8cb5fab commit 6e05fec

File tree

3 files changed

+13
-54
lines changed

3 files changed

+13
-54
lines changed

examples/tools/codex.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def main() -> None:
107107
agent = Agent(
108108
name="Codex Agent",
109109
instructions=(
110-
"Use the codex tool to inspect the workspace and answer the question. "
110+
"Use the codex tool to inspect the workspace in read-only mode and answer the question. "
111111
"When skill names, which usually starts with `$`, are mentioned, "
112112
"you must rely on the codex tool to use the skill and answer the question.\n\n"
113113
"When you send the final answer, you must include the following info at the end:\n\n"
@@ -116,7 +116,7 @@ async def main() -> None:
116116
tools=[
117117
# Run local Codex CLI as a sub process
118118
codex_tool(
119-
sandbox_mode="workspace-write",
119+
sandbox_mode="read-only",
120120
default_thread_options=ThreadOptions(
121121
# You can pass a Codex instance to customize CLI details
122122
# codex=Codex(executable_path="/path/to/codex", base_url="..."),
@@ -145,18 +145,21 @@ async def main() -> None:
145145
"You must use `$openai-knowledge` skill to fetch the latest realtime model name.",
146146
)
147147
log(result.final_output)
148-
# The latest realtime model name, according to the $openai-knowledge skill, is gpt-realtime.
148+
# The exact model name may change over time.
149149

150-
# Use a skill that runs local command and analyzes the output
150+
# Use local inspection in read-only mode.
151151
log(
152-
"Using $test-coverage-improver skill to analyze the test coverage of the project and improve it..."
152+
"Using the Codex tool to inspect AGENTS.md and summarize the local verification workflow..."
153153
)
154154
result = await Runner.run(
155155
agent,
156-
"You must use `$test-coverage-improver` skill to analyze the test coverage of the project and improve it.",
156+
(
157+
"Inspect AGENTS.md and summarize the mandatory local verification commands for this "
158+
"repository. Do not modify any files or suggest code changes."
159+
),
157160
)
158161
log(result.final_output)
159-
# (Aa few suggestions for improving the test coverage will be displayed.)
162+
# (A read-only summary of the local verification workflow will be displayed.)
160163

161164

162165
if __name__ == "__main__":

examples/tools/codex_same_thread.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ async def main() -> None:
6565
instructions=(
6666
"Always use the Codex tool answer the user's question. "
6767
"Even when you don't have enough context, the Codex tool may know. "
68-
"In that case, you can simply forward the question to the Codex tool."
68+
"In that case, you can simply forward the question to the Codex tool. "
69+
"Treat the workspace as read-only and respond with code snippets in chat."
6970
),
7071
tools=[
7172
codex_tool(
7273
# Give each Codex tool a unique `codex_` name when you run multiple tools in one agent.
7374
# Name-based defaults keep their run-context thread IDs separated.
7475
name="codex_engineer",
75-
sandbox_mode="workspace-write",
76+
sandbox_mode="read-only",
7677
default_thread_options=ThreadOptions(
7778
model="gpt-5.2-codex",
7879
model_reasoning_effort="low",

examples/tools/local_shell.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)