You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are an assistant that triages new GitHub issues by identifying potential duplicates.
52
+
53
+
You will receive the following JSON files located in the current working directory:
54
+
- `codex-current-issue.json`: JSON object describing the newly created issue (fields: number, title, body).
55
+
- `codex-existing-issues.json`: JSON array of recent issues (each element includes number, title, body, createdAt).
56
+
57
+
Instructions:
58
+
- Compare the current issue against the existing issues to find up to five that appear to describe the same underlying problem or request.
59
+
- Focus on the underlying intent and context of each issue—such as reported symptoms, feature requests, reproduction steps, or error messages—rather than relying solely on string similarity or synthetic metrics.
60
+
- After your analysis, validate your results in 1-2 lines explaining your decision to return the selected matches.
61
+
- When unsure, prefer returning fewer matches.
62
+
- Include at most five numbers.
63
+
64
+
output-schema: |
65
+
{
66
+
"type": "object",
67
+
"properties": {
68
+
"issues": {
69
+
"type": "array",
70
+
"items": {
71
+
"type": "string"
72
+
}
73
+
},
74
+
"reason": { "type": "string" }
75
+
},
76
+
"required": ["issues", "reason"],
77
+
"additionalProperties": false
78
+
}
52
79
53
80
comment-on-issue:
54
81
name: Comment with potential duplicates
@@ -66,22 +93,33 @@ jobs:
66
93
with:
67
94
github-token: ${{ github.token }}
68
95
script: |
69
-
let numbers;
96
+
const raw = process.env.CODEX_OUTPUT ?? '';
97
+
let parsed;
70
98
try {
71
-
numbers = JSON.parse(process.env.CODEX_OUTPUT);
99
+
parsed = JSON.parse(raw);
72
100
} catch (error) {
73
101
core.info(`Codex output was not valid JSON. Raw output: ${raw}`);
You are an assistant that reviews GitHub issues for the repository.
28
+
29
+
Your job is to choose the most appropriate existing labels for the issue described later in this prompt.
30
+
Follow these rules:
31
+
- Only pick labels out of the list below.
32
+
- Prefer a small set of precise labels over many broad ones.
33
+
34
+
Labels to apply:
35
+
1. bug — Reproducible defects in Codex products (CLI, VS Code extension, web, auth).
36
+
2. enhancement — Feature requests or usability improvements that ask for new capabilities, better ergonomics, or quality-of-life tweaks.
37
+
3. extension — VS Code (or other IDE) extension-specific issues.
38
+
4. windows-os — Bugs or friction specific to Windows environments (always when PowerShell is mentioned, path handling, copy/paste, OS-specific auth or tooling failures).
39
+
5. mcp — Topics involving Model Context Protocol servers/clients.
40
+
6. codex-web — Issues targeting the Codex web UI/Cloud experience.
41
+
8. azure — Problems or requests tied to Azure OpenAI deployments.
42
+
9. documentation — Updates or corrections needed in docs/README/config references (broken links, missing examples, outdated keys, clarification requests).
43
+
10. model-behavior — Undesirable LLM behavior: forgetting goals, refusing work, hallucinating environment details, quota misreports, or other reasoning/performance anomalies.
44
+
45
+
Issue number: ${{ github.event.issue.number }}
46
+
47
+
Issue title:
48
+
${{ github.event.issue.title }}
49
+
50
+
Issue body:
51
+
${{ github.event.issue.body }}
52
+
53
+
Repository full name:
54
+
${{ github.repository }}
55
+
56
+
output-schema: |
57
+
{
58
+
"type": "object",
59
+
"properties": {
60
+
"labels": {
61
+
"type": "array",
62
+
"items": {
63
+
"type": "string"
64
+
}
65
+
}
66
+
},
67
+
"required": ["labels"],
68
+
"additionalProperties": false
69
+
}
33
70
34
71
apply-labels:
35
72
name: Apply labels from Codex output
@@ -53,12 +90,12 @@ jobs:
53
90
exit 0
54
91
fi
55
92
56
-
if ! printf '%s' "$json" | jq -e 'type == "array"' >/dev/null 2>&1; then
57
-
echo "Codex output was not a JSON array. Raw output: $json"
93
+
if ! printf '%s' "$json" | jq -e 'type == "object" and (.labels | type == "array")' >/dev/null 2>&1; then
94
+
echo "Codex output did not include a labels array. Raw output: $json"
Copy file name to clipboardExpand all lines: AGENTS.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,16 @@ In the codex-rs folder where the rust code lives:
8
8
- Never add or modify any code related to `CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR` or `CODEX_SANDBOX_ENV_VAR`.
9
9
- You operate in a sandbox where `CODEX_SANDBOX_NETWORK_DISABLED=1` will be set whenever you use the `shell` tool. Any existing code that uses `CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR` was authored with this fact in mind. It is often used to early exit out of tests that the author knew you would not be able to run given your sandbox limitations.
10
10
- Similarly, when you spawn a process using Seatbelt (`/usr/bin/sandbox-exec`), `CODEX_SANDBOX=seatbelt` will be set on the child process. Integration tests that want to run Seatbelt themselves cannot be run under Seatbelt, so checks for `CODEX_SANDBOX=seatbelt` are also often used to early exit out of tests, as appropriate.
11
+
- Always collapse if statements per https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
12
+
- Always inline format! args when possible per https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
13
+
- Use method references over closures when possible per https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
14
+
- When writing tests, prefer comparing the equality of entire objects over fields one by one.
11
15
12
16
Run `just fmt` (in `codex-rs` directory) automatically after making Rust code changes; do not ask for approval to run it. Before finalizing a change to `codex-rs`, run `just fix -p <project>` (in `codex-rs` directory) to fix any linter issues in the code. Prefer scoping with `-p` to avoid slow workspace‑wide Clippy builds; only run `just fix` without `-p` if you changed shared crates. Additionally, run the tests:
17
+
13
18
1. Run the test for the specific project that was changed. For example, if changes were made in `codex-rs/tui`, run `cargo test -p codex-tui`.
14
19
2. Once those pass, if any changes were made in common, core, or protocol, run the complete test suite with `cargo test --all-features`.
15
-
When running interactively, ask the user before running `just fix` to finalize. `just fmt` does not require approval. project-specific or individual tests can be run without asking the user, but do ask the user before running the complete test suite.
20
+
When running interactively, ask the user before running `just fix` to finalize. `just fmt` does not require approval. project-specific or individual tests can be run without asking the user, but do ask the user before running the complete test suite.
- Prefer Stylize helpers: use "text".dim(), .bold(), .cyan(), .italic(), .underlined() instead of manual Style where possible.
32
38
- Prefer simple conversions: use "text".into() for spans and vec![…].into() for lines; when inference is ambiguous (e.g., Paragraph::new/Cell::from), use Line::from(spans) or Span::from(text).
33
39
- Computed styles: if the Style is computed at runtime, using `Span::styled` is OK (`Span::from(text).set_style(style)` is also acceptable).
@@ -39,6 +45,7 @@ See `codex-rs/tui/styles.md`.
39
45
- Compactness: prefer the form that stays on one line after rustfmt; if only one of Line::from(vec![…]) or vec![…].into() avoids wrapping, choose that. If both wrap, pick the one with fewer wrapped lines.
40
46
41
47
### Text wrapping
48
+
42
49
- Always use textwrap::wrap to wrap plain strings.
43
50
- If you have a ratatui Line and you want to wrap it, use the helpers in tui/src/wrapping.rs, e.g. word_wrap_lines / word_wrap_line.
44
51
- If you need to indent wrapped lines, use the initial_indent / subsequent_indent options from RtOptions if you can, rather than writing custom logic.
@@ -60,8 +67,34 @@ This repo uses snapshot tests (via `insta`), especially in `codex-rs/tui`, to va
60
67
-`cargo insta accept -p codex-tui`
61
68
62
69
If you don’t have the tool:
70
+
63
71
-`cargo install cargo-insta`
64
72
65
73
### Test assertions
66
74
67
75
- Tests should use pretty_assertions::assert_eq for clearer diffs. Import this at the top of the test module if it isn't already.
76
+
77
+
### Integration tests (core)
78
+
79
+
- Prefer the utilities in `core_test_support::responses` when writing end-to-end Codex tests.
80
+
81
+
- All `mount_sse*` helpers return a `ResponseMock`; hold onto it so you can assert against outbound `/responses` POST bodies.
82
+
- Use `ResponseMock::single_request()` when a test should only issue one POST, or `ResponseMock::requests()` to inspect every captured `ResponsesRequest`.
83
+
-`ResponsesRequest` exposes helpers (`body_json`, `input`, `function_call_output`, `custom_tool_call_output`, `call_output`, `header`, `path`, `query_param`) so assertions can target structured payloads instead of manual JSON digging.
84
+
- Build SSE payloads with the provided `ev_*` constructors and the `sse(...)`.
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
2
1
<palign="center"><code>npm i -g @openai/codex</code><br />or <code>brew install codex</code></p>
3
2
4
3
<palign="center"><strong>Codex CLI</strong> is a coding agent from OpenAI that runs locally on your computer.
@@ -62,8 +61,7 @@ You can also use Codex with an API key, but this requires [additional setup](./d
62
61
63
62
### Model Context Protocol (MCP)
64
63
65
-
Codex CLI supports [MCP servers](./docs/advanced.md#model-context-protocol-mcp). Enable by adding an `mcp_servers` section to your `~/.codex/config.toml`.
66
-
64
+
Codex can access MCP servers. To configure them, refer to the [config docs](./docs/config.md#mcp_servers).
67
65
68
66
### Configuration
69
67
@@ -83,9 +81,11 @@ Codex CLI supports a rich set of configuration options, with preferences stored
0 commit comments