Commit Graph

1998 Commits

Author SHA1 Message Date
kevin zhao
0e6d965f65 updating default.policy with better not_match (or, if it is too evident, removing not_match entirely) 2025-11-13 22:07:41 -05:00
kevin zhao
b323a9248d updating basic.rs to have a less obvious not match 2025-11-13 22:07:41 -05:00
kevin zhao
7681b325fe basic.rs: using expect tests 2025-11-13 22:07:41 -05:00
kevin zhao
2217cb05ee fix lint 2025-11-13 22:07:41 -05:00
kevin zhao
c086fe35a5 adding is_match to Evaluation 2025-11-13 22:07:41 -05:00
kevin zhao
755331425e refactor: implementing rule traits, rulematch enum 2025-11-13 22:07:41 -05:00
kevin zhao
4ca1834eac update docstring 2025-11-13 22:07:41 -05:00
kevin zhao
8b4283e4ad improve phrasing 2025-11-13 22:07:41 -05:00
kevin zhao
58acf0b833 adding docstrings for PrefixPattern and PatternToken 2025-11-13 22:07:40 -05:00
kevin zhao
8834e4bbdc helper function to get PolicyBuilder + only getting one builder in prefix_rule 2025-11-13 22:07:40 -05:00
kevin zhao
8775a99e3d fallback instead of panicking 2025-11-13 22:07:40 -05:00
kevin zhao
00ff42d594 using shlex::try_join instead of " ".join() 2025-11-13 22:07:40 -05:00
kevin zhao
ff09321eb1 updated error messaging to indicate type 2025-11-13 22:07:40 -05:00
kevin zhao
a67521926a fmt 2025-11-13 22:07:40 -05:00
kevin zhao
17bb82de77 using .iter() instead of mut 2025-11-13 22:07:40 -05:00
kevin zhao
ecbcc37bfb alphasort members 2025-11-13 22:07:40 -05:00
kevin zhao
b03c3c3d1f more early return lines 2025-11-13 22:07:40 -05:00
kevin zhao
a2890e2ca7 adding a line after early return block 2025-11-13 22:07:39 -05:00
kevin zhao
230cb2e3e2 best -> strictest 2025-11-13 22:07:39 -05:00
kevin zhao
7737444356 clippy 2025-11-13 22:07:39 -05:00
kevin zhao
90411d6e90 [parser.rs] match token vector on length 2025-11-13 22:07:39 -05:00
kevin zhao
5fd2172f9f update lints 2025-11-13 22:07:39 -05:00
zhao-oai
1b09f32cd5 Update codex-rs/execpolicy2/src/parser.rs
Co-authored-by: Michael Bolin <mbolin@openai.com>
2025-11-13 22:07:39 -05:00
kevin zhao
31736f2c20 remove license 2025-11-13 22:07:39 -05:00
kevin zhao
b405a8c812 refactor parse_pattern to use iterator chain 2025-11-13 22:07:39 -05:00
kevin zhao
bc375db0ab using parking_lot mutex + AtomicU64 for auto id 2025-11-13 22:07:38 -05:00
kevin zhao
73cbf5a83e add docstrings to decision struct 2025-11-13 22:07:38 -05:00
kevin zhao
072f5c28fc using clap for execpolicy v2 cli 2025-11-13 22:07:38 -05:00
kevin zhao
2952c14719 implementing PartialOrd for Decision instead of defining custom is_stricter_than func 2025-11-13 22:07:38 -05:00
kevin zhao
270abdc0c4 use camelCase in Decision' 2025-11-13 22:07:38 -05:00
kevin zhao
aa15efd7a3 update readme 2025-11-13 22:07:38 -05:00
kevin zhao
ca9e61497d README 2025-11-13 22:07:38 -05:00
kevin zhao
687a8c38ff introduce variant typing to policy result 2025-11-13 22:07:38 -05:00
kevin zhao
0bac9939af better default policy + lint 2025-11-13 22:07:38 -05:00
kevin zhao
bf716081fc clean up test 2025-11-13 22:07:38 -05:00
kevin zhao
55e49a8016 remove extraneous test 2025-11-13 22:07:37 -05:00
kevin zhao
64e786caad simplify 2025-11-13 22:07:37 -05:00
kevin zhao
9aea52efb1 simplify logic 2025-11-13 22:07:37 -05:00
kevin zhao
7e79c4dc5b refactor rules so no more cartesian product 2025-11-13 22:07:37 -05:00
kevin zhao
eea9bff1fb remove tokenize_command use cases 2025-11-13 22:07:37 -05:00
kevin zhao
71ea7edca4 update shape of RuleMatch and Evaluation 2025-11-13 22:07:37 -05:00
kevin zhao
85edde08c1 fix cargo shear 2025-11-13 22:07:37 -05:00
kevin zhao
773177ec8b first pass at prefix rules 2025-11-13 22:07:37 -05:00
pakrym-oai
6c384eb9c6 tests: replace mount_sse_once_match with mount_sse_once for SSE mocking (#6640) 2025-11-13 18:04:05 -08:00
Ahmed Ibrahim
2a6e9b20df Promote shared helpers for suite tests (#6460)
## Summary
- add `TestCodex::submit_turn_with_policies` and extend the response
helpers with reusable tool-call utilities
- update the grep_files, read_file, list_dir, shell_serialization, and
tools suites to rely on the shared helpers instead of local copies
- make the list_dir helper return `anyhow::Result` so clippy no longer
warns about `expect`

## Testing
- `just fix -p codex-core`
- `cargo test -p codex-core --test all
suite::grep_files::grep_files_tool_collects_matches`
- `cargo test -p codex-core
suite::grep_files::grep_files_tool_collects_matches -- --ignored`
(filter requests ignored tests so nothing runs, but the build stays
clean)


------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_69112d53abac83219813cab4d7cb6446)
2025-11-13 17:12:10 -08:00
Ahmed Ibrahim
f3c6b1334b Use shared network gating helper in chat completion tests (#6461)
## Summary
- replace the bespoke network check in the chat completion payload and
SSE tests with the existing `skip_if_no_network!` helper so they follow
the same gating convention as the rest of the suite

## Testing
- `just fmt`


------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_69112d4cb9f08321ba773e8ccf39778e)
2025-11-13 17:11:43 -08:00
Ahmed Ibrahim
9890ceb939 Avoid double truncation (#6631)
1. Avoid double truncation by giving 10% above the tool default constant
2. Add tests that fails when const = 1
2025-11-13 16:59:31 -08:00
pakrym-oai
7b027e7536 Revert "Revert "Overhaul shell detection and centralize command generation for unified exec"" (#6607)
Reverts openai/codex#6606
2025-11-13 16:45:17 -08:00
Owen Lin
db2aa57d73 [app-server] small fixes for JSON schema export and one-of types (#6614)
A partner is consuming our generated JSON schema bundle for app-server
and identified a few issues:
- not all polymorphic / one-of types have a type descriminator
- `"$ref": "#/definitions/v2/SandboxPolicy"` is missing
- "Option<>" is an invalid schema name, and also unnecessary

This PR:
- adds the type descriminator to the various types that are missing it
except for `SessionSource` and `SubAgentSource` because they are
serialized to disk (adding this would break backwards compat for
resume), and they should not be necessary to consume for an integration
with app-server.
- removes the special handling in `export.rs` of various types like
SandboxPolicy, which turned out to be unnecessary and incorrect
- filters out `Option<>` which was auto-generated for request params
that don't need a body

For context, we currently pull in wayyy more types than we need through
the `EventMsg` god object which we are **not** planning to expose in API
v2 (this is how I suspect `SessionSource` and `SubAgentSource` are being
pulled in). But until we have all the necessary v2 notifications in
place that will allow us to remove `EventMsg`, we will keep exporting it
for now.
2025-11-13 16:25:17 -08:00
Celia Chen
b8ec97c0ef [App-server] add new v2 events:item/reasoning/delta, item/agentMessage/delta & item/reasoning/summaryPartAdded (#6559)
core event to app server event mapping:
1. `codex/event/reasoning_content_delta` ->
`item/reasoning/summaryTextDelta`.
2. `codex/event/reasoning_raw_content_delta` ->
`item/reasoning/textDelta`
3. `codex/event/agent_message_content_delta` →
`item/agentMessage/delta`.
4. `codex/event/agent_reasoning_section_break` ->
`item/reasoning/summaryPartAdded`.

Also added a change in core to pass down content index, summary index
and item id from events.

Tested with the `git checkout owen/app_server_test_client && cargo run
-p codex-app-server-test-client -- send-message-v2 "hello"` and verified
that new events are emitted correctly.
2025-11-14 00:25:01 +00:00