Skip to content

Commit 4722813

Browse files
committed
fix several issues
1 parent fc72ea6 commit 4722813

43 files changed

Lines changed: 1075 additions & 131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/codex-auth-helper/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ This helper is usually upstream of the adapter, not a replacement for it.
155155

156156
### Build a Codex-backed `pydantic-ai` model
157157

158-
Use `create_codex_responses_model(...)`.
158+
Use `create_codex_responses_model(...)` and pass explicit `instructions=...`.
159159

160160
### Build a lower-level client first
161161

@@ -164,7 +164,8 @@ Use `create_codex_async_openai(...)` when you need the transport/client object e
164164
### Build a LangChain model
165165

166166
Use `create_codex_chat_openai(...)` when the upstream runtime is LangChain or LangGraph and you
167-
want the Responses API path instead of hand-wiring `langchain-openai`.
167+
want the Responses API path instead of hand-wiring `langchain-openai`. Pass explicit
168+
`instructions=...` here too.
168169

169170
### Debug refresh behavior
170171

.agents/skills/codex-auth-helper/examples/codex_chat_openai_graph.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ def describe_codex_surface() -> str:
1919

2020

2121
graph = create_agent(
22-
model=create_codex_chat_openai(MODEL_NAME),
22+
model=create_codex_chat_openai(
23+
MODEL_NAME,
24+
instructions=(
25+
"You are a helpful coding assistant. "
26+
"Explain concrete workspace observations and use tools when helpful."
27+
),
28+
),
2329
tools=[describe_codex_surface],
2430
name="codex-chat-openai-graph",
2531
)

.agents/skills/codex-auth-helper/examples/codex_responses_agent.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
MODEL_NAME = os.getenv("CODEX_MODEL", "gpt-5.4")
1010

1111
agent = Agent(
12-
create_codex_responses_model(MODEL_NAME),
13-
name="codex-responses-agent",
14-
instructions=(
15-
"You are a concise coding assistant. Ask for clarification when the task is underspecified."
12+
create_codex_responses_model(
13+
MODEL_NAME,
14+
instructions=(
15+
"You are a concise coding assistant. "
16+
"Ask for clarification when the task is underspecified."
17+
),
1618
),
19+
name="codex-responses-agent",
1720
)
1821

1922

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ scripts/check_releases.py
9696
connect*.py
9797
expose*.py
9898
CHANGELOG
99+
/.acprouter-state
100+
/.deepagents-graph
101+
/.workspace-graph

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
0.9.1

docs/bridges.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ ACP Kit models those callable shapes locally and passes them through the public
106106

107107
That means:
108108

109-
- bridge extension code should import history-processor aliases from
110-
`pydantic_acp`, not from `pydantic_ai._history_processor`
111109
- the adapter is no longer directly coupled to upstream private
112110
history-processor imports
113111

docs/examples/deepagents.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This example is the maintained DeepAgents-facing showcase for `langchain-acp`.
88

99
It demonstrates:
1010

11+
- a Codex-backed `ChatOpenAI` model created through `codex-auth-helper`
1112
- wiring a DeepAgents graph through `langchain-acp`
1213
- `DeepAgentsCompatibilityBridge`
1314
- `DeepAgentsProjectionMap`
@@ -30,6 +31,12 @@ Run it:
3031
uv run python -m examples.langchain.deepagents_graph
3132
```
3233

34+
Required local state:
35+
36+
```text
37+
~/.codex/auth.json
38+
```
39+
3340
If you want the module-level compiled graph directly, the example exports `graph` when `deepagents` is installed:
3441

3542
```bash

docs/examples/langchain-codex.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ This example demonstrates the helper-to-adapter path for LangChain:
1010
- `langchain.agents.create_agent(...)` owns the graph
1111
- `langchain-acp` exposes that graph through ACP
1212

13+
The model factory call must pass `instructions=` explicitly:
14+
15+
```python
16+
model = create_codex_chat_openai(
17+
"gpt-5.4",
18+
instructions="You are a helpful coding assistant.",
19+
)
20+
```
21+
1322
Run it:
1423

1524
```bash
@@ -22,6 +31,12 @@ Required local state:
2231
~/.codex/auth.json
2332
```
2433

34+
Override the default model when needed:
35+
36+
```bash
37+
CODEX_MODEL=gpt-5.4-mini uv run python -m examples.langchain.codex_graph
38+
```
39+
2540
If you have not logged in yet:
2641

2742
```bash

docs/examples/langchain-workspace.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This example is the maintained plain-LangChain showcase.
88

99
It demonstrates:
1010

11+
- a Codex-backed `ChatOpenAI` model created through `codex-auth-helper`
1112
- a module-level `graph`, `config`, and `main()`
1213
- a session-aware `graph_from_session(...)` factory
1314
- `acpkit run examples.langchain.workspace_graph:graph`
@@ -21,6 +22,18 @@ Run it:
2122
uv run python -m examples.langchain.workspace_graph
2223
```
2324

25+
Required local state:
26+
27+
```text
28+
~/.codex/auth.json
29+
```
30+
31+
Override the default model when needed:
32+
33+
```bash
34+
CODEX_MODEL=gpt-5.4-mini uv run python -m examples.langchain.workspace_graph
35+
```
36+
2437
Or expose the graph directly through the root CLI:
2538

2639
```bash

docs/getting-started/langchain-quickstart.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ from codex_auth_helper import create_codex_chat_openai
2929
from langchain.agents import create_agent
3030

3131
graph = create_agent(
32-
model=create_codex_chat_openai("gpt-5.4"),
32+
model=create_codex_chat_openai(
33+
"gpt-5.4",
34+
instructions="Answer directly and keep responses short.",
35+
),
3336
tools=[],
3437
name="codex-graph",
3538
)
@@ -38,6 +41,9 @@ graph = create_agent(
3841
That path keeps the model on the OpenAI Responses API while reusing
3942
`~/.codex/auth.json` and the helper's refresh flow.
4043

44+
`create_codex_chat_openai(...)` requires `instructions=`. Pass them at model
45+
construction time, including inside `graph_factory=` flows.
46+
4147
## 2. Expose The Graph Through ACP
4248

4349
Wrap the graph with `run_acp(...)`:

0 commit comments

Comments
 (0)